Get Accumulated Damage on destructible

Hi, I’m setting a destructible environment and I would like to have some control and precision to get the most realistic approach as I can.

The fact is that dealing with Damage, thresholds, physical materials, impacts and so , can be a bit complex to define and debug.

My question is, is there any way to get the accumulated damage on a destructible mesh? Something like “how much life does the object have before destroying” . I can’t find anything related to this and it would be really helpful.

Thank you very much!

Don’t know if it’ll help, but when i had a destructible piece, i kept it within a blueprint that had a ‘health’ variable and had the mesh as a standard static mesh. when the blueprint took damage it would take it off the ‘health’ variable and then when it reached 0 i would swap the static mesh for the destructible mesh and then through blueprint cause enough damage to the destructible to activate it.

Open your Destructible Mesh

In settings you found all you need in Damage section. You can set all via blueprint our manualy from this settings

  • Damage Treshold = Ammout of damage need to apply to make fracture the mesh
  • Damage Spread = More is near 0 more is precise the fracture. Example if you use a sniper bullet to shot the wall if you damage spread was 0.001 it make a hole if your spread damage was 1 it destroy the wall.
  • Enable Impact Damage = Used to calculate ammout of damage in function of speed moltiply per the impact damage. For example your Weapon is a pistol is damage factor was 10 when you shot it gain the impactforce = 1, if you make in blueprint that the impact force decreased evry 100 units is traveled the damage changed in function of the distance from the wall.
  • Impact Damage = Is just the damage factor that determine how much damage wall take in function of your settings via blueprint
  • Default Impact Damage = if you dont change the formula via blueprint is make the ammout of damage * speed that you insert here (example if you want that when character collide with wall dont destroy the wall xD just set this parameter to 0 and via blueprint you dont need to touch the caracter only the SM that must make damage
  • Custom Impact Resistence = If you want that wall resist in function of material you can just do it. Example Glass got resistence = 1, Metal got resistence = 10, Titanium got resitence = 100, Diamant got resistence = 1000. You can change it via blueprint
  • Impact Resistence = just the resistence value I told you before that can be set by default here but example if you want to decrease it in time. Example a new wood got maximum resistence example 5, after 1 in game year is become more old so you can decrease the resistence by 0.5 and new resistence was 4.5.
  • Damage Cap = If you shot with a nuclear bomb a item and you make simulation of explosion with 1 milion like damage on the impact it disintegrate evrething (in poor word it make disapear all distructible), if you want to prevent this you can set a damage cap so it didn’t disintegrate just apply maximum of damage destructible can take
  • Impact Velocity Threshold = If you shot with a weapon and when is touch the wall is just gat realy low velocity it cant make damage to the wall at all, if you want to make a minimum of damage in this case you can set here the minimum velocity that can have a Static mesh on impact with wall.
  • Max Chunk Speed = Same story of nuclear bomb for damage cap. If you got a big multiplayer open world and you make explode a nuclear bomb with 1 milion of damage but prevent destroying all parts by using damage cap your chunks was spread out in all game map xD, this can be fun but unrealisitc. So you can set maximum spee here
  • Fracture Impulse Scale = If your wall got a nice resistence and you start to shot with a weapon with low impact it stat to make fracture chunks but they rest inside the wall untill all wall side was destroyed to prevent this and make pieces fall down you need to set this parameter.

Evry parameter is settable via blueprint anche changed evry time. So you need to make a list of object that can damage the wall and when it collide with something can damage it, to change the setting in function of what static mesh colided with it. Is little complicated and require a little time of codding but the result you can achive is spectacular :slight_smile:

I believe you should be able to pull that information from the receive damage event node, I could be wrong on the actual name of it but I’m loading up the engine as I type this so in a moment I’ll screenshot what I’m taking about. In the meantime could you go into detail as to what it is your destroying(static mesh, physics actor, destructible, etc) and what you are destroying it with (actor, trace, etc)

This setup should get you in the right direction.

What happens is when the event is called its gonna take the damage it received and add that float value to the Accumulated Damage Variable (which i created) then print the string for debug purposes. Of course everyone’s project/game setup is different but this essentially should be a simple solution. I’m assuming you just want to see the value so you can tweek the settings to your liking right?

Thank you very much! Will try tomorrow and see.
Cheers!

Hey! Thank you very much for those explanations with examples :smiley: , really helpful as there was some things that I didn’t understand correctly :smiley:

Oh! this seems to be a good approach indeed! I will give a try! Thanks a million!

Cool glad to help, just please mark your question as answered if you are satisfied