Killed a giant wasp and it fell on me, shattering my skull instantly and killing me from full hp
Describe the bug
Due to the way items cause falling damage from #65125 any given item does damage equal to (Mass in KG x Z-levels fallen x Its density). A giant wasp weighs 87.5kg and has a density of 1.1. I killed a wasp directly above my head and it fell on me, doing 99 damage. This is a problem for every other flying enemy too but this is pretty silly in particular since it's a oneshot.
Attach save file
n/a
Steps to reproduce
- Debug spawn a giant wasp directly over your head.
- Debug kill it.
- Observe its corpse falling on you and killing you.
Expected behavior
Falling damage should be based solely on density and not on weight to prevent ridiculous situations like this (and preventing you from doing ridiculous things like oneshotting mutants and the MTF by dropping an engine block on them) Also, things probably shouldn't do damage this way, if it's close enough for you to shank it with a sword it's not going to fall fast enough to hurt you.
Screenshots
Versions and configuration
- OS: Windows
- OS Version: 10.0.22621.1992 (22H2)
- Game Version: 8c55459 [64-bit]
- Graphics Version: Tiles
- Game Language: System language []
- Mods loaded: [ Dark Days Ahead [dda], Disable NPC Needs [no_npc_food], Portal Storms Ignore NPCs [personal_portal_storms], Slowdown Fungal Growth [no_fungal_growth], Bionic Slots [cbm_slots], Stats Through Kills [stats_through_kills] ]
Additional context
THE WASPS DID IT AGAIN
In my opinion, the damage calc should depend on:
- Damage depends on the weight of the item dropped.
- Damage reduction depends on the size of the zombie/something you're dropping it from.
- Accuracy depends on the volume of the item dropped.
- Miss chance depends on how small the size of the zombie/something you're dropping it from.
I would say it works as intended, except for the missing chance to miss (due to objects, monsters and characters not occupying the whole tile most of the time).
Let's say a z-level is 2.5 meters. The wasp would be falling for √(2x2.5m/9.8m/s2) = 0.714s, and it's final velocity would be 9.8m/s2 * 0.714s = 7m/s.
It's kinetic energy would be 87.5kg*(7m/s)2 / 2 = 2177 J, which is close to the muzzle energy of a 7.62×39mm fired from an AK47, which does 44 damage in game.
Also:
- The kinetic energy of the falling wasp would be spread out over a larger area and not a point penetration like a bullet.
- Neither you or the wasp are rigid bodies, you would absorb the kinetic energy over a longer period as your legs would bend as you got hit.
TL;DR: 99 damage is too much. Somewhere between 20-44 damage would be more realistic.
You probably didn't take in account that falling straight into your head would snap your neck plus brain trauma. I know someone who broke their arms from falling off their couch. This is a lot of conjecture though :P
a z level is 2.5 meters
If the wasp is close enough to attack you it's what. 0.5 meters? Also the giant 100kg mutant bugs are full of hydrogen sacks that should reduce their density.
a z level is 2.5 meters
If the wasp is close enough to attack you it's what. 0.5 meters? Also the giant 100kg mutant bugs are full of hydrogen sacks that should reduce their density.
I agree with the length, but 100 kg of wasp is the same is 100 kg of non-wasp
TL;DR: 99 damage is too much. Somewhere between 20-44 damage would be more realistic.
The wasp would not be falling 2.5 meters but ~70cm (considering man height of 1.8m). So kinetic energy at impact would be mere ~500J. Also bullets do penetration damage and to compare them you would need to compare pressure and force.
Formulas aside, 87.5kg and 2.5m is pretty much a man falling from not very high ledge on another man. Not saying it definitely can't be lethal but in most cases it would be few bruises.
According to the following study, there's a 50% chance to survive a fall from 48 ft./14.6 m, which is mechanically equivalent of something weighting as much as you falling with the hardness and rigidity as the ground falling on you.
https://link.springer.com/article/10.1007/s00068-017-0799-1
We can normalize 14.6 m to being 84 damage, the same head hp as a 8 strength character,
Looking at the damage value for bullets in GAME_BALANCE.md, damage is equal square root of kinetic energy (muzzle energy). If we say falling damage is also proportional to square root of kinetic energy, we get a proportionality constant of about ~0.75. I.e. damage = 0.75 * √(Ke).
Then we would have the following damage for a falling 87.5 kg rigid body with a z-level being 2.5 m:
| Z-levels | fall height (m) | kinetic energy (J) | damage |
|---|---|---|---|
| 1 | 2.5 | 2144 | 34.8 |
| 2 | 5.0 | 4288 | 49.2 |
| 3 | 7.5 | 6431 | 60.2 |
| 4 | 10.0 | 8575 | 69.5 |
| 5 | 12.5 | 10719 | 77.7 |
| 6 | 15.0 | 12863 | 85.1 |
| 7 | 17.5 | 15006 | 92.0 |
| 8 | 20.0 | 17150 | 98.3 |
| 9 | 22.5 | 19294 | 104.3 |
| 10 | 25.0 | 21438 | 109.9 |
Calculated with a z-level being 14 ft (~4.3 m), the average height of a floor in in the US, the damage table would look like this:
| Z-levels | fall height (m) | kinetic energy (J) | damage |
|---|---|---|---|
| 1 | 4.3 | 3659 | 45.4 |
| 2 | 8.5 | 7318 | 64.2 |
| 3 | 12.8 | 10977 | 78.7 |
| 4 | 17.1 | 14636 | 90.8 |
| 5 | 21.3 | 18296 | 101.5 |
| 6 | 25.6 | 21955 | 111.2 |
| 7 | 29.9 | 25614 | 120.1 |
| 8 | 34.1 | 29273 | 128.4 |
| 9 | 38.4 | 32932 | 136.2 |
| 10 | 42.7 | 36591 | 143.6 |
Realistic
The wasp would not be falling 2.5 meters but ~70cm (considering man height of 1.8m).
I recommend adding this to the calculation: substracting the target height from the distance of the falling object. Note: Don't screw up if creatures spanning multiple tiles are introduced.
Then small insects would get more crushed than hulks. Especially in the OP's case:
I killed a wasp directly above my head and it fell on me
I believe that the OP's case would be the most common. So it definitely should be considered as the most important.
Sensible
Alternatively. If you kill with a mele weapon something over your head, it is in reach regardless if you are 2m50cm or 20cm tall. So just substracting a whole tile might be the most bug-prone way. Making the feature not totally broken but still viable strategy. Just get a floor higher to throw the piano on the shocker's head to achieve the same result. But don't kill hulk by placing something on their head.
I read somewhere:
If we want to do CDDA hyper realistic, you can roll a dice every time you go down the stairs to see if you broke your neck. But that's not fun.
I read somewhere:
If we want to do CDDA hyper realistic, you can roll a dice every time you go down the stairs to see if you broke your neck. But that's not fun.
That's just some dumb shit which has nothing to do with CDDA development.
That's just some dumb shit which has nothing to do with CDDA development.
idk it's relevant here isn't it? semi buoyant wasps falling 50 cm after dying should just not kill you.
That's just some dumb shit which has nothing to do with CDDA development.
idk it's relevant here isn't it? semi buoyant wasps falling 50 cm after dying should just not kill you.
No, it is not relevant. 90 kg (wasp or not) falling onto your head can easily break your neck and kill you.
The wasp is not a bowling ball. It is a flexible articulated body with a high surface area. Even if it lands squarely on top of you, it is not going to transfer all of its energy into your head.
If a 100kg bowling ball landed on your head you would definitely be in trouble.
Most wasps also should not be 100kg. That is way heavier than makes sense for a roughly man-sized insect that is supposed to be flying partially aided by hydrogen sacs.
The wasp is not a bowling ball. It is a flexible articulated body with a high surface area. Even if it lands squarely on top of you, it is not going to transfer all of its energy into your head.
The dynamic kinetic energy of a moving object is defined by its mass and velocity. Its surface area would affect drag force, but not that much, so we can ignore it. When an object is dropped onto something it would lose its kinetic energy to do some work until fully stopped. If stopped by the head it would do that work deforming the head (and possibly itself).
If a 100kg bowling ball landed on your head you would definitely be in trouble.
100 kg is 100 kg whether it is a wasp or a bowling ball or anything else, so you are in trouble either way.
Most wasps also should not be 100kg. That is way heavier than makes sense for a roughly man-sized insect that is supposed to be flying partially aided by hydrogen sacs.
All monsters of specific monster type have exactly the same weight in DDA - 81500 g. It might be a wrong value (and that is a separate issue), but it does not matter for calculation - formulas would be the same no matter the values used.
Quotes from thread on discord to more appropriate place:
so I think the correct thing to do might be to add a perception test as well as the existing dodge roll. dodging a falling object is different from dodging an attack, the first major question is "do you see it coming". If you do, we should significantly buff your dodge. You should auto-pass this test if the falling object is something you killed or launched yourself.
also I think:
// values calibrated so that %hit chance starts from 60% going up and down according to the two modifiers
is incorrect, since that's 60% if the drop is totally random. If you drop an item randomly into a ~1-2m square region, there's not a 60% chance you'll hit a person-sized target. We should drop it to at most 25%, and probably more like 10%. We could consider making it partially influenced by the item's volume.
The chance of it hitting your head is already modified by your dodge. The more you successfully dodge the more likely it is to hit your arms, so if we drop the base hit rate and add a perception test, it should be very hard to hit yourself with a falling wasp unless you are otherwise unable to defend yourself.
@I-am-Erk beat me to it, but my approach is a bit different...
When a sufficiently heavy thing lands on you, you could fall down. Is that simulated? Though I see that wasp would break your neck if it fell on you without you noticing, If you fought it to death, it shouldn't, you would take action!
Your neck is bent as you are looking up at the thing you just fought. If you don't manage to dodge, no, rather either the simulation picks your action, or you should be able to pick one.
It is based on dodging skill, and strength. If you didn't yet notice, then on your trap skill to check if you do notice.
Defend Arms over your head, head down, shoulders up then it falls onto you, so arms take damage (hands, forearms, bit of shoulder).
Better with strenght.
Leaping You try to leap away! Didn't lept enough? It falls on your legs! Lept less? It falls on your torso and legs! If you lept very little, it falls on your head, torso, and legs. Even less? It falls on your arms, too!
Better with dodging skill and dexterity. The more time you have, the easier it is / the further you get.
Catch / push away
You will extend your arms to the wasp, trying to catch the thing. Or lay your head back and push the wasp away, if it does work, the force is transferred through your arms to your torso and legs, overwhelming arms and legs, they bend (getting no dmg from that).
If it doesn't work (you are too weak / the thing slipped / it went in between your arms) Your parts are hit in order with decreasing probability: head (turned away) torso, arms, legs.
I would like it if the player could choose. It would say what increases the chances, Like surgery or something I don't remember.
I would like it if the player could choose. It would say what increases the chances, Like surgery or something I don't remember.
Your diagrams are wonderful.
Generally we try to avoid player input on these things for a couple reasons; first, it represents the kind of split moment decision that feels like the opposite of pausing the action to pull up a dialogue, and second, because we still have to code in all the behaviour trees for what to do anyway for NPCs, so it means doing all that and also doing an optional dialogue that interrupts the action.
Your general summary is correct but I think honestly that most of that can be modelled by "if you see it coming and try to get out of the way, chances are it either misses you or hits your arms rather than your squishy parts".
It would be nice if your helmet and shoulder armour had higher coverage against falling attacks, idk how tough that is
We should also highly increase the chance of getting knocked down by these attacks. That's naturally modified by strength.
I was going for a DnD feeling, that's why I wanted the choice. But simple
Something is falling on you!
- Leap away!
- Cover!
Would do. I would prefer if you could choose a direction of the leap.
I would like the flavour text,
Random thought:
We have some info from the monsters that we could use to approximate rigidity, such as armor. A skeletal zombie, giant wasp or Exodii with a high stab armor to bash armor ratio is going to be more rigid than a slug, slime or fat zombie with low stab armor to bash armor ratio. Also bodytype, material, phase and weakpoint families provide some info.
100 kg is 100 kg whether it is a wasp or a bowling ball or anything else, so you are in trouble either way.
This is patently incorrect. The wasp is a large, partly soft, and most importantly articulated body with a very large surface area. When it impacts with the top of your head, it does not transfer all of its energy into your body because the rest of the wasp is still falling down around you. Your head is a stop on the way down, not the end of the fall. A bowling ball is much more dangerous because it is denser. It comes at least momentarily to a full stop on top of your head and delivers much more force into your body.
One Z-level is a single floor. It's maybe 2.5 meters tops. 100kg is the size of an adult man. Adult men fly into each other at moderate speeds all the time - police, football players, etc. This occasionally results in injury, but to say that your uncle jumping out a second story window and landing on top of you should instantly and invariably squash your head like a melon is ridiculous.
As mentioned above, a human body is also not an immobile post buried in the ground. A lot of what energy the body does receive, even on a direct hit, is absorbed when the body moves in response to the impact. Knees bend, the person tips over, they cover their head or duck so that part of the impact hits their arms or back, etc.
Lastly the calculations are obviously broken because you can kill bosses by dropping water or sand on them. Mass and velocity might be the only thing you need to think about when you're describing small projectiles like bullets (and even then ballistic performance is actually a lot more complicated than that), but things obviously get a lot more complicated when you're dealing with anything bigger.
100 kg is 100 kg whether it is a wasp or a bowling ball or anything else, so you are in trouble either way.
This is patently incorrect. The wasp is a large, partly soft, and most importantly articulated body with a very large surface area. When it impacts with the top of your head, it does not transfer all of its energy into your body because the rest of the wasp is still falling down around you. Your head is a stop on the way down, not the end of the fall. A bowling ball is much more dangerous because it is denser. It comes at least momentarily to a full stop on top of your head and delivers much more force into your body.
One Z-level is a single floor. It's maybe 2.5 meters tops. 100kg is the size of an adult man. Adult men fly into each other at moderate speeds all the time - police, football players, etc. This occasionally results in injury, but to say that your uncle jumping out a second story window and landing on top of you should instantly and invariably squash your head like a melon is ridiculous.
As mentioned above, a human body is also not an immobile post buried in the ground. A lot of what energy the body does receive, even on a direct hit, is absorbed when the body moves in response to the impact. Knees bend, the person tips over, they cover their head or duck so that part of the impact hits their arms or back, etc.
Lastly the calculations are obviously broken because you can kill bosses by dropping water or sand on them. Mass and velocity might be the only thing you need to think about when you're describing small projectiles like bullets (and even then ballistic performance is actually a lot more complicated than that), but things obviously get a lot more complicated when you're dealing with anything bigger.
100 kg is 100 kg
As I said in discord, damage calcs are very much secondary. First see what a far less accurate hit roll does since it will then be smacking secondary body parts. Then let's review damage based on that.
100 kg is 100 kg
Nice! You have mastered mass comparison. Impressive, one day you may even reach primary school level.
You are right, 100kg is 100kg. But I am pretty sure I would feel the difference between 100kg of water poured and 100kg bowling ball dropped on my head. You know, there are other physics charateristics and properties out there. Structure, density, elasticity, energy absorption and dispersion and many others.
@Nattfarinn you may go and train your wits elsewhere
I am affraid this will have to be settled with a physics experiment.
One thing that has not been explicitely brought up yet is that most monster masses and their densities are likely vastly wrong. There is no method to determine a somewhat correct value for most of our (mutated) critters yet. Wasps are just one example. That could benefit from a seperate issue if someone wants to look into that.
And folks, please cease the hostilities. Especially when you happen to have a badge due to being in the CleverRaven organization.
I've been working on how the weight carried cache is handled, and I noticed something that's relevant here, in item::on_drop:
bool item::on_drop( const tripoint &pos, map &m )
{
// dropping liquids, even currently frozen ones, on the ground makes them
// dirty
if( made_of_from_type( phase_id::LIQUID ) && !m.has_flag( ter_furn_flag::TFLAG_LIQUIDCONT, pos ) &&
!has_own_flag( flag_DIRTY ) ) {
set_flag( flag_DIRTY );
}
avatar &player_character = get_avatar();
// set variable storing information of character dropping item
dropped_char_stats.throwing = player_character.get_skill_level( skill_throw );
player_character.flag_encumbrance();
player_character.invalidate_weight_carried_cache();
return type->drop_action && type->drop_action.call( &player_character, *this, pos );
}
This function is called from add_item_or_charges, which is used every time an item is added to the map from anywhere and for any reason, including things like items being loaded into the reality bubble and, relevant here, corpse creation. This code naively makes the assumption that it's always the player dropping the item and uses the player's throwing skill to amplify the corpse drop's hit percentage, which means the hornet corpse will more likely hit the player the better the player's throwing skill, which is very silly, to say the least.
This code is also responsible for the player's weight carried cache getting invalidated every time any item is loaded to the map, so I'll probably fix it up as part of my PR.
This is a separate topic to the damage discussion going on here, note, I just thought it was funny and technically related.
One thing that has not been explicitely brought up yet is that most monster masses and their densities are likely vastly wrong. There is no method to determine a somewhat correct value for most of our (mutated) critters yet. Wasps are just one example. That could benefit from a seperate issue if someone wants to look into that.
And folks, please cease the hostilities. Especially when you happen to have a badge due to being in the CleverRaven organization.
For what it's worth, this is my stance. I think ZhilkinSerg is correct that a 100kg bug falling on you should probably be very damaging, even taking elasticity/dodging/air resistance into account, but... the mutant wasp being 100kg and yet still able to fly around seems like the real unbelievable thing, here. The largest flying bird in the world is only 15kg. If we want mutant bugs to stay heavy, maybe we could say they have, like, hydrogen/helium sacs that keep them light despite their size?
100kg bug falling on you should probably be very damaging, even taking elasticity/dodging/air resistance into account
This does not have to be an abstract problem. Like I've said before, the problem we are discussing can be easily replicable real life and is hardly fatal. 85kg is weight of an average adult man. Human body is not made of glass, most likely you will end up with some bruises if someone will fall on you. Not saying it can't be fatal, but it is lot lethal by definition or physics. We have joints that will absorb the fall, we have instinct and we do lean backward to not be hit at 90 angle. I would say that if we talk about imaginary realism, 99% of time you would fall on your back. This is not bullet headshot or 100kg bowling ball scenario by any means.