Need help calculating damage

Gonush

First time out of the vault
Hi,

I took on the ambitious task of creating a Fallout 2 mod that would provide a consistent, at least half-realistic weapon damage.
I quickly modded a 10mm SMG just to check how the game calculates damage in practice. For ease of calculation, I set the min and max damage to 102 (as the test target would be a slaver wearing Leather armor with DT=2, DR=25, so after substracting the DT it would leave a round 100 damage). First, to negate any DR modifier, I set the ammo to -100 DR. The two damage modifiers were set to 1/1.

As predicted, the slaver got 100 damage each time I shot him (excluding criticals, yum yum :-P )

But then, when I changed the ammo DR to -25 (I figured it would still cancel the armor's DR), he started getting... 70 points of damage.

I started to experiment. Ammo DR set to 0 produced 45 dmg. DR -10 gives 55 damage. Everything below DR -55 gives 100 again.

I observed a regularity - for every point of ammo DR below 0 the damage rises 1 point from 45 onwards...


The basic question is... What am I missing? Seems I don't get the equations right...

any help would be very appreciated
 
I have spent much time in the past analyzing the engine at the assembly code level and here is what I believe happens in the damage calculation function:

One uncertainty - I am unsure if this same function is used to calculate damage for an unarmed character.

[other functions in the engine derive the value for step 1]
1- a random damage value is determined
a- dependent on the damage range set in the weapon .pro file
b- dependent on any weapon perk set in the weapon .pro file
c- dependent on character weapon skill level (Skills)
d- dependent on character bonuses (Perks)

2- the value from step 1 is multiplied by a damage modifier
a- damage modifier value is found in the ammo .pro file

[step 3 only occurs if the damage modifier value is greater than zero]
3- the resulting value from step 2 is divided by a damage modifier
a- damage modifier value is found in the ammo .pro file

[step 4 is unclear because of my basic understanding of assembly code]
4- the resulting value from step 2 or 3 is changed (not understood) and divided by 2

5- the resulting value from step 4 is multiplied by the combat difficulty setting
a- easy = 75
b- normal = 100
c- hard = 125

6- the resulting value from step 5 is divided by 100

7- the resulting value from step 6 has the damage threshold value subtracted from it
a- damage threshold value is found in the armor .pro file
b- threshold values depend on the type of weapon damage that is being inflicted (normal, laser, fire, etc.)

[steps 8, 9 and 10 only occur if the resulting value from step 7 is greater than zero]
8- the resulting value from step 7 is multiplied by a damage resistance adjustment modifier
a- damage resistance modifier value is found in the ammo .pro file
b- resistance values depend on the type of weapon damage that is being inflicted (normal, laser, fire, etc.)
c- damage resistance values are found in the armor .pro file
d- the adjustment value is believed to be the damage resistance value from the armor plus the damage resistance modifier value from the ammo

9- the resulting value from step 8 is divided by 100

10- the resulting value from step 9 is subtracted from the resulting value of step 7

[step 11 only occurs if the resulting value from step 7 or 10 is greater than zero]
11- accumulate damage against target
a- resulting value from step 7 or 10 is added to the possible damage value to be inflicted on a specific target

[explanation of step 11: if a target is being hit by more than one attacker then damage is not caused to the target until all attacker turns are complete for that round]

12- a hit is reported/displayed if the resulting value from step 7 or 10 is greater than zero, otherwise a miss or hit with no damage is reported/displayed
[not sure where/how a hit is flagged as critical or not]

Hope this helps, I found it confusing and thus created a mod to change the function which is now included in Timeslip's work.

EDIT:
corrected 8d, changed "minus" to "plus"
 
@ Glovz

Well, I tried to follow the function... and it just doesn't work! Here are the calculations, step by step just as you posted:



1. 102

2. 102 x 1/1 = 102

3. 102 / 1 = 102

4. ? (no idea what step 4 means)

5. 102 x 125 = 12750 (hard difficulty)

6. 12750 / 100 = 127,5

7. 127,5 -2 = 125,5

8. adjustment value = 25 - 25 = 0 (100?)

125,5 x 100 = 12550

9. 12550 /100 = 125,5

10. 125,5 - 125,5 = 0???

Plus, I checked a couple of times, and combat difficulty settings have absolutely no effect on the damage (contrary to step 5) - regardless of how I set it, I always deal 100 damage (or do I have to start a new game with a lower setting?)

If by your mod you mean the one here
http://www.nma-fallout.com/forum/dload.php?action=file&file_id=1046

...could you confirm that it is compatible with Killap's patches? (doubt it, as this yours uses a changed .exe too...) How did you change the function?

By Timeslip's work you mean this one? http://falloutmods.wikia.com/wiki/Sfall
 
(Sorry for doublepost)

@ Kanhef

Yeah, hell, it sure behaves as if the Slaver's DR was 55. In fact, then it's pretty consistent. But why should he have as high a DR as 55? He *looks* to be wearing a Leather Armor (DT 2, DR 25) but who knows.. which .dat would I have to unpack to confirm his stats?

(plus, the 2 points from DT are substracted like from a Leather Armor, does he have a "natural" 30 DR then?)

***
EDIT:

You are right! In terms of damage calculation, every person in the game (or at least in the Den...) seems to have an "innate" DR of 30 - plus the armor DR.

That's why people with only clothes on got full damage only when I changed the ammo DR mod. to 30 and that's why Slavers have a DR of 55 (30 + 25 from the Leather Armor)

I don't have to say this has a tremendous impact on my damage-balance calculations...

I wonder what about Gecko's, Deathclaws and such... is there a full list of creature's stats somewhere?
 
Sorry - I had 8d wrong - changed it.

I ran through my own steps and got this:
1- 102
2- 102 * 1 = 102
3- 102 / 1 = 102
4- 102 / 2 = 51 (at minimum this step divides by 2)
5- 51 * 100 = 5100
6- 5100 / 100 = 51
7- 51 - 2 = 49
8- 49 * (30 + 25) = 2695
9- 2695 / 100 = 27 (the engine will round the number)
10- 49 - 27 = 22

I'm not sure why the damage you are doing in game remains so high. I assume while you are using the 10mm SMG that it is single shots you are shooting?

I will try to find some time to test this in game myself and get a better understanding for step 4.

FYI
Timeslip's mod:
http://timeslip.chorrol.com/sfall.html

Lastest version of my mod was added in version 1.20:
http://timeslip.chorrol.com/sfallchangelog.html
 
@ Glovz

Yeah. I'm shooting single, of course.

Well, Kanhef's suggestion put me on the right track - I spent a lot of time today playing with a cheated character and my 102 damage SMG and the results are strikingly consistent: EVERY CREATURE in the game, as far as I could tell - and I shot almost all types in the game today - HAS AN INNATE DR OF 30.
This includes dogs, rats, slavers, deathclaws, bandits, turrets, rabbits..

How did I test this?

I set the 10 mm JHP to have a 1/1 mod, no AC mod and -30 DR. Only with this setting (or lower) the gun dealt full 102 damage to non-armored people and animals, and when a target had visible armor, it dealt PRECISELY the damage it should for that armor type.

Examples:

A Slaver wears Leather Armor with the following stats DR= -25 , DT=2 (for normal damage)

With ammo set to DR -30, the damage received is exactly 102 - 2 (DT) - 25 = 75 points. If I set the ammo DR to -55, he gets the entire 102 damage.

A Bandit usually wears a Leather Jacket (DR= -20, DT= -1)

Ammo set to DR -30: he gets 102 -1 (DT) - 20 = 81 points of damage.

An unarmored civilian with ammo set to DR -30 always gets the full 102 dmg. If the ammo DR mod is set higher, it would seem he should still get 102 damage, as he has no armor whatsoever.

Wrong.

As he always "wears" his innate DR 30 "skin armor", he gets proportionally less damage as I raise the ammo DR modifier.

Proof enough?

I won't go into *why* every creature except you, the Chosen One, acts as if it is wearing Metal Armor (DR 30) underneath any armor it is really wearing. OR as if it had 3x the Toughness Perk. Talk about fair chances, Black Isle...

I've made a list of the damage I dealt to almost every creature type in the game. Maybe I should post it? Some people might find it useful (for example, I was surprised to see that Casino Bouncers in Reno really have a... Metal Armor underneath those suits!)

Greetz
Gonush (AKA Lith)
 
Your character doesn't have the Finesse trait, by any chance? Because AFAIK, Finesse adds exactly 30 DR to all your shots...
 
He does!

So now I know where the mysterious 30 DR comes from...

That's what I love about community forums ;-)

Thank you so much, Weirwood !

EDIT:

Thank you twice, as a minute later I realized that this solves another mystery I bumped into - "why do other characters deal more damage with my hacked SMG" ;-)

STATUS REPORT

right now I'm trying to figure out a realistic way of comparing damage done by various bullets. After rejecting TKO (Taylor Knock Out) values as unreliable and biased, it seems I will have to compare... shooting tests in ballistic gelatin.
 
Mystary solved! I thought it was going to be something simple like difficulty levels until you said it wasn't affected by difficulty level.

How do you shoot a laser beam into ballistic gel? How do you get hold of a laser gun?
 
In fact, *nothing* was affected by combat difficulty level in terms of damage, I would be glad if someone tested this on his own, though.

As for laser weapons (and all fictional weapons) I thought of using such methodology (fragment from my notes, still work in progress):

FICTIONAL WEAPONS should deal damage based on their proportion to 10mm pistol damage (melee weapons too) – this way they hold the balance they had in the original
1) calculate damage proportion % between original 10mm pistol and the given weapon
2) change the weapon’s damage by exactly the same % comparing to 10mm pistol's counterpart in the mod
3) ammo modifiers should be proportional as well (use method similar to 1) and 2) )


As for real bullet penetration, it's all very time consuming, but I hope I will be able to provide realistic proportions between the penetration and damage done by, say, .45 ACP and 9mm Luger bullets.

I'm not counting on realistic damage, since Fallout was never designed to be realistic ;-) That's why I first would have to decide on some arbitrary number a, say, 9mm Luger bullet should do to an unarmored target, and from there follow "realistic" proportions between bullets.

If some of you manage to find a site with some results of tests in ballistic gelatin using various calibers I would be grateful. Currently I'm working on the data provided at:
http://www.firearmstactical.com/wound.htm ("Wound Profile Illustrations")
http://www.brassfetcher.com
 
Per said:
How do you shoot a laser beam into ballistic gel? How do you get hold of a laser gun?

Look up Boeing's ABL project, or Northrop Grumman's Nautilus/Sky Guard system. A bit awkward to use as hand-held weapons, though. Or go to a large university and look for the physics lab with the "do not look into laser beam with remaining eye" sign.

I don't see a problem with testing it. Just fire a pulse of, say, 1/10 second, then measure the diameter and length of the burned/vaporized gel.

AFAIK, combat difficulty only affects enemies' attacks. Accuracy (and indirectly use of aimed shots), possibly critical chance. They do extra damage on rough, not sure if it's reduced on easy.
 
Status report:

Trying to simplify the ridiculously complicated calculations for different calibers.

I think that penetration will be based on US Army directive for bulletproof vests (the IV levels of protection will be translated into armor types existing in Fallout; I'm assuming that Leather Armor provides a Light Vest level of protection; Power Armor will be a hypothetical level V). Another assumption is that bullets that penetrate a given type of vest deal 80% of their base damage; bullets that do not - only 25%. I already managed to achieve similar results ingame for .45 JHP ammunition (this will the basic ammo, replacing 10mm) - after applying stats from my calculations they dealt 26% damage to Leather Armor targets, 40% to Leather Jacket and 100% to unarmored targets. Firing at anything more than Metal Armor mk.I produced no damage,which seems pretty good - .45 ACP has mediocre penetration (which not always is a bad thing), even more so in the JHP variety.

I also read about WWI projects concerning metal armor.

Currently I'm trying to determine exactly how much more each bullets does, but so far the results are inconsistent (analysis of penetration graphs form ballistic gelatin tests)

I realize this all sounds like a lot of fuss for a damage mod, but I'm intending to create a more or less consistent basis for other realistic mods for other games (I cooperated in the creation of the REDUX mod for S.T.A.L.K.E.R. - Shadow of Chernobyl - my nick was "Lith" - too bad it's already taken on NMA)

Greets
Gonush / Lith
 
Hi,
what will be the most simple way to calcul a burst fire damage depending of the distance and the number of characters?
 
I'm not sure how the game determines which characters in a group you fire at will get hit at all (and I'm talking before the actual to-hit roll). AS most Fallout players realize, it's pretty inconsistent, as it seems sometimes that you're bound to hit one person and suddenly only the ones behind it are hit.

As far as I know, the game (sadly) doesn't take into account distance as a factor for determining bullet damage.

From what I've seen, max damage from a burst is simply a single shot damage multiplied by the amount of rounds a given rifle/SMG shoots in a burst (varies for various types). Possibly, the to-hit roll is performed for each bullet. I don't have access to the actual equations, though.

Hope I understood your question correctly

NOTE:
No progress lately due to...well, lack of time. But I won't give up on it, promise.

Greets
Gonush / Lith
 
Back
Top