Additive Level Loading

For our game, we are loading in various levels through additiveAsync. Each level is a 400x400 square, and needs to be pathable by the enemies. The amount of levels loaded at one time is flexible. Currently we are using a NavMeshGraph and a point graph (Jump points) for each level. When a player walks into a region, it sets the sourcemesh of the appropriate slot on the AstarPath object, and the same for the jump points. We have 2 NavMeshGraphs and 1 point graph active at a time.

Does this sound reasonable? It isn’t functioning as well as we hoped - the enemies for instance, do not seem to cross from one navmesh to another, but rather stay on the navmesh they were spawned on. In addition, it does not seem as though we can add navgraphs to the list, so we have to set them up with dummy information, and then put new data in the slot as needed, instead of just adding/removing graphs.

I feel like there must be a better approach, but we haven’t figured it out yet… any help/advice is appreciated, especially from Aron himself. :slight_smile:

Well there was a function we missed, Adding/Removing Navgraphs is possible… But this still doesn’t seem like the best option…

I have a similar problem with additive loading. See my post “Get path across 2 different Recast Graphs”. Aron suggests trying out a TileHandler. I haven’t had any time to experiment with it yet because of Unity5 release integration.

How were you able to populate data into a navmesh slot? Do you just create a whole bunch of blank navmeshes, then overwrite the nodes with real data at runtime? Would you mind sharing some pseudo code?


So we create an AStarPath object, with a recast graph, then save that graph out as an obj. Then we set a reference to the mesh generated as part of that OBJ, so that when the level loads, it add’s that mesh as the source mesh of the appropriate slot.

Thanks for letting me know about your post, it seems to have some similar things happening there… I will have to look into TileHandlers.

We setup a recast graph with two tiles. The enemy would still not cross between the two tiles…

Additionally, we had to use like rediculous offsets to get them to line up with the meshes (50000, 0, 50000) when the actual tiles are 100x100. We also had to set up tileSize to 200 on the recast graph, even though they are actually 100 units…

Still looking for a solution to get an enemy to cross from one graph to another