[Path finding] Why doesnt this work?

Get help using Construct 2

Post » Sun Oct 04, 2015 10:34 pm

jsutton wrote:Couldn't u define the obstacles for each sprite?

No that's the problem there are only one obstacle map.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,828

Post » Thu Oct 08, 2015 5:11 pm

Not anything I've messed withthis , but if I understand your problem...defining the other sprite as an obstacle and refreshing around each every x seconds should work...or so I would think. Both sprites much be obstacles respectively. I've been running multiple copies of the same sprite and defining hits on overlap...works fine and kinda the same issue. Just havta be careful not to refresh the whole thing each time or you'll run at negative fps lol
B
11
S
2
Posts: 33
Reputation: 651

Post » Fri Oct 09, 2015 12:28 pm

jsutton wrote:Not anything I've messed withthis , but if I understand your problem...defining the other sprite as an obstacle and refreshing around each every x seconds should work...or so I would think. Both sprites much be obstacles respectively. I've been running multiple copies of the same sprite and defining hits on overlap...works fine and kinda the same issue. Just havta be careful not to refresh the whole thing each time or you'll run at negative fps lol

It shouldn't matter whether you keep refreshing the obstacle map as there are only one. Besides that if you refresh it constantly you will most likely ruin performance.
The problem occurs as each units might need to have different obstacles. Like a ship, plane and car.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,828


Post » Fri Oct 09, 2015 2:57 pm

Lordshiva1948 wrote:nimos100 have you seen this tutorial?

https://www.scirra.com/tutorials/1118/path-finding

Not really sure what that solves, I assume you mean using path finding without obstacle map? but that pretty much ruins the whole purpose of it? Because in that example the path finding is just used to move a unit to the castle and stop when it hits it. But what if there are 5 castle behind each other and you want the guard to go to castle 4, then it will hit castle 1-3 and stop? But how would you make it move around the castle, if there are no obstacle map?

This is not a self created problem and since the OP is really old back when C2 was r182, and I haven't heard or seen any updates that solves this problem and someone not long ago posted the same issue which made this old post appear again :D I assume that the problem still exist.

As stated earlier in this post I made a bug report and Ashley answered the following.
The problem is there is only one global obstacle map used for the pathfinding behavior. Everything pathfinds on the same map. So if you have object A with two obstacle types, and object B with no obstacle types, you have a conflict: should the one global map have those objects as obstacles, or not? In this case it happens to pick the global map where no obstacle types are defined. If you delete the red object there's no conflict any more and it uses the right obstacles.

I'm not sure how to resolve this - having multiple maps becomes memory inefficient and possibly slower, but on the other hand perhaps the obstacle types should be global as well to avoid this situation... the easiest thing to do is to make sure you have the same obstacles added for every object using the pathfinding behavior.


And again unless this have been fixed without me knowing I don't think it have been solved.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,828

Post » Sun Oct 11, 2015 12:05 pm

See bug "[Path finding r182] Ignore collision settings" for a solution
B
2
Posts: 3
Reputation: 156

Previous

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Casimir, pwrtoppl, resdesign and 11 guests