Very large destructible mesh as terrain?

I would like to find a way to allow dynamic creation of tunnels inside of terrain. I don’t just mean procedurally generated, but real-time during the game. The goal would be for me to re-create an ant nest.

In the course of my searching for a UE4 solution to this problem, I came across destructible meshes. On the surface, it seems to be viable for what I want. It would allow me to break off one piece at a time (if I set it up through APEX, as I understand, because it looks like partial destructible meshes won’t be fixed until 4.6) and from there I could create de-facto tunnels.

While that sounds nice on paper, I’m wondering if a more experienced developer could tell me if this is actually workable or not. I imagine that it would be introducing an extremely large amount of objects that the engine would have to keep track of, and that could quickly turn into a nightmare from a resource perspective.

Any feedback is appreciated!

Hi Zecknaal,

While this is definitely possible, you will absolutely run the risk of performance concerns with a large destructible mesh. The main thing I can recommend here is to make sure that, if you decide to create a large destructible mesh, you carefully set the parameters the mesh will work in so that additional pieces are removed quickly so that your performance doesn’t drop too much. This will have to be a destructible static mesh as it is impossible to alter actual landscape meshes at runtime, but doing so the way you describe could have very interesting results!

Hey Zecknaal,

I just wanted to add to this, maybe even contradict a little bit as well. :slight_smile:

With Landscapes you cannot do any deformation like tunnels and such without digging in and altering the code. It’s fully possible as someone did it with UE3 even though it wasn’t a feature of the engine. :slight_smile:

I Wouldn’t recommend a very large DM for something like a landscape or anything significant in size just for sheer performance reasons and the number of pieces you’d need to make it look good. The reason being is that DMs are not handled on the GPU but rather the CPU to make sure that PhysX is cross-platform for both Nvidia and Radeon card.

Off the top of my head the way I would look into going about destruction with your landscape would be to have your Landscape setup. Use the Hole mask method found in our documentation. Create a static mesh to cover the masked area that is never going to be destroyed. Then have your DM in the place where you want to have the destruction for the cave digging.

Keeping DMs a reasonable size can help keep performance up especially if it’s a very complex fracture mesh.

I’d also encourage you to check out Developer.Nvidia.Com for their tutorials on Destruction Meshes if you’ve not seen them. They can help get you tips for creating some cool effects and nice destruction!

Feel free to ask any questions if you need help. :slight_smile:

Thank you both for your responses!

I did not realize that fractures were kept track of on the CPU level, I could see where that might cause me some issues.

I suppose the obvious answer is that I might just want to look at rolling up my sleeves and getting it done myself. That is the whole point of an open-source editor! I know it can be done, as shown in this post by the makers of Cubiquity.

If I end up getting anywhere with this, I’ll do a followup down the road.