Damage formula in Fallout 2.
Shorts used in damage formula:
losuj(min,max) - random function for min and max base damage of weapon.
dmg_w - random selected weapon base damage
mod_1, mod_2, DR_ammo - ammo mods (mod_1 is ammo_damage_multi, and mod_2 is ammo_damage_div)
DT_armor, DR_armor - armor mods of target (critter which we will shoot him))
damage_wynik(dmg_w,mod_1,mod_2,DR_ammo,DT_armor,DR_armor) - function calculating the result damage.
If you use melee or HtH weapon, ()which dont use ammo) then there are used deafult ammo modificators (:
mod_1=1
mod_2=1
DR_ammo=0 %
trunc - function rounded to down, examples:
trunc(7,2)=7
trunc(7,5)=7
trunc(7,9)=7 etc.:
Algorithm in Turbo Pascalu code
Here is function calculating damage in Fallout 2:
function losuj(min,max:Integer):Integer;
begin
losuj:=Random(1+max-min)+min;
end;
dmg_w:=losuj(hero_weapon_min_dmg,hero_weapon_max_dmg);
function damage_wynik(dmg_w,mod_1,mod_2,DR_ammo,DT_armor,DR_armor:Integer):Integer;
var a:Integer;
b:Real;
begin
a:=Trunc((dmg_w*mod_1/mod_2)-DT_armor);
if a < 0 then a:="0;"
b:=0.01*(DR_ammo+DR_armor);
if b<0 then b:="0;"
if b>1 then b:=1;
damage_wynik:=a-Trunc(a*b);
end;
result is damage_wynik :)
Example for melee weapon (not uses ammo):
Weapon (combat knife):
weapon_min_dmg:=3
weapon_min_dmg:=10
ammo mods are deafult for melee (HtH) weapon and they are:
mod_1:=1
mod_2:=1
DR_ammo:=0 %
Targets armor:
DT:=2
DR:=25 %
Calculations:
dmg_w:=losuj(3,10)=6 {for example value 6 is randmized as damage from range 3..10)
damage:=damage_wynik(dmg_w,mod_1,mod_2,DR_ammo,DT_armor,DR_armor)=damage_wynik(6,1,1,0,2,25)
damage:=3
Damage done to target is = 3
Example for gun with using ammo:
Weapon (10mm Pistol):
weapon_min_dmg:=5
weapon_min_dmg:=12
(ammo mods for 10mm JHP, which is expanded ammo):
mod_1:=2
mod_2:=1
DR_ammo:=25 %
Targets armor:
DT:=2
DR:=25 %
Calculations:
dmg_w:=losuj(5,12)=8 {for example value 8 is randmized as damage from range 5..12)
damage:=damage_wynik(dmg_w,mod_1,mod_2,DR_ammo,DT_armor,DR_armor)
damage:=damage_wynik(8,2,1,25,2,25)=7
Damage done to target is = 7
(ammo mods for 10mm AP, which is armor piercing ammo):
mod_1:=1
mod_2:=2
DR_ammo:=-25 %
Targets armor:
DT:=2
DR:=25 %
Calculations:
dmg_w:=losuj(5,12)=8 {for example value 8 is randmized as damage from range 5..12)
damage:=damage_wynik(dmg_w,mod_1,mod_2,DR_ammo,DT_armor,DR_armor)
damage:=damage_wynik(8,1,2,-25,2,25)=2
Damage done to target is = 2
So you see that JHP ammo is much better than AP, and AP is very poor ammo.
Try to calculate damage done to more armored targets with the same ammo and weapon using Turbo Pascal function mentioned above.
If any questions then please PM me on NMA forum.
|