Pathfinding across height levels in top down

Get help using Construct 2

Post » Mon Mar 13, 2017 3:30 pm

Hi everyone,
I'm wondering if anyone is aware of a way to fake height differences for a top down game? The catch is that the pathfinding behavior needs to be able to navigate it.

So far I've been toying around with assigning a height variable to sprites and if my player would hold the same value in an internal variable the sprite would be permissive else it would be set to solid. Worked ok for only the player.
Now if I applied it to enemies the pathfinding would need to be able to predict what sprites make you transit from one level to anothe, what order is required and all of that.

Is anyone aware of good concepts for this topic?
B
15
S
6
Posts: 232
Reputation: 1,931

Post » Tue Mar 14, 2017 12:31 am

Unfortunately Construct 2 is only capable of supporting one obstacle map at a time for its pathfinding behavior, so I don't think it'll work in the way you intend it. Barring that maybe you can also do something by adding/removing path cost to certain obstacles, but I'm not sure if that'll make any difference in the long run.
B
52
S
24
G
18
Posts: 295
Reputation: 13,090

Post » Tue Mar 14, 2017 7:47 am

@Sup with that? Thanks for your reply.
So I'd set all sprites of the current enemy's height level to low cost and all others to high, right? An idea if that would be applicable per enemy instance, each having their own cost situation? Guessing thats probably all in the obstacle map too and hence not instanciatable either, no?

Just thinking out loud, all it would take is a gap in walkable cells between two sprites of different height. A staircase sprite could bridge that gap. Is there a way to edit or manipulate the walkalble cells other than through solid objects?
B
15
S
6
Posts: 232
Reputation: 1,931

Post » Tue Mar 14, 2017 9:54 am

That's the idea, but since it's still all tied to one and the same obstacle map I don't think the path cost thing would help either.

You can set the Pathfinding obstacles to Custom in its parameters and then add obstacle types through events instead of setting it to Solids.
B
52
S
24
G
18
Posts: 295
Reputation: 13,090


Return to How do I....?

Who is online

Users browsing this forum: AkbarAsgharMG, vargazso, Yahoo [Bot] and 25 guests