Hello guys. My current game world is split into chunks - each chunk is an individual scene.
However, the whole world is not loaded at once - many chunks are unloaded at a time.

So let’s say an npc is commanded to walk across the map. How can I calculate a path on a names that is unloaded?

Note I am already designing a system that once the npc walks onto an unloaded chunk, the npc will unloaded, and the game manager will calculate its theoretical position until the chunk the npc is in is loaded again. In other words, I know how to handle movement in an unloaded chunk… Provided I have a path.

I’m thinking some sort of low poly navmesh could work. Even better could be seen sort of road system that the npc will always travel on (when traveling only), but then it would need to switch to exact navmesh whenever the npc has to leave the road.

Any thoughts?

EDIT: It looks like the engine really likes having a single navmesh for multiple scenes - so in theory I’d have a single navmesh for the entire map. Is this realistic? Is the navmesh smart enough to not be incredibly slow with a large navmesh? (since 95% of navigation will be running in close proximity to the player)
-Josh

You could build the navmesh into a separate scene and then only load the “*_navmesh scene”, and load all tiles on start.

Another much simpler solution would be to just keep a map of connections. For each tile save if its connected to the north,west,east,south. Then you can use a very simple A* algorithm to find the tiles you have to cross and then load them.

Or if its an RTS game you can have a “collision map” (which is a 1bit channel texture) that contains all the walls / walkable regions and then use that for rough pathfinding.

The last two solutions won’t easily work when you have multiple height levels. You’d have to (for #2) also save things like “IsConnectedUndergroundSouth” or something…

Same for #3, where you’d have to have multiple collision maps for each height step.

If that doesn’t work for you for some reason, you’ll need to elaborate more on what exactly you’re doing and why that doesn’t work.

I think for a prototyping approach it would be best to just generate one huge navmesh with low resolution, the problem with that is that you’ll likely have some issues with the navmesh not being able to find its way through small corridors (house entrances)

I’m thinking your first idea is the best for my game.

To give a little context, my game is an open world rpg, something like skyrim. So terrain and rocks and mountains and such.

I’m also thinking building a way point system for roads could work - basically by default npcs will travel via the road, then use the navmesh to calculate where to go once the npcs must leave the road. Of course if it’s substantially closer to just go straight there then it would do so. Basically the road system could mean less navmesh loading.