Tags/Penalties with Recast Graph

Docs here: https://arongranberg.com/astar/documentation/4_2_15_671e80cf/navmeshcutting.html

It says: “If you need to use tags, the only stable way to keep them is to apply all the graph updates that set them every time a navmesh cut update has been done. This is of course relatively slow, but it will at least work.”

It seems like the idea is to use a NavMeshCut with IsDual as true. Then apply a tag to that area afterwards via a GUO. As we know, when the nav mesh is modified it sets it back to BasicGround tag. So the fix is to reapply the tag/penalty GUO. My issue with this is that there is no known context as to what other objects that had a NavMeshCut/Tag combo that a nav mesh modification affected. If I have a series of wall objects, its NavMeshCut can and does wipe out the tags of its adjacent walls. Is it implied that I must send up new GUOs for every tag/penalty area in the world that I want in the scene? I hope not as that would imply a small nav mesh change could trigger updates across many tiles of the navmesh.

Unity’s built in navmesh with the components of NavMeshModifier/NavMeshModifierVolume appear to handle this such that they remain in the world. Thus in my example scenario it would recalculate only those affected in that portion of the nav mesh. However it appears that GraphUpdateScene just sends off a GUO and isn’t taken into account for anymore after that.

Hi

The UsedForCut method on the NavmeshCut component is called whenever that particular cut is used to update the graph. You can subclass the NavmeshCut and override that method to listen to this event.

However, in general I do not recommend using penalties and tags with recast graphs. Grid graphs are usually a lot better for that since they are more uniform.