How to filter out unimportant Navmesh areas?

We are using 4.7.5 with a C++ project (not full source code).

Please look at this MSPaint mockup of our issue, as I can’t share any screenshots.

We have a scenario for all the maps in our game where we need to keep the dark navmesh area but get rid of all the rest. We get navmesh data inside blocking volumes, which is a problem as we’re not using collision in our game. We’re querying the navmesh to make sure the AI can go/be there.

Setting Min Region Size to a good value eliminates the small islands on the Static Actors, but does not solve the regions outside the blocking volumes or inside them.

We have tried using the Nav Modifier Volumes. It seems both the Navmesh Importance Volume and the Nav Modifier Volumes have a problem, where we try to create non-cube shapes using extrusion, where the generation still behaves like a bounding box.

If we convert the blocking volumes in the picture above, the generation still behaves as if we’re having a rectangular box enclosing it.

We’re thinking of maybe accessing the generated navmesh data and delete all islands except the biggest one post-generation, but we don’t know if that will create any new issues.

Any thoughts on this?

There’s a number of things you could try out:

  • Use more NavMeshBoundsVolumes to narrow down where navmesh is expected to generate
  • Use NavModifierVolumes (I know, you mentioned issues - more on that below)
  • Implement custom navmesh modifier by deriving INavRelevantInterface
  • Fallback: hand-craft the level geometry so that there’s not collision where AI is not supposed to go (I know, tedious).

So the thing to remember while using navigation-related volumes that Recast only supports convex shapes in this regard, and those shapes need to be up to 8 points. Ideally we’d accept any volume and divide it into convexes under the hood, but it’s not there yet.

Let me know if it helps.

Cheers,

–mieszko

We will do another pass on this problem considering the convex shape rule. Thank you MieszkoZ for the answer.

We decided to custom build the ground geometry using a “floor volume”. This one supports the concave shapes we need together with the recast. We will then use the MinRegionSize to filter out the small islands.

Thanks again MieszkoZ. :slight_smile:

I’m a few months late here, but we are having exactly the same issue for our game. I’m about to have our environment artist ring all our environments with navmodifier boxes to filter the unwanted areas out.

But you know would be the most ideal? Would be to allow us to mark specific navmesh manifolds as being the ones to keep, and then have the system throw away the rest.

I’m sure this would be possible with some digging around the guts of the engine / recast. Not sure I have the time though!