Question about the Radius Modifier since unable to test on free version

Hey guys!

So I am currently using the free version of this asset and would like to purchase it if it has solutions to these problems I am running into. So when generating the grid for my 2D game I am using Rays and noticed that since Rays are so precise that produce paths that are extremely close to walls. I find that my agents will start ferociously humping walls when attempting to get to it’s destination. I tried switching to spheres to make the grid less precise but because of that it essentially blocked off openings to otherwise accessible areas.

and realized that wasn’t an option anymore. I saw that there was this modifier http://arongranberg.com/astar/docs_dev/class_radius_modifier.php that seems to take into account an agents radius or you can at least specify it. Is that the case? I would like to test it out myself but it doesn’t seem to be a part of the free version of this product. Any input would be fantastic!

Thanks,
Ryan

Hi

The radius modifier would not be a good fit for this. All modifiers only post processes the paths. The radius modifier will post process the path to offset the path from the edge, however it will only work well if there is actually enough clearance (and in any case it works best on navmesh graphs, not on grid graphs).

When you use spheres for collision detection there is a ‘diameter’ field, you can adjust that until you get the desired graph. A diameter of 0 would be essentially the same as using the ‘Ray’ mode so for this case you would want some diameter between 0.0 and 1.0.

So when I tried changing the radius from 1 to something less it was essentially acting like a toggle between ray and sphere. When I switched to .97 for diameter it would look exactly like the ray grid graph and if I switched to .98 it looked exactly like the sphere when set to diameter of 1.

Do I need to write some sort of wall avoidance script myself to make it so agents aren’t hugging walls?

If you’d like some screenshots to better describe what I am experiencing I can quickly get them for you?

Maybe you are looking for the ‘cut corners’ option?

So I went from using my own movement script to using yours and things are looking buttery smooth! Thanks for the fast responses!