Bug #10832

ace_wounds energy calculations

Added by Sandiford almost 5 years ago. Updated almost 5 years ago.

Status:Closed Start date:05/25/2010
Priority:Normal Due date:
Assignee:Xeno % Done:

40%

Category:Script
Target version:1.3
Component:sys_wounds Affected Version:
Close Reason:

Description

Ace wounds calculates damage based on energy, which is based on velocity, which is worked out using speed/mass/friction and distance from the shooter

_vhit = _s + ((_unit distance _injurer) * ((getNumber(__ammocfg >> "airFriction")) * 1000));
_joule = 0.005 * (getNumber(__ammocfg >> "ace_mass") * (_vhit ^ 2));

Issues
1) Acceleration is linear - should be related to velocity, a round travelling fast will have more air resistance than one moving slowly
2) The velocity formula can return negative values at long ranges, the netagive value is squared giving a positive energy value - past a certain point ammo get more pwoerful the further away the target is
3) This formula is used for all ammo as far as I can see, including explosive ammo
  a) the distance travelled of grenade/rocket frag is measured from the shooter, instead of the explosion
  b) Artillery rounds have no shooter - velocity becomes -3.8e+009 leading to enourmous damage, everyone in the blast radius will be killed.

__________________________________________
example traces (_partdamage is damage calculated by the game, _nd is damage calculated by ace_wounds):

M203 40mm HEDP grenade at approx 350m

0:56:10.891 (0:02:46.461) [x\ace\addons\sys_wounds\fnc_ha.sqf:20] : _joule=11.0855, _dir=304.817, _cal=1, _vhit=-33.2949
0:56:10.926 (0:02:46.511) [x\ace\addons\sys_wounds\fnc_hd.sqf:65] PARAMS_5: _unit=B 1-4-I:1, _part=head_hit, _partdamage=0.568181, _injurer=B 1-4-K:1 (Sandiford), _ammo=ACE_G_40mm_HEDP
0:56:10.959 (0:02:46.511) [x\ace\addons\sys_wounds\fnc_hd.sqf:93] : _prevdamage=0.0539999
0:56:10.993 (0:02:46.541) [x\ace\addons\sys_wounds\fnc_hd.sqf:113] joule after: _joule=11.0855
0:56:10.995 (0:02:46.576) [x\ace\addons\sys_wounds\fnc_hd.sqf:116] : _nd=0.0484507
0:56:11.029 (0:02:46.576) [x\ace\addons\sys_wounds\fnc_hd.sqf:124] : _bloss=6.05634e-007
0:56:11.064 (0:02:46.611) [x\ace\addons\sys_wounds\fnc_hd.sqf:142] : _newpartdamage=0.102451

velocity is close to 0 at this range - damage is much lower than it should be - grenade launchers are next to useless at approx 300m

__________________________________________
MK19 40mm HEDP grenade at approx 800m

0:45:43.429 (0:00:16.143) [x\ace\addons\sys_wounds\fnc_ha.sqf:20] : _joule=879.158, _dir=310.651, _cal=1, _vhit=-296.506
0:45:43.430 (0:00:16.170) [x\ace\addons\sys_wounds\fnc_hd.sqf:413] : _rv=0
0:45:43.443 (0:00:16.170) [x\ace\addons\sys_wounds\fnc_hd.sqf:65] PARAMS_5: _unit=B 1-4-I:1, _part=head_hit, _partdamage=0.226146, _injurer=B 1-4-H:1 (Christian Gonzales), _ammo=ACE_M430Round
0:45:43.458 (0:00:16.199) [x\ace\addons\sys_wounds\fnc_hd.sqf:93] : _prevdamage=0
0:45:43.460 (0:00:16.228) [x\ace\addons\sys_wounds\fnc_hd.sqf:113] joule after: _joule=879.158
0:45:43.487 (0:00:16.228) [x\ace\addons\sys_wounds\fnc_hd.sqf:116] : _nd=1.52937
0:45:43.532 (0:00:16.248) [x\ace\addons\sys_wounds\fnc_hd.sqf:124] : _bloss=1.91172e-005
0:45:43.534 (0:00:16.277) [x\ace\addons\sys_wounds\fnc_hd.sqf:142] : _newpartdamage=1

_vhit has become highly negative - target was killed when he should only have been lightly wounded

__________________________________________
mortar:

0:25:05.470 (0:01:46.857) [x\ace\addons\sys_wounds\fnc_ha.sqf:20] : _joule=7.22e+017, _dir=253.953, _cal=33.33, _vhit=-3.8e+009
0:25:05.571 (0:01:46.929) [x\ace\addons\sys_wounds\fnc_hd.sqf:65] PARAMS_5: _unit=B 1-4-F:1, _part=head_hit, _partdamage=0.534719, _injurer=<NULL-object>, _ammo=ACE_ARTY_Sh_122_HE
0:25:05.600 (0:01:46.929) [x\ace\addons\sys_wounds\fnc_hd.sqf:93] : _prevdamage=0
0:25:05.624 (0:01:46.973) [x\ace\addons\sys_wounds\fnc_hd.sqf:113] joule after: _joule=7.22e+017
0:25:05.626 (0:01:47.017) [x\ace\addons\sys_wounds\fnc_hd.sqf:116] : _nd=2.96975e+015
0:25:05.651 (0:01:47.017) [x\ace\addons\sys_wounds\fnc_hd.sqf:124] : _bloss=3.71218e+010
0:25:05.676 (0:01:47.044) [x\ace\addons\sys_wounds\fnc_hd.sqf:142] : _newpartdamage=1

Massive damage received

__________________________________________
Solutions
1) More realistic velocity formula with acceleration related to velocity
2) a proper formula wouldn't return negative values, until then: _vhit = 0 max _vhit;
3) Most ammo can be seperated into 2 categories
  i) KE penetrators (e.g. sabot, bullets) - should use the current system
  ii) explosive weapons (e.g grenades, HEAT rockets, artillery shells) - either need to identify the explosion origin, or skip the energy section and just use the returned part damage

__________________________________________
ArmA2 1.05
ACE2 1.1.1.359
Other Mods: maps only

sandi_ace_wounds.rar (3.6 MB) Sandiford, 05/28/2010 16:19

sandi_ace_wounds_v1-2.rar (3.6 MB) Sandiford, 05/28/2010 21:06

sandi_ace_wounds_v1-2-1.rar (3.6 MB) Sandiford, 05/29/2010 11:02

sandi_ace_wounds_v1-2-2.rar (3.6 MB) Sandiford, 05/29/2010 11:11

sandi_ace_wounds_v1-2-3.rar (3.6 MB) Sandiford, 05/29/2010 11:24

sandi_ace_wounds_v1-3.rar (3.6 MB) Sandiford, 05/29/2010 12:27


Related issues

related to A.C.E. for OA - Feature #4203: Wounding/Body armor system Expired 09/01/2009

Associated revisions

Revision a3f50537
Added by Xeno almost 5 years ago

~CHANGED: Applied Sandifords ace_sys_wounds energy calclations changes, refs #10832

Revision a7e8d9fc
Added by Xeno almost 5 years ago

New version of Sandifords changes to wounds, refs #10832

History

Updated by Sickboy almost 5 years ago

  • Status changed from New to Assigned
  • Assignee set to Xeno
  • Target version set to 1.5 (OA)
  • Component set to sys_wounds

What an amazing report (seriously)! Thank you very much!

Updated by q1184 almost 5 years ago

There is a way to precisely tell the terminal velocity of a non-explosive projectile from received overall damage:


// _damage - new damage received by unit (0..1)

_armor = getNumber (__unitcfg >> "armor");
_armorstruct = getNumber (__unitcfg >> "armorstructural");

// Finding current 'hit' value of projectile. Empiric formula.

_hit = 4.0235*sqrt(_damage*_armor*_armorstruct);

// Calculating terminal velocity

_typicalspeed = getNumber (__ammocfg >> "typicalSpeed");
_confighit = getNumber (__ammocfg >> "hit");
_vel = _typicalspeed*_hit/_confighit;    

Updated by Sandiford almost 5 years ago

fixes to the above bugs and some improvements to damage model - files attached

note: this is an update on the version I gave nou, don't use that one

====changes:
explosive rounds use default damage calculations, KE rounds use the wounding system's calculations
automatic detection of round type can be overwritten with ace_w_ke = 1 or ace_w_explosive = 1 in configs

velocity calculation replaced with q1184's method

engine calculated damage removed from the damage calculation - damage is now proportional to energy.
intended as a base to expand on later

body armor effects replaced - body armor will now reduce the energy of the impact (and then damage) having a small effect on high energy rounds and a large effect on low velocity rounds

shots to limbs made more dangerous - they were previously negligible

Updated by Sandiford almost 5 years ago

updated version - based on 1.1.1.360

Updated by Xeno almost 5 years ago

The only thing I don't like is the empiric formula.

armorstructural is allways 1.0 for units.
unit armor is allways 30 (parts have different armor values).

So

_hit = 4.0235*sqrt(_damage*_armor*_armorstruct);

is

_hit = 4.0235*sqrt(_damage*30*1.0);

Updated by q1184 almost 5 years ago

Third-party units might have different armor. I think it's safer to account for it. And are you really so concerned about two extra multiplication operations? :)

Updated by Xeno almost 5 years ago

Yeah I am, because I haven't seen any unit using other values.

If I wake up early enough before the hotfix I'll try to implement it.

Though, a patch or diff would be easier to apply.

Updated by Xeno almost 5 years ago

Changes applied, ty.

I'll assign all complaints to you, Sandiford :D

Updated by Xeno almost 5 years ago

  • Status changed from Assigned to Feedback

Updated by Sandiford almost 5 years ago

v1.2.1

changed:

fixed body armour not working to the front (introduced with 1.1.1.360)
tweaked body armour values

Updated by Sandiford almost 5 years ago

v1.2.2
fixed .45 ACP mass (was 10x too small)

--broken--

Updated by Sandiford almost 5 years ago

v1.2.3

fix for a bad compile in 1.2.2

passed basic testing

edit: will apply changes to your revision and re-upload

Updated by Sandiford almost 5 years ago

v1.3

updated base
from: ACE2 1.1.1.360
to: revision a3f50537e96796a95127104a3ad2ab2a6456588b (equivalent to v1.2 which is based on ACE2 1.1.1.360 minus body armour direction checking)

no changes to final code, just changes in readme and .orginal files

Updated by Sickboy almost 5 years ago

Thanks a lot!
ACE has been hotfixed, build 362, and ACEX and CBA too.
One of your previous builds was included.

Updated by Sickboy almost 5 years ago

  • Category set to Script
  • % Done changed from 0 to 40

Updated by Sandiford almost 5 years ago

Cool, thanks for adding

Updated by Xeno almost 5 years ago

What editor are you using ?

Just asking because I had to replace many spaces with tabs.

A good editor is notepad++ in combination with ArmAScript from iOnOs:

http://dev-heaven.net/projects/i0n0s-armascript/files

Updated by Sandiford almost 5 years ago

That would be because I use soft tabs

I'll switch to hard tabs for ACE stuff in future

P.S. google results for soft tabs FTW

Updated by Xeno almost 5 years ago

I know them but I hate any unnecessary whitespaces :P (specially thos at line endings)

Updated by Sickboy almost 5 years ago

  • Target version changed from 1.5 (OA) to 1.3

Updated by fireship4 almost 5 years ago

Has anyone noticed weapons taking more shots to bring down soldiers after this was implemented? M4A1 RCO and a few of the US 7.62 sniper rifles were the ones that made me wonder if there was something wrong. Using ACE wounds.

Updated by M1n1d0u almost 5 years ago

negatif ... with M249 para M145 at 400metre 2 bullet and is down

Updated by Sandiford almost 5 years ago

fireship4 wrote:

Has anyone noticed weapons taking more shots to bring down soldiers after this was implemented? M4A1 RCO and a few of the US 7.62 sniper rifles were the ones that made me wonder if there was something wrong. Using ACE wounds.

Multiple parts of the damaged model changed, so there are differences.
Most likely reasons for trouble killing something:
  • shooting their arms/legs - this causes bleeding and disabling effects, but doesn't kill people very quickly
  • shooting at targets at extended ranges - around 400m for 5.56 and 800m for 7.62 (rough numbers) - bullets will have trouble penetrating body armour, and do significantly less damage.

I'd like to work on the body armour model, trouble is I have no way of knowing where a bullet hits the target, and therefore whether it hit a plate. Anyone got any ideas?

Updated by q1184 almost 5 years ago

Sent you a mail, Sandiford.

Updated by conKORD almost 5 years ago

Ace wounds calculates damage based on energy, which is based on velocity

What is with "whisper" subsonic bullets? Basically them have speed much smaller than normal bullets and them does too small damage when shooting too other player in MP games. I need about 7 hits from VSS to body to kill player (I may be exaggerating, hard to check it alone).

Updated by Sandiford almost 5 years ago

conKORD wrote:

Ace wounds calculates damage based on energy, which is based on velocity

What is with "whisper" subsonic bullets? Basically them have speed much smaller than normal bullets and them does too small damage when shooting too other player in MP games. I need about 7 hits from VSS to body to kill player (I may be exaggerating, hard to check it alone).

Subsonic ammunition isn't effective against body armour, you'll have to get headshots or use a weapon designed to penetrate armour

Updated by VKing almost 5 years ago

Specifically; 5.56mm subsonic ammo isn't effective against armour. Stuff like the 9x39mm SP-6 subsonic ammo that the VSS can fire (aside: is SP-5 (not-AP) or SP-6 ammunition modeled in ACE?) is designed to penetrate body armour even with a subsonic round.

Updated by Sandiford almost 5 years ago

VKing wrote:

Specifically; 5.56mm subsonic ammo isn't effective against armour. Stuff like the 9x39mm SP-6 subsonic ammo that the VSS can fire (aside: is SP-5 (not-AP) or SP-6 ammunition modeled in ACE?) is designed to penetrate body armour even with a subsonic round.

Well compared to a 5.45x39mm rounds it has 2.7x the cross sectional area and about half the energy, so i'm pretty doubtful of serious penetration capability. Also depends what you mean by body armour, plates can stop 7.62x51, currently soldiers have some kind of strong frag vest which stops alot of the damage from 9x39mm, but not all.

Bullet specific armour penetration and terminal effects aren't modelled yet, so i'll improve it's penetration when I get to that.

Updated by conKORD almost 5 years ago

VKing wrote:

Specifically; 5.56mm subsonic ammo isn't effective against armour. Stuff like the 9x39mm SP-6 subsonic ammo that the VSS can fire (aside: is SP-5 (not-AP) or SP-6 ammunition modeled in ACE?) is designed to penetrate body armour even with a subsonic round.

10 round VSS magazine have SP5
20 round VAL magazine have SP6
VAL magazine can be used in VSS

Updated by mr.g-c almost 5 years ago

Sandiford, Kudos Man, its really nice that you work on IMHO one of the most important parts in ACE's realism compartment. I'm really excited!

Wounding Systems Effects and the way to heal & co. also need to be put at least at the level of ACE1's wounding system - the current system is just uber simple without any punishments, ie you can run as long as you want, bleeding can take hours without you dying, etc etc.. It just doesn't feel right, which it had during ACE1.

I will open a different ticket about it in a few day, do you think you can look into that too?

Updated by Sonsalt almost 5 years ago

Talking about energy calculations, blood pressure is in my opinion closely related to this issue.
The most common cause of death caused by an injury inflicted by a bullet is the failure of vital organs due to lack of oxygen.
As a bullet travels through the body it inflicts several grave injuries to the veins. These injuries cause the loss of pressure and ultimately the lack of oxygen and the loss of conciousness and failure of vital organs.

Thus even a fatally wounded person can fight back for a couple of seconds until the shock starts to take effect.

Only Injuries to central nerves and a shock result in an instant collapse.

Would be great if this fact could be represented via the wound system. Making the blood loss more vital and shooting more realistic

Updated by rocko almost 5 years ago

Does blood loss generally means blood spilling out of a wound or slow rinsing?

Updated by Sonsalt almost 5 years ago

well it means the blood leaving the bloodstream, and thus causing the pressure to drop.

Updated by rocko almost 5 years ago

What speed is it leaving the body?!

Updated by Evil_Echo almost 5 years ago

To clarify the English - it's the rate of loss that matters, not the speed. Any loss of blood that exceeds the rate of replenishment will lower the pressure eventually to the point of unconciousness and then death. The lethality of a wound is primarily determined by the rate of blood loss it causes, with a nod toward CNS damage ( aka headshot ). Other factors like organ failure are on a time scale outside of what matters for A2.

So - a massive wound to the hand can be rapidly fatal if untreated due to arteries being severed, while a gut shot from a non-expanding round that misses the aorta and vena cava could require just a compress dressing and some pain medication - the casualty could possibly even resume limited combat prior to medevac.

Damage could be modeled on a penetration system similar to sys_armor, with the residual kinetic energy and ammunition type then used to generate a blood loss rate with some randomization added to represent lucky/unlucky hits in a given area. Bandages/tourniquets/quik-clot agents all would reduce/stop that rate of loss. Plasma/blood would raise the rate of replacement. The difference would determine the blood pressure. At various thresholds you trigger the effects of wounding, shock, unconciousness, heart stoppage, etc.

Anyway - think this is what Sonsalt has in mind. If so, should be very nice system.

Updated by Sonsalt almost 5 years ago

That is exactly what I was about to write.

And this works perfectly with this module: http://dev-heaven.net/issues/11450#change-55468

Updated by fireship4 almost 5 years ago

Damage could be modeled on a penetration system similar to sys_armor, with the residual kinetic energy and ammunition type then used to generate a blood loss rate with some randomization added to represent lucky/unlucky hits in a given area. Bandages/tourniquets/quik-clot agents all would reduce/stop that rate of loss. Plasma/blood would raise the rate of replacement. The difference would determine the blood pressure. At various thresholds you trigger the effects of wounding, shock, unconciousness, heart stoppage, etc.

I like thst idea, and I'd particularly like the option to make it so players can't return to combat if they are seriously wounded. Medics just for stabilisation, with more equipment (and medics) back at base. Their job will be to prevent the wounded from dying and you team from loosing tickets! That would be great.

Updated by Sonsalt almost 5 years ago

Since Operation arrowhead delivers a whole new system on bullets travelling through objects and now for the first time also through Soldiers we should check in what way this will affect the damage system.

We should also check on how to utilize types of bullets now like FMJ or HP. This is dependent on how he energy of each projectile is calculated into damage for the person.

Updated by Sickboy almost 5 years ago

  • Status changed from Feedback to Closed
  • Target version changed from 1.3 to 1.5 (OA)

Updated by mr.g-c almost 5 years ago

Sonsalt wrote:

Since Operation arrowhead delivers a whole new system on bullets travelling through objects and now for the first time also through Soldiers we should check in what way this will affect the damage system.

We should also check on how to utilize types of bullets now like FMJ or HP. This is dependent on how he energy of each projectile is calculated into damage for the person.

Wow awesome!
This combined with the proposed features in here: #4203
Would be absolutely breathtaking!

Updated by Sickboy almost 5 years ago

  • Target version changed from 1.5 (OA) to 1.3

Also available in: Atom PDF