Streaming graphs in a multi scene setup

Continuing the discussion from Strategy for open world additive scenes?:

Hello @aron_granberg , i was looking in the forum for a way to handle loading and unloading of saved graphs as i load scenes additively in and out, and i saw your answer (above). The 2. where you talk about navmesh grids sounds like a reasonable way of doing this but can you elaborate on that please ? How can i generate those grids ? Lets take for example a setup with 16 scenes (4X4) containing a 512 terrain each, when the player moves i load 9 scenes total around him, the central one and 8 around, so the 9 tiles represent 1 navmesh, is that your point ?
I also wanted to know, since this answer is a bit old, is there any new workflow for this kind of use cases, or is this still the way to go ?
Another question, when i load a saved graph, do i need to save it back if i modify it in game by cutting or whatever ?
Thank you

Hi

Is it possible for you to load ALL chunks into the editor and generate a single graph that covers the whole world? This is by far the simplest solution. Navmeshes don’t use that much RAM, so having them loaded all the time isn’t such a big deal.

If not, you could do what you want using the NavmeshPrefab component. NavmeshPrefab - A* Pathfinding Project

Hello, Aron
Thanks for the response and the great asset :slight_smile:

I am taking another approach and down scoping my project a bit in the process. I can get away with smaller levels that i load not additively. So is the NavmeshPrefab still a good optimization for this ?
Lets take an example where i have 2 levels, each in a seperate scene. Then i have a bootstrap scene where i put an emplty RecastGraph and never unload this scene. So now when i load my first level, the navPrefab will get loaded into that RecastGraph as the docs say. But when i load the second level and unload the first one. Does the system handle automatically unloading the first NavmeshPrefab data from the recastGraph when the first level scene unloads or is it something i should handle my self ?

Hi

In that case, you can just load the whole graph. That will be a bit more efficient.
See Saving and Loading Graphs - A* Pathfinding Project

Using a NavmeshPrefab will work too, I suppose. It can unload tiles when it is destroyed.

Oh i see, i could have a recastGraph in each level, no need to bother with prefabs, and just cache each graph for each scene.
Thank you very much