General usage questions

Hi!

So I have some questions about how best to configure a recast nav mesh (not using the beta package at this time). My constraints are fairly simple (or at least seem like they should be well-solved use cases):

1: I have relatively large, procedurally generated levels:

2: I have doors that open/close (sometimes in relatively narrow hallways):

3: I have “hazards” that players/enemies can walk or be shoved into:

These all seem like very common cases to build a nav mesh around, but as you can see the output is SUPER messy and leads to terrible behavior in play.

My understanding is that there are three main ways of building the nav mesh:

  • Static collider-based cutouts (which I’m quite happy with! The overall level mesh is quite clean)
  • Nav mesh cuts (Which delete sections of it dynamically
  • Nav mesh mods (which set existing nav mesh triangles that match a region to have specific walkability/tag values)

From what I can tell, for more “static” options (such as hazards) Nav Mesh Mods should be better - I’d like to mark that section of the map as a “hazard” and then allow agents to reason about what that tag means, rather than use a brute-force cut (which also seems like a less-performant option).

First off: Is the above correct?

Secondly: If the above is a correct understanding of how to use the nav mesh features, what can I do to have cleaner/more accurate results?

  • One problem that seems to cripple the usefulness of nav mesh mods is that there doesn’t seem to be a way to ensure the nav mesh triangles will line up with the zones in question? Is there a workaround to this?
  • Additionally, the triangulation logic seems… (please no offense) not ideal. The algorithm quite regularly spits out thin, needle-like sections of the nav mesh, which contort the results. This both can cause non-optimal navigation cases, as well as distorting the above problem (since a tagged triangle might jut out of a zone weirdly (or make a “safe” triangle jut in). This also seems quite easily solvable? For example, when subdividing triangles/quads you can choose the option that results in the minimum delta between “shortest length” and “longest length” of a triangle, which should at least fix the vast majority of these cases (unless the needles are caused by a different kind of problem :sweat_smile:)
  • The above problem impacts the usefulness of the “min region size” value, since lowering it does not result in smaller region key squares, but increasingly narrow “needles” around a central triangulated quad (which seems like it does not actually enforce the min region size) (see below for example image*)
  • Finally, it doesn’t seem possible to use nav mesh cuts to “tag” sections instead of forcing a cutout? That makes modeling things like moving fire hazards much more difficult (or at least requires to committing to modelling them as “this zone is NOT walkable”)

Am I not understanding the ideal configuration of stuff here? Also super sorry if this comes across as nitpicky, generally the tool has been super great - I just am wondering how to make my game’s use of it “production-ready”

*small region size issue: