Improving RecastGraph Efficiency in Open Spaces: Seeking Tips

Greetings,

I’ve implemented a RecastGraph on my terrain, which is characterized by a few obstacles but is predominantly open space, completely flat with no slopes, all set at a y-coordinate of 0.

I’ve noticed that RecastGraph performs admirably when navigating around obstacles, but the path quality drops in open areas. I’m unsure if this is a result of my configuration settings. Attempting to improve performance, I experimented with heuristic optimization, which did offer some benefit, though it wasn’t entirely consistent—I’ve only tested it with the “random” setting so far.

In search of alternatives, I switched to a GridGraph, which yielded better results in these open spaces. However, the lack of support for NavMeshCut, which is essential for the dynamic incorporation of buildings, makes this option unsuitable for my needs.

Are there any suggestions or recommendations for optimizing RecastGraph performance in open, obstacle-free areas?

Hi

  1. Try the beta version, it has better path quality on navmesh/recast graphs in general.
  2. You can reduce the tile size, which can increase path quality (try to not go below 64, though, as a rule of thumb, it’s usually not worth it).

Thank you for the quick response. The beta version is sadly out of the picture because I still work in unity 2020.

I found a solution:

So I work with a cell size of 0.3 and a character radius of 0.6 on the Pathfinder, while the agents have one unique radius 0.3. This fits best for my needs which is rts / moba. I also would prefer a funnel like path (unrealistic but shortest past possible), as it is best for moba like games.

A tile size of 64 in my case leads to graph that looks like this:

This graph is more problematic when using funnel or smooth modifier as this will happen more often (I drew another line in photoshop over the path gizmo to make it easier to see). The red sphere is always the target:

Using a tile size of 16 while keeping all settings the same will yield this graph result:

This works better but on funnel and smooth modifiers, there still do happen to be the following cases. We are talking about every 20th path, that this will happen:

Funnel:

Simple Smooth (path gizmo is hard to see):

And the solution was simply using the Raycast Modifier. It works on both the 64 and 16 tile size and yields perfect funnel like results. I shied away from it first, because the documentation says it would only work on grid graphs and point graphs.

Hi

Ah, yeah, that’s an issue for the funnel modifier in the current release.
In the beta, it has been improved as well.

It’s great to know the beta version addresses the funnel modifier issue. Will it also be compatible with older Unity versions? I ask because my project is constrained to an earlier version of Unity. Nevertheless, I believe the Raycast Modifier solution I’ve found will serve my purposes well for now.

The minimum requirement will not be lowered for the beta, I’m afraid.