Chunked 2d node grid pathfinding


My game world is a big 2D grid of tilemaps that function as “chunks” in a similar way to minecraft. These chunks are loaded and unloaded as the character moves around the world. My chunks are pre-generated prefabs that I could theoretically “pre bake” graphs onto. I will also have a number of NPCs that will be able to move around the world freely, and should not be dependent on the being around the player to be able to move. I plan on solving the latter problem by having a simplified grid that NPCs can move through when players aren’t around. Anyway. My question is, what are some best practices for using APP to tackle a situation like this? Is APP fast enough for me to load and unload chunks in this manor? What’s the best way to ‘stitch’ together different graphs from different chunks? Any thoughts on my “pre baking” idea? Thanks!

Nevermind! Turns out I was able to just slap my your gridmover script in my project and it works! That’s convenient. Thanks!

1 Like