Creating Destructible Trees

Hello fellow UE developers,

I’m currently trying to make a speedtree tree destructable, but after 2 days of trying I nearly gave oup on this and want to see if someone here got some experience with it. What I use is 3ds max and physxLab. I can set it all up nicely in physxlab, well kinda. I seperated the tree into trunk, branches and leaves. First Problem I encountered is that the leaves have collison and I cant seem to get it turned off just for them. Also what I tried but did not work is that if you approach the tree hit it at the bottom trunk, it starts to crumble, if its too weak the whole tree will start falling, when the tree hits the ground the leaves will vanish with a particle effect and you can start chucking up the tree in pieces.

But what I got so far is that if I hit the tree at the bottom, it either explodes in all the pieces or the leaves roll as a ball away, or the tree is not falling at all and if it start from the middle. Also the parts are “hole” inside, it doesnt cap the mesh where it cuts it.

I’m guessing that its not doable with the physxlab but wanted to ask here first before I try a more static way of doing this.

Thanks for help and sorry if I wrote it a bit chaotic here, but my nerves are at their ends

Edit: oh and yes I tried with all the settings, like support depth, support, fracture etc.

Hi LandsHeer,

I see you edited your post to indicate you have tried the support depths, but did you watch the video tutorials on Nvidias site for Destruction with PhysXLabs? Tutorials Here

I’ve not tried making a SpeedTree asset as destructible before, but ultimately it’s a static mesh so all should be possible. There are some caveats to using PhysXLabs and destructibles with meshes that have certain features though.

  1. if you’re mesh has holes or uncapped sides PhysXLabs will not cap those for you. You will need a complete mesh.
  2. using single planes (ie. the leaves) can cause issues when the mesh is fractured causing spikes.

These two things along with some really helpful information about destructibles can be found by opening the PhsyXLabs > Help > PhsyXLab Help button. This will bring up a helpful documentation for using it along with images for demonstration an dhow to fix these issues.

The best place to start with this is by watching the video tutorials linked above. The ones that refer specifically to support depth and giving you an example are “Jersey Barrier with minimal overhead” and the “Multiple FBX” one. With the last one you may not be using multiple FBXs but support depth is key. A lot of the videos go over support depth and setting it up but these are the two that may help you more. I would recommend watching them all though and to do the tutorial for practice to help you get more familiar with PhysXLabs and destructibles.

As for the collision issue…how are you setting up collision? Is this something that is handled with the SpeedTree asset or is this something you’re setting up custom? If you’re using the Mesh editor/viewer and adding collision here you may want to avoid the auto-generate as this will cover you’re entire mesh. You would want to use simple collision boxes and scale them to the necessary size or use an external program to make you’re own custom collision.

I hope this has helped and if you have any questions feel free to ask! :slight_smile:

Tim

Ok, So I got pretty far, it breaks nicely etc. Last Main Issue I have atm is the weight of the trunk, atm when cutting the tree, chunks break off but if there is just one really small one left, this little chunk holds the whole tree, also when I then destroy that little chunk the rest of the trunk flys away some meters. So I would like so that it behaves like a proper heavy tree. It starts falling when the support is too weak and doesnt jump like a baloon tree when its on the floor. Though I couldnt find a setting for that yet.

Thanks in advance for your help

To have the most control you’ll need to setup the support depths for these or use different FBXs to get the most destruction by knocking off chunks. The Multiple FBX tutorial from Nvidia can show you this concept in action.

If you want to control the speed more directly, because with the projectile there is a impulse being applied through its blueprint when the object is hit, you can open the settings for the destructible and change the Max Chunk Speed. This will allow you to set how fast your object will fall, so anything over 0 will be the new fall speed.

It may take some tweaking but there are a lot of settings in these parameters that working through and testing different ones for what they do will give you a better understanding. Hovering over the label for each will also explain their function to give you a better idea of what it controls.

Thanks! Got my tree’s work! :smiley:

I’m still not quite getting it right. I do have 3 mesh pieces that I apply physx to and export them to unreal engine, there I put them all together in a blueprint, which works great. But the problem is that when chopping the tree, parts fall off, but it still stand with just a tiny piece holding the bottom and top part, where it should normaly break, also before both parts get seperated the game freezes for just a sec and then the upper part flys a bit in the air and drops unnaturally, I played with all the settings there and am close to how I want it, but its still not how a tree should behave. Also what I noticed is that one tree got over 50k triangles with destruction on it, I tried to reduce it to just make the part destructable that the player can reach and chop, but then the rest of the tree is not falling properly.

Would love to see what the destructible trees look like, will you show anything in the future? :slight_smile:

PMed you, LandsHeer!

Yea we got it working pretty nicely now. Defently will show what we got as soon as the prototype is done :slight_smile:

how are you placing these trees? the foliage tool only paints static meshes I think so are you having to placing these trees manually or by blueprint?

Would also love to see this in action!