What's more common? Erosion or pathfinding with radius?

35 views
Skip to first unread message

Victor Stone

unread,
Jun 22, 2023, 7:30:06 PM6/22/23
to recastnavigation
In the game industry what is more common, to expand the size of all obstacles in the navmesh or to do pathfinding with an agent's radius in mind?

I guess this probably depends on how many different sized agents you might have? And also if they're circular or not?

I get the impression that it's more common to expand the navmesh because I think the pathfinding algorithms for agents with a radius are quite a bit more computationally expensive than those with point-like agents.

Graham Pentheny

unread,
Jun 22, 2023, 9:50:37 PM6/22/23
to recastnavigation
In my experience, it's more common to have navmeshes that take into account agent radius than account for agent radius in path planning.  The main reason is that treating agents as a single point greatly simplifies (and therefore speeds up) path queries as you suggest.  Even with non-circular agents, it's often sufficient to use a circular or cylindrical approximation of the agent's shape for the purposes of pathfinding or navmesh generation. 

To handle varying-sized  agents, you can quantize the range of radii to a small set of sizes for which you can build separate navmeshes.  An agent then just uses the navmesh that most closely matches its radius.  It's more data to bake and load for a level, but the lookups are usually still faster than incorporating agent radius into pathing or doing full movement planning for every agent. 

All that being said, every game is different and it may be advantageous to take one approach over another for a number of reasons.
Reply all
Reply to author
Forward
0 new messages