Pernament navmesh cuts, which correctly removes triangles

Yesterday I hit an issue, that if I want to prevent some areas to be excluded from navmesh I have 2 options:

  1. colliders, which I personally think is a bad idea to create artifitial colliders just to add some obstacles to the logic, also they can produce artifitial and unvanted areas on roofs, on top of the boxes, inside etc.

  2. navmesh cut, which works, but somehow as an addon to the navmesh, they for example can cut area into 2 parts and they still have same ID, as it is one area, just with obscured parts. Also it then can create small separated areas which could be otherwise killed for being too small (below minimal area size). Big issue I had, is when I call GetNearest node inside navmesh cut it will return hidden node by navmeshcut, instead of null. So In my case, units think that target is on navmesh, and tries to reach it, even though it is in navmesh cut. Also they are meant for dynamic objects.

So what I am missing is to mark box, or other shapes, you currently have to just remove parts from the navmesh, when navmesh is updated in the surrounding. So it correctly remove triangles (not just hide them) And to return correctly GetNearest null if there is no navmesh.

Hi

Navmesh cuts do remove nodes and should split the graph into separate areas. If you query in the middle of a navmesh cut it shouldn’t be able to return any nodes inside it, because there are none. Are you sure it did?

Hi,

I am very sure, yesterday I spent a lot of time finding it out. Here in picture below you see the violet box (navmeshcut) you see a small single triangle in the left down corner which happened as leftover of navmesh before cut. That triangle have same area index as surrounding blue space. Second image is with navmesh cut turned off.

If I used this function:

var targetNode = AstarPath.active.GetNearest(targetPos, NNland).node;

and targetPos was position around the guy chopping wood, it returned something with

targetNode.Area

same as any point in the area outside the building.
So I asked AI and it confirmed my theory, and it make sense that it does not physically remove the nodes in the navmesh cut, just makes area inaccessible. So path will not go through this area, just these functions then do not work with as I wanted to know if fallen log inside that space is accessible and returned true. (well I do very fast test to just check if it is in the same area as the worker, I could do complex path search, but I do it too often to be usable)

A* [5.4.6]