Pathfinding Bug: Cannot pathfind outside of top left screen

  • Problem Description

    Pathfinding seems to not be able to locate paths outside of the top screen. It's very arbitrary behavior and I'm at a loss as to how to describe it. Depending on the position of the Pathfinding object, and the object being pathfound to, either the object cannot find a path (despite no collision in the scene) or the object "can" find a path, but the path is not correct and stops halfway down the screen.

    Attach a Capx ... ngBug.capx

    Description of Capx

    Keyboard commands spawn an object with the Pathfinding behavior, and cue the object to find a path to a different object.

    Steps to Reproduce Bug

    • Run Layout 2
    • Press A to spawn the Pathfinder object (spawns on blue object called PathfindTo)
    • Press S to find path to PathfindFrom object (green)

    Observed Result

    Object finds a path, travels along the path, and stops before it reaches its real destination - it stops in the middle of the screen.

    Moving the blue and green PathfindTo and PathfindFrom objects into different configurations creates different results. Sometimes a path is able to be found, like the configuration on Layout 1

    Expected Result

    Object finds a path, and travels along the path to its destination.

    Affected Browsers

    • N/A

    Operating System and Service Pack

    Windows 10 Home

    Construct 2 Version ID

    R229 (also was not working in R227)

  • The pathfinding behavior cannot find paths outside the layout area, because that would imply an infinite sized pathfinding grid. So the whole area outside the layout is treated as obstacle. Are you sure it's not that?

    Otherwise the .capx has enough events it could just be an event mistake - if the pathfinding behavior really can't find a path to a certain area, surely you can reproduce that with a single "find path" action? Can you simplify the .capx at all to isolate the exact problem? It's also easier to understand the problem if you don't include any disabled events at all.

  • Alright so I've narrowed it down actually to a bug that was posted a few times here months ago where the Pathfinding behavior uses the previous layout size as an obstacle, and it was stated that it would be fixed in the next beta (span-class-posthilit-pathfind-span-behavious-uses-previous-layout-s_p1024262?#p1024262)

    I'm still having this problem in r229, so either it was not fixed or it's back.

    Steps to reproduce:

    • Open Layout 1.
    • Press A to spawn the Pathfinder object.
    • Press S to find a path to the Green square. On contact with the green square, Layout 2 should be loaded.
    • When Layout 2 is loaded, press D to find a path back to the blue square
    • The Pathfinder object will stop at the edge of the screen (marked by non-obstacle red lines) instead of traveling all the way to its true destination.
    • If the Green square in Layout 2 is anywhere below the red line, the Pathfinder object will not be able to find a path at all.
    • Regenerating Obstacle Map seemingly does not work, as it is done at the start of the layout.

    Interestingly, if Layout 2 is loaded first, it works fine.

    CAPX: ... .capx?dl=0

  • Ah, yes, there was another case where changing layouts did not correctly take in to account the new layout size. This should be fixed in the next beta.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Alright, thank you!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)