Jump to content
  • Advertisement
Sign in to follow this  
Finalspace

Unreal Questions about destruction

This topic is 514 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am playing around with destructions a bit, so i created a destructuable mesh, added it to a destructable compontent and tested it with a few actors beside each other.

When something hits it fully breaks into pieces, which are fine - but then the pieces damage the neighboring actors as well... which is not want i want.

- How can i setup the destructable component, that it never gets damaged when something hits it (I want to call ApplyDamage manually byself) ?

 

Also the pieces gets thrown in all 3 directions, but i want to be limited to some Plane.

- What must i set to limit the created pieces to a certain plane - like for example to the XY plane (for rotation as well) ?

 

I played around with the settings, but its far too much properties to tune - so its hard to find the right ones.

Edited by Finalspace

Share this post


Link to post
Share on other sites
Advertisement
2 hours ago, Finalspace said:

but then the pieces damage the neighboring actors as well... which is not want i want.

Many ways to do it.

The first and most broad may be a flag that fragments don't collide with other fragments containing the same component. 

Another may be to maintain a list of non-destruction objects, or perhaps destruction-causing objects, on your component.  When fragments break off, mark their parents ID on the list.  When it comes time to collide, if any ID matches both lists or each other's IDs, the damage doesn't happen.

2 hours ago, Finalspace said:

Also the pieces gets thrown in all 3 directions, but i want to be limited to some Plane.

Depends on how they are moved in your game.  Immediately coming to mind, if they're physics driven, set them far enough apart they don't collide with each other, then apply forces along your plane.

2 hours ago, Finalspace said:

What must i set to limit the created pieces to a certain plane - like for example to the XY plane (for rotation as well)

There are many different representation of a plane and rotation by positions, some make this work easier than others.

Again with the first solution that jumps out at me, start with an axis of rotation through the explosion point. For example, if you want to spread them on the XY plane pick the Z axis, or the XZ plane pick the Y axis, if you've got some other plane pick the orthogonal axis. Select any angle of rotation around that axis for your directions. After that apply a rotation matrix for the direction you want to travel.  If you're spreading in n directions you may want to subdivide it into n blocks then pick a random angle within that block.
 

Share this post


Link to post
Share on other sites

Just a word of warning. UE4's implementation of destruction rendering is completely unscalable. Each chunk becomes a draw call.

Share this post


Link to post
Share on other sites
4 hours ago, frob said:

Many ways to do it.

The first and most broad may be a flag that fragments don't collide with other fragments containing the same component. 

Another may be to maintain a list of non-destruction objects, or perhaps destruction-causing objects, on your component.  When fragments break off, mark their parents ID on the list.  When it comes time to collide, if any ID matches both lists or each other's IDs, the damage doesn't happen.

Depends on how they are moved in your game.  Immediately coming to mind, if they're physics driven, set them far enough apart they don't collide with each other, then apply forces along your plane.

There are many different representation of a plane and rotation by positions, some make this work easier than others.

Again with the first solution that jumps out at me, start with an axis of rotation through the explosion point. For example, if you want to spread them on the XY plane pick the Z axis, or the XZ plane pick the Y axis, if you've got some other plane pick the orthogonal axis. Select any angle of rotation around that axis for your directions. After that apply a rotation matrix for the direction you want to travel.  If you're spreading in n directions you may want to subdivide it into n blocks then pick a random angle within that block.
 

Everything is physics driven and i basically want 2D destruction in a 3D top-down view. I havent found a setting how to configure the collision behavior...

Also i havent found a event yet how to get and control the created pieces.

 

1 hour ago, Syntac_ said:

Just a word of warning. UE4's implementation of destruction rendering is completely unscalable. Each chunk becomes a draw call.

This is no problem, because its a simple game with just a few actors (Maybe 100 at max). Also the pieces gets removed after some time (Gravity pulls them down into a kill trigger - when i solve the issue above)

Edited by Finalspace

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!