"magnet Nodes" to prefer a road

Hi,

the recast graph seems to be suitable for my Project.
One of the gamer’s job is to place objects at Terrain and
to build some roads during runtime.
Now the Problem… I want the characters to prefer the roads in the game.

Is there already any possibility to make it work?

I haven’t Chosen the Grid Graphs yet, because I want to have a free objectplacement and the recast graph uses also small places between objects. With grid graph… a low node size means much more nodes :confused:

If not, I think it would be a nice Feature to place “magnet Nodes” at runtime to make the character to prefer a path.

Hi

With grid graphs this is relatively easy if you set a high initial penalty (see bottom of graph inspector) and when you add a road you create a GraphUpdateObject which decreases the penalty to 0 (probably by setting a tag) on the road (you need to have an initial penalty and then increase it since the algorithms do not handle negative costs). However with a recast graph it is trickier. I have tried it personally in a game I was making. I could get it to work using a NavmeshCut with the isDual mode enabled and a graph update object, but it didn’t end up working that well since recast graphs do not really have a uniform node size.