Greg's Destruction Playground

Hi all !

I’m currently playing a lot with destructibles and as I make videos of my different successful tests I thought I would show them over here. I will be adding more and more over time as I get interesting things to work. I will also gladly answer your questions if you have any so don’t hesitate.

Also I’ll list my questions about the things I do in a video below them in case some of you would have the answer and would like to share…

Fire Propagation Destruction:

https://www.youtube.com/watch?v=qLfz-qcaQsU

Q: When I make all the walls “Extented Structures” only the first would break (only tested with RadialForce). Why is that ? I tested multiple cubes in “Shooter Game” and they all break with the weapons.

I like this, I can see this being developed into something very cool. Burning down a shack or barn, maybe a field or forest too.

Looks amazing :slight_smile: Would definitely look interesting in some game .

Thanks for the feedback so far !

As I can’t include more videos in the first post here’s another one (not related to fire):

Destructible Replication (first successful attempt):

Running as a dedicated server with 2 clients. Triggered from “ApplyPointDamage”.

Looking good !

Destructible Replication (Test #2):

Obviously some chunks are not ending up the same way on both clients. That is why I enabled separation and timeout. Any anybody already figured how to correctly synchronize chunks over the network (if ever possible) ?

PS: The fact it doesn’t break on every bullet is because I did it on “Fire” event here. Just noticed I forgot to do it when actually firing each bullet.

i doubt very much that there is a way to sync the chunks, most likely only the fact it took damage is sent and the client does the rest

Thought so as well… Thanks for your answer.

Unreal simulation doesn’t use a fixed physics time-step, so it can’t possibly be deterministic.
You could consume a lot of network bandwidth, by spawning fragments as “projectiles” of some sort, that are chunks going in position/direction, and then occasionally re-syncing them.
That won’t work very well for any significant number of chunks over the internet, though.

Well then I wonder how DICE does it. I know many of their destructibles must be pre-defined. Some break instantly too. But still some others look like they would nee per-client sync in order not to kill the gameplay. Like if you shoot a concrete wall to make a hole into it to then shoot enemies through it. Enemies should also be able to shoot you through that hole or it wouldn’t be very fair. Thing is that hole can be anywhere on that wall.

looks pretty cool man, does there seem to be a significant performance drop when using this that you’ve noticed?

Well not really. Maybe if I use a lot side by side. Yesterday I made a kind of little house made of multiple destructibles linked via “From Extended Structures”. Worked fine without really a performance drop. Also since that I’ve tested with per-bullet hit (which was not the case there, was only once per mouse click lol). Plus I added fracture particle effects (like for the fire).

But this is only local multiplayer so far. To really tell if it’s going to be fine I need to test it over the internet. But here I had all at with a lot of post-process (to simulate an inside-helmet view if you noticed) and a very reflective floor plus dynamic lighting and shadowing so. When I get the time I’ll try a burning set of pieces with more “fake” clients.

Hey Greg,

Would you be willing to share the blueprint setup of how you made the destructible mesh replicate? Are your destructibles their own blueprint for this?

I’ve previously set up in my character blueprint to apply a radial damage but I’ve not been able to get that work at all.

Your project looks cool and makes me want to try the fire style effect you’ve got going just for fun! :slight_smile:

Keep all the fun stuff coming this is awesome!

The fire destruction in the first video is not replicated. I’ll make a tutorial or something somewhere later and for replication too. This because I’m not yet sure I’m doing those things in the most optimal way at all. And this part of the forum is dedicated to showcasing work in progress so it’ll be elsewhere.

Here’s a new video example. No replication in this one. I just tested for the first time playing with the PhysX API (thanks to 's tutorial).

Chunk Vacuum

I’m basically applying upwards impulse to the chunks in the Destuctible’s Tick. I’m thinking playing with the PhysX API might be the answer to the DICE related question and so.

I don’t know how i missed 's tutorial… i’ve been looking for some starter info like that. Do you think it is possible to direct those impulses by a defined function rather than direction… I think that could be useful in creating different effects such as a tornado like vortex or a gravity well where everything implodes inward to a point of convergence.

I do impulses in Tick which you can change every Tick. Also if the destructible is simulating physics maybe you don’t even need PhysX API to do that (assuming you want to apply it to all chunks at once). Here I’m doing the same for everything but the good thing with PhysX API is that you can work on chunks directly. In the video description I included the links I used as reference.
https://developer.nvidia.com/sites/default/files/akamai/physx/Manual/RigidDynamics.html#rigiddynamics



void PxRigidBody::addForce(const PxVec3& force, PxForceMode::Enum mode, bool autowake);
void PxRigidBody::addTorque(const PxVec3& torque, PxForceMode::Enum mode, bool autowake);

void PxRigidBodyExt::addForceAtPos(PxRigidBody& body, const PxVec3& force, const PxVec3& pos, PxForceMode::Enum mode, bool wakeup);
void PxRigidBodyExt::addForceAtLocalPos(PxRigidBody& body, const PxVec3& force, const PxVec3& pos, PxForceMode::Enum mode, bool wakeup);
void PxRigidBodyExt::addLocalForceAtPos(PxRigidBody& body, const PxVec3& force, const PxVec3& pos, PxForceMode::Enum mode, bool wakeup);
void PxRigidBodyExt::addLocalForceAtLocalPos(PxRigidBody& body, const PxVec3& force, const PxVec3& pos, PxForceMode::Enum mode, bool wakeup);


There are tons of possibilities you could think of. Like pushing the chunks torwards you and then orbit around you.

Awesome work GregBlast! I have been watching this thread very closely and every video that you posted gets me more and more and more interested with Destructibles. Keep up the amazing work!

Thanks a lot for your reply ! I will try hard to keep amazing you then.

Here’s another pretty interesting one (may I say) where I’m now having “Fun With Chunks”. This one is divided into three parts:

  • Trapping the player: chunks are pulled torwards the player and ultimately completely surround and block him
  • Orienting the chunks: chunks are pushed in the player’s forward direction so that I can move them kind of where I want. That’s what leaded to the third part.
  • Controlling the chunks: chunks are pushed individually to the direction of the player’s aim. Aiming at an object allows me to surround it with chunks and block it.

Wait for the third part because that’s almost the only one that really matters in the end :).

Fun With Chunks

Note: sometimes the application crashes when I’m trying to get the chunk’s pose (lcoation, …). The actor is valid so there shouldn’t be a reason for it though. I think it happened only with my glass destructible. Maybe because it’s overlapping a BSP wall and a chunk was trying to move inside of it ?

More to come…

Hungry Chunks - Destructible chunks controlled by player eating other destructibles

I decided to play a little more with fire. So I transfomed the basic gun into a…flamethrower. This time it was even more fun :slight_smile:

Flamethrower