Hello,
I would like to know how expensive, in terms of CPU usage and generation time, it is to add a second navmesh (for larger AI agents).
We are using a dynamic navmesh generated around invokers, with DoFullyAsyncNavDataGathering enabled (so generation jobs are also limited to one at a time).
Is a second navmesh as expensive as the first one, or are some calculations shared between both navmeshes?
Best regards,
Wiktor
[Attachment Removed]
It does not necessarily double. The NavOctree is shared for the navmeshes as it is owned by the navigation system rather than an individual navmesh. There will be memory overhead for the second navmeshes tiles. CPU perf sees some impact as the voxelization and tile building are done for each agent as they have different properties. You can also use the FNavRegenTimeSliceManager to dynamically adjust the time for navmesh building each frame. The manager is owned by the navigation system so it would limit ALL navmeshes being built each frame. The good news for its time budgets is that they can be dynamically controlled at runtime to allow for longer navmesh builds when acceptable but strictly limit the time when other more important things are happening. In FNBR, we change the budget based on game state and even fully disable it when no navigation agents are remaining in the match.
You can have multiple navmeshes running and in fact the last time I checked Lego FN has 4 different navmeshes for varying agent sizes. With some of the invoker changes, you can also limit an invoker to only building navmesh for a specific agent so you do not waste resources building tiles for an agent that could not ever be in that area (at least at that moment). You can also assign invokers priority for whose tiles get built first.
-James
[Attachment Removed]