Pathfinding Bug: Cannot pathfind outside of top left screen

Bugs will be moved here once resolved.

Post » Mon Jun 13, 2016 7:21 pm

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
https://dl.dropboxusercontent.com/u/987 ... 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)
B
18
S
5
G
1
Posts: 96
Reputation: 2,680

Post » Mon Jun 20, 2016 3:05 pm

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.
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240

Post » Mon Jun 20, 2016 4:15 pm

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: https://www.dropbox.com/s/w8nd7118zsjj6 ... .capx?dl=0
B
18
S
5
G
1
Posts: 96
Reputation: 2,680

Post » Mon Jun 20, 2016 4:32 pm

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.
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240

Post » Mon Jun 20, 2016 5:22 pm

Alright, thank you!
B
18
S
5
G
1
Posts: 96
Reputation: 2,680


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest