How to control the boundary distance to the water area when generating Nav Mesh

Background

  • Recast Nav Mesh Generator will keep a margin distance to the boundary when generating a nav mesh

[Image Removed]

Target

  • Our level designers want to have a detailed control to this distance. Currently we can only control this by changing the agent radius.
  • For example, for water area, they can set a different margin value. Because they want our AI agents can keep a specific and constant distance to the water area, which is independent to the slope of the landscape.

[Image Removed]

<br>

What They Tried

  • They have tried moving the Nav Mesh Bounds Volume upwards so that the Nav Mesh can be generated at a certain distance from the water surface.
  • However, this distance is not constant because the slope of the Landscape is not exactly the same.

[Image Removed]

They also tried keeping a specific distance at the AI ​​behavior level, but this caused the agent to exhibit jagged behavior, where the AI ​​would first follow the edge of the NavMesh, then find itself too close to the edge of the water, then start moving further away, then get closer to the edge of the water again.

[Image Removed]

<br>

Our Questions:

  • We want to know the cost if we want to modify the engine to support ‘let the LD can control the nav mesh generation margin to the water area’. If the cost is too high, we may want to change our target.
  • Or, can we do this without modify the engine? ( based on my knowledge this is impossible)

It’s definitely not an easy change to take control over the navmesh erosion process, but something simpler you could try

You could probably generate an oversized convex volume from the water bodies you could use as a nav modifier volume.

Jeremy is correct that there is not a simple way to modify this process. Using a volume to represent the water and apply a nav modifier to it to cut the navmesh with the navmesh stopping an agent radius away. I do not know if you are using the Water plugin in the engine, but I believe you can add an area to the water body to do something similar to this.

-James

Hi Jeremy

Really thanks for your reply. And yes, we are also thinking about the way you mentioned, which is building some nav mesh modifier volumes to achieve this.

All we want is just make sure modification of the nav mesh build system is not an easy way, which is conformed by your answer.