Pathfinding stops before his last node

Get help using Construct 2

Post » Wed Apr 23, 2014 11:01 pm

Hey guys ! The pathfinding behavior is driving me nuts :D

I have a grid of 16*16 and i would like to have a 16*16 sprite with the pathfinding behavior to get right into the grid when it moves to his last node.

I've tried a LOT of things but it seems that everytime the pathfinding stops randomly before it attains the last node.

Imagine a chess game where each piece needs to be put precisely in the middle of the grid.


Am i doing something wrong ? I couldn't make this work in the pathfinding demo either.. Or is it the way the pathfinding in C2 is coded ?

Cheers ! :)
B
5
S
1
Posts: 4
Reputation: 733

Post » Thu Apr 24, 2014 7:19 am

I came across this myself. I solved it by recalculating the path when it stops. It looks like there is only a limited number of nodes that it can keep track off.
Cyberphaze

What we build can never be destroyed
B
136
S
18
G
6
Posts: 37
Reputation: 14,784

Post » Thu Apr 24, 2014 1:16 pm

Ah thanks man ! I will try something like that, but i have to admit it's most annoying :)

Apparentely it's not the number of nodes ( i store waypoints in an array and can have a lot of nodes for a sprite ) Those nodes in the middle are working perfectly it's just at the last one that the sprite doesn't want to get on, it's weird :)
B
5
S
1
Posts: 4
Reputation: 733

Post » Thu Apr 24, 2014 1:57 pm

Yeah that is what I meant by nodes sorry. In my case it wasn't the last one but it did only like 3 quarters of the path.
Cyberphaze

What we build can never be destroyed
B
136
S
18
G
6
Posts: 37
Reputation: 14,784

Post » Thu Apr 24, 2014 9:08 pm

Well no luck on working out a solution, that sucks :(

The sprite is making circles around the position i'd like to put it in :) Thanks for the help dude
B
5
S
1
Posts: 4
Reputation: 733

Post » Thu Apr 24, 2014 10:23 pm

Have you considered to reduce the size of the grid. Maybe that is why it is going in circles.
Cyberphaze

What we build can never be destroyed
B
136
S
18
G
6
Posts: 37
Reputation: 14,784


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests