• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Grid based pathfinding- Ai gets stuck at corners

B

Bdizzle

Guest
Hello GM-Community,
In my game I use grid based pathfinding for my enemy ai. In theory everthing works fine but if the path goes around corners or is very near to my wall instances, the ai can get stuck or cannot even follow the path anymore at all.

Solved: Changed the grid size to 16 by 16. Now it seems to work just fine.

 
Last edited by a moderator:
T

The Shatner

Guest
I am no expert at using mp_grid things, but have you checked if the related objects were flagged as "solid"? Did you tell the object which parts of the grid are "forbidden"? Maybe you haven't told the object that he shouldn't be taking that path and he tries to do so, but locks up when colliding with the solid objects.
To check further details, you could modify the collision mask and reduce its bounding box to one pixel, and see if there's any difference (and where that difference is).
Tell us what happened after you checked these things. If it doesn't work, tell us more about the whole mp_grid thing you are using. Maybe the experts need some more detail to help you out.
 
Top