Pathfinder regenerate obstaclemap broken

Bugs will be moved here once resolved.

Post » Mon Aug 24, 2015 9:26 pm

Pathfinder regenerate obstaclemap issue
At first the pathfinder works, but when i change to a different level with different walls, the system wont regenerate obstacles map. It worked on previous versions of construct2

Attach a Capx
http://www.se32.com/html5games/td/bug.capx

Description of Capx
Isolated code of monsters path of my game.

Steps to Reproduce Bug
  • Start on level 1, press M to see the collisions.
  • Then press 2 to change to level 2 and you will see the mobs wont follow the right path and will still follow the previous layout collision

Observed Result
Collisions are fine, but objects wont regenerate the path

Expected Result
It should regenerate the path

Affected Browsers
  • Chrome: (YES)
  • FireFox: (YES)
  • Internet Explorer: (YES)

Operating System and Service Pack
Windows 10

Construct 2 Version ID
212.2
B
33
S
6
G
4
Posts: 44
Reputation: 5,066

Post » Wed Sep 09, 2015 2:05 pm

Closing as not a bug. From the manual with emphasis added:

Regenerate obstacle map
Determine whether each cell in the obstacles grid is an obstacle again. This is a very CPU intensive action and should not be used regularly. If only part of the obstacle map has changed, prefer to use one of the Regenerate region actions. Any changes made by using Add obstacle, Clear obstacles, Add path cost and Clear cost will take effect the next tick after this action. Note this means if you attempt to find a path immediately after this action, the obstacle map won't have been updated yet; add a 'Wait' action with a short delay to make sure the updated map is used in that case.


Your project regenerates the obstacle map and finds a path in the same event without waiting for the update.

The Pathfinding behavior has worked like this as long as I can remember and we haven't changed the behavior at all for some time now, I doubt it used to work.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Wed Sep 09, 2015 10:10 pm

Issue is, if i copy the object with the behaviour between scenes, it works. Its a matter of that. Even if i create the object on the fly, i gotta have it hidden in the scene to make it work changing scenes.
B
33
S
6
G
4
Posts: 44
Reputation: 5,066


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests