• 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!

AI pathfinding in a world with chunks.

K

kakatoto

Guest
Hello,

I am creating a game with a big world. Therefore I use chunks that I ope nat runtime to manage this. I would like to implement AI pathfinding, but as chunk are opened/closed, it changes the path grid. I could refresh the path grid every time a chunk is opened or cled but I was wondering if there were a best methode to implemen this. I could for example use a collision grid per chunk, buyt then the connection between chunks would create problem. Do you have some ideas of ho to achieve this ?
 
N

Nordwin

Guest
How often are chunks opening/closing?? If it is very often looking for a new path all the time can eat up some ressources, but I have no other idea myself.. Usually I use Dijkstra or A* to find a way and store it. If things are changing I either update paths on demand, when the change is happening, or if these changes ar happening too frequently, update each path after a certain time using alarms. This way you wouldn't have to update it every frame or even multiple times on every frame.

Maybe there is a very clever solution, but IMO if the path has changed due to certain circumstances it has to be updated!
 
K

kakatoto

Guest
Depends on how the game is played, but if u walk continuously, a new chunk my be opened like one per 2 second and another 2 may be closed in the same time.
 
Top