What is the lightest way to use NavMesh in an open world environment?

Hey guys, we’re working with a large map that represents a small city. We will have a truck that is automated to go from point A to B, navigating through the city blocks so that it only moves on the roads. The problem is all of the buildings have auto-generated collision boxes, and they’re a mess. I figured it may be easier (considering this bug is rampant) to delete all collision boxes, and simply use the Nav Modifier Volume to block out the buildings.
Would this be heavier on the build or should I stick to re-editing all collision boxes?

1 Like

Hello,

I highly recommend using Navigation Invokers in this situation. Nav Invokers are components that you can add to a blueprint which will only generate Nav Mesh in the desired radius around the pawn. This saves a ton of performance and allows for some nice customization as far as the radius it is generated in, as well as how far away the pawn must be before the unnecessary Nav Mesh is removed.

Here’s a quick run down of how to get this set up:

First thing’s first, we’re going to want to enable a few settings in the Project Settings. Go to Edit->Project Settings->Navigation System and enable the Generate Navigation Only Around Navigation Invokers setting. Then, go into Project Settings->Navigation Mesh and set the Runtime Generation to Dynamic.

Then, we’ll need to place a Nav Mesh Bounds Volume in the level. Ensure that it covers the entire space that you’d like the Nav Mesh to be able to generate in, as this is required for the Invoker to be able to generate its section of Nav Mesh.

After you’ve done this, go into your character/pawn blueprint and add a Navigation Invoker component. Here, you can alter the Tile Generation Radius, which will control how big of an area around the Pawn the Nav Mesh is generated. You can also alter the Tile Removal Radius, which will determine how far away the pawn must get before the Nav Mesh begins to remove itself to keep performance at a decent level.

Let me know if you have any further questions regarding Nav Invokers.

Have a great day

1 Like

Thanks Sean I’ll give this a shot. I am still going to use the NavModifiers that I threw down in place of collision correct?

If you use the Nav Modifiers, it should still ignore that area when considering where to generate the Nav Mesh. Let me know if it does not.

When the AI is not in the navigation area, it does not move in place, causing the FPS to drop seriously, and the FPS is restored after the navigation is resumed.