I have a question about navmesh. In a game I’m creating, I have a large open-world level. Ideally, I would set up a static navmesh and bake it. However, I need to dynamically add buildings to my world, which should affect the navmesh to ensure NPCs can navigate correctly within those buildings.
As a result, I’ve chosen to use a dynamic navmesh with nav invokers. However, this approach is quite costly in terms of performance. I’m wondering if it’s possible to bake a static navmesh for the entire map to allow NPCs to traverse it correctly, and then, when I add a new building to my level, have a new navmesh generated specifically where the building is located. Is there any way to combine dynamic and static navmeshes?
Have any of you faced similar problems and found a good solution?
That’s exactly how dynamic navmesh works on world-partition worlds. In regular maps i’m not so sure, but likely should also be the same
However, this approach is quite costly in terms of performance
Anyway, while it will cost some performance on change, it should not be “quite costly”. In terms that you may have a spike for a 1 frame, but it shouldn’t affect performace all the time.
And if you really have performance drop all the time due to this, it’s likely means that you actually regenerating navmesh every frame. Turn on navmesh display, unpossess your pawn in editor (iirc F8 by default), then look for a red patches: somewhere there are a Movable actors that have a collision with CanEverAffectNavigation=true. When you found such objects - either make them static or CanEverAffectNavigation=false