Best approach for huge worlds

Hello !
I have a question because i have streamed world, which is splitted into tiles. One tile is 128x128m, and i have 372 tiles in my game. This is a lot of terrain and i’m thinking what should be best approach to use A* on such a big world. I’m thinking about using Recast and generate one big navmesh for all world, but is it best approach for such a big world ? Plus, not every terrain will be loaded during runtime, only those close to the player. I though about procedural grid but it calculates a lot of not necessary grid-nodes. My game is open-world.
Have u any sugestion what is best approach to use A* with such a big world ?

Best Regards
Szymon

I am in pretty much the exact situation and would also like to know the answer. I’m currently trying to save and load the graphs during runtime as their respective tile is enabled/disabled.

I’ve read on here that recast should be used as a giant graph for the whole area. In my case this isn’t really ideal due to including procedural generation. In theory my plan works and have tested it up until the saving and loading of individual graphs. I can’t seem to get this to work, and from what I’ve been reading, there isn’t actual support for this on individual graphs.

I ended up getting this working by using this post.

I added it to AstarData.cs and had to change
var sr = new Pathfinding.Serialization.AstarSerializer(this, settings);
to
var sr = new Pathfinding.Serialization.AstarSerializer(this, settings, active.gameObject);

I also had to downgrade off of the beta version due to it not allowing me to edit the scripts. But its working now. When my tiles spawn/despawn their graphs go with them.

@aron_granberg can i ask for any advice ?

Hi

@VMG-Szymon

If you can, this is probably the easiest and most robust solution. Loading the whole recast graph in memory will not have a big impact. And you will be able to plan paths through the entire world at any time.

There’s also the ProceduralGridMover component which can be used. Take a look at the example scene called “Moving”. This is suitable if you only need pathfinding in a small region around the player.