That’s odd… I’m not sure what could be happening. Does nothing show even if you enable the ‘Show Surface’ toggle in the graph settings?
Tags and navmesh cuts do however not really work well together. The reason is that as a navmesh cut moves around, it’s pretty much impossible to determine how the tags of the nodes should change as the new node boundaries do not line up with the old ones. If the node stays exactly the same after a navmesh cut update was made then the tag will be kept, but otherwise it will be reset to zero.
It’s just the tag mode, regardless of the surface setting.
I will test now to see if the tags are actually set.
One more question, I noticed the TAG is uint. Does it mean I can assign arbitrary int from entire range? This would be very beneficial for me because I could tag the cuts underneath my buildings with unique int, it will help me with finding the building outline area.
No, tags must be in the range 0…31. It is possible to modify the code to allow arbitrary integers though. Essentially you just have to change the property implementation to use a separate field for the tag instead of using bit-packing. By default it does not do this due to the increased memory usage.
However, I had to delay the GraphupdateScene application by 20s since game startup, I guess it’s due to all the graphs scanning and recalculation. My current code which works is the following:
That’s odd. Once the graph is scanned you really shouldn’t have to wait at all. What happens if you remove the 20 seconds check?
The ForceUpdate + FlushWorkItems call will ensure that the cuts are done immediately, so when FlushWorkItems has run it is guaranteed that all navmesh cuts have been applied.
Yes, you need to modify the source code for AStar to achieve this. The modification is minimal so I don’t see this as a problem, all you need to do is change the access modifier to public for the method in following classes:
NavmeshClipper
NavmeshAdd
NavmeshCut
Also since my original post I noticed I need to delay the Tag update by 1 frame to resolve some strange problems (I modified my original post). Since then, I had no issues with this approach.
Ok thx. Anyway I’m baffled why we have to do all this to just cut a piece of geometry and change it’s tag. It sounds like such an obvious functionality that just adding NavmeshCut with GraphUpdateScene (without any region specified) should automagically do it’s work.
Yeah. When the NavmeshCut class was written, I did not think anticipate that people would want to set weights and tags like that, even though in hindsight I should have thought about it. To do it properly I really should make tag adjustment built in to the NavmeshCut component as that would make the modification much cleaner and faster and more reliable. But as it is right now, this is unfortunately the workaround that has to be done.
Any suggestions how should I resolve this? The cuts+graph update which are there from the start seems to work fine, regardless how close they are, so I have a feeling there is probably some setup I can do that should avoid this situation.
EDIT:
So if I understand this correctly this seems to be caused by the fact, that tiles are reloaded when the cut happens, and nodes are destroyed as a result. They are then recreated, but the walkability and tag information is not propagated unfortunately.