Hi,
we are currently working on a city-building game and want to add roads that the players can build to reduce travel cost.
I figured the best way to do roads is to cut the navmesh where roads are placed, keeping the inner polygons (isDual-flag) and assigning them a negative penalty or different area (we already cut the navmesh when buildings are placed so this would most likely only fill the area between the buildings an not introduce a whole lot of new geometry).
Assigning a penalty value or tags to those nodes works, but I couldn’t find a way to do this without rebuilding the navmesh/rescanning the graph. Assigning a new area (using RecastMeshObj) didn’t work at all. It just raised the navmesh to be on top of the used collider and the additional cuts were gone, applying the new area to a huge triangle. I couldn’t reproduce the behavior from the tutorial video where new seams were introduced around the object.
So I have three questions, basically:
- is it possible to assign a penalty without rebuilding the navmesh/rescanning the graph and if so, how?
- how to do the same thing with areas?
- if there is currently no good way to do this: would it be possible to get such a feature?
Oh and a fourth tangentially related question: how does cutting the navmesh a lot impede performance on further cuts and pathfinding? And I assume using tiles would improve cutting performance? We are not at a stage yet where we could run performance tests or experience any problems.
Thanks!
PS: we are currently using version 4.2.17