I plan on making a game where rooms are randomly joined together. I saw that it’s not possible to prebake navmeshes onto a prefab at the moment. Is it possible to bake a navmesh at runtime after the objects in the scene are placed?
Alternatively, is it possible to programmatically create a navmesh out of data myself?
I know it’s possible to use a custom written navmesh, but I’d rather not go that route if possible to save on work.
Ideally, I’d like to have a per object navmesh, and create links between the navmeshes when the objects are spawned when the level is generated.
The current implementation of Lightprobes and Navmesh don’t support dynamic level out of the box. They could with minimal changed from Unity but I haven’t seen any indication that they might update those two features in the near term.
With regards to NavMesh, although you can bake a NavMesh, there is not way to assign it to an Agent. If we could, it would be easy to bake, save and then assign to the agents as you moved from room to room.
With regards to Lightprobes, although you can bake and assign new probe solutions dynamically, we cannot change their baked position and thus unless you instantiate the rooms where the probes where baked, it won’t work. There are tricks but it isn’t pretty.
For both of these system to be friendlier with dynamic levels, we need the ability to bake at a certain location and then be able to assign the baked solutions and apply an offset to represent where it is now located. As long as all object baked (for each room) remain in a position relative to each other, where in the world they all end up being instantiated should not matter.
I am pretty sure A* Pathfinding has better support for dynamic levels. I haven’t look at alternative lighting offerings.
I’m a huge fan of deferred shading so I’m not worried about baking the lighting.
I would think that creating a navmesh myself should be possible and then having the agents use that instead of the prebaked navmesh. Is there A* without navmeshes? Like using nodes or something? I could settle for that if it’s possible to do crowd movement with just waypoint nodes.