Support Forum

Latest progress with Spherical planets and NavMesh

To recap, I am using marching cubes to create a spherical world, and AIAlignWithSurface to attach to the graph after scan. I’ve already found:

  • Do not instantiate AI’s directly on the surface, they will fall through / off the planet.
  • Funnel modifier has to be on Medium, LineCast is used on High quality Funnel and errors on mountainous spherical navmeshes
  • No navmesh cutting.

So how am I going to actually get some of the planet features into the pathfinding? My AI’s are going directly through trees and rocks, and right into the ponds where they get stuck for some reason (downhill into the pond, uphill too steep? Who knows).

I have two ideas. One is to attach an RVO controller to all planet features and let the RVO simulator attempt to handle it. I would like to get a sense of this being performant or not if I have roughly 500 objects per planet that the agents should not be able to pass through.

Next, during proc gen, I create a second planet that has the triangles from the instantiation positions of these objects and areas that should be impassable removed. This would hopefully leave holes in the navmesh and A* would simply do its thing. Perhaps combined with RVO’s on objects that are larger than a triangle on the mesh (Large objects, etc.) this can be used. Advantage here is that different units can use different graphs (I could have a graph that is water creatures only by doing the reverse of above, or air units that stay the same height as they pass from land to water, even though the ground mesh is dipping down).

Or, am I completely missing a feature of A* to do this properly?

Hi

Sorry for the late answer.

Since navmesh cutting is not supported, you will need to modify the mesh that you pass to the navmesh graph in some other way. If the world is static, you can do this in some 3D modelling program like blender. If it is dynamic, you might need something more complex (like what you describe).
Using locked RVO agents can work for circular obstacles, though I would recommend not relying on this for anything other than simple circular obstacles. Don’t try to build longer walls from them for example.

The RVO system is pretty performant in the beta. It can handle many thousands of agents without significant problems.

No apologies necessary, you are literally the most responsive dev on the entire asset store.

I hear you on all points, will experiment with the RVO sim and report back.
FYI, there won’t be an update on this for at least a month - I’m switching my marching cubes over to JOBS/Burst right now, so that I can generate ALL the different graphs for different types of agents. As you are aware this is a hard mental shift.

1 Like