Possible to implement destructible cubical planet?

Hi everyone!

I’m considering buying a license for the A* project because Unitys NavMesh kind of let me down on this one.
Could someone experienced with the A* project give an estimate if my problem is solvable with the project.
Here’s what I’m planning to do: I have a cube consisting of multiple sub-cubes that form something like a planet. Little denizen (the purple sphere in the image) can walk across this “planet” and can destroy those sub-cubes. Denizens can walk on any surface, will not fall down and are supposed to be able to walk around any edge.

Unity AI NavMesh

Works okay if I create 1 navmesh per surface and connect them all with NavMeshLinks. But now the trouble started: generating those links for each edge, especially with the removal of sub-cubes during the game becomes very complicated.

And even with the links in place, the orthogonal aligned NavMeshes don’t really allow for nice movement across the edges as Unity AI seems to choose very specific points on those links for passing instead of just navigating the denizen anywhere across an edge.
Even worse: Updating the nav mesh even with 27 sub-cubes already creates frame drops. Having 125 or 343 sub-cubes forces multi-second delays.

Questions about A* Project

I found this video about planetary nav meshes Spherical Graph - YouTube and a few entries in this forum about planets and cubes but that didn’t looked to promising. Of course navigating around the edges seems to be an issue.

The other thing is Navmesh Cutting - it’s listed in the features of A* Project but not fully? I’m not even 100% sure I’d need but my first instinct to update my nav mesh performantly would be cut out any cube that was destroy and add the newly exposed sub-cubes to the nav mesh, but maybe you have a better suggestion on how to approach this.

Question would not how to specifically implement this but if you’d thing A* project is the right tool for job or maybe even some pointers on which features to use or an example project that could give me some insights.


Thanks for reading!

Hi

That will be a bit tricky. It is possible if you generate the outer surface and pass that to a navmesh graph, but generally it works better if the edges are a bit more smooth (in particular for the movement scripts, not so much for the pathfinding). See also Spherical Worlds - A* Pathfinding Project

1 Like