Im trying to use a radius modifier on a grid graph in a tower defense style game.
The results im getting are not so good.(path is crossing unwalkable nodes)
Is this a good practice to use this modifier on a grid graph?
And if not how can i handle the width of a seeker in a grid graph?
The radius modifier is primarily intended for navmesh based graphs.
Usually I recommend just using multiple graphs and use a graphMask (search this forum for sample code and explanations).
If you are really memory constrained you can take a look at http://arongranberg.com/astar/docs/class_pathfinding_1_1_grid_graph.php#af156f09628f08d32091ea67e48e42b71, but that has some drawbacks when there is no possible path to be found.
Essentially what you would do is create two graphs, the first one would have index 0, and the second one would have index 1. The Seeker.StartPath method has an optional parameter called ‘graphMask’. It indicates which graphs that the pathfinder should search on to find the start and end nodes of the path.
There is currently no plan to adjust the radius modifier to work better with the grid graph. You can try adding a Raycast Simplifier component to the object as well as the radius modifier, that will likely make it look better.
thank you for the answer. there is some thing that i still miss here.
How search in a different graphs will solve the radius issue?
Are both of them grid graphs, and the change is in the ray thickness?
Or one is grid and the other is mesh?
Also if i understand correctly this means that i need a graph for each unit width i have,if this is true i would recommend to improve this feature as this is for my opinion a pretty basic RTS behavior.