Fallout 2 memory offsets

This is really great work Ravachol! Thanks very much! :)
I have had study your formula and probably you missing armor damage_resistance, so formula should be like this:

(((base_damage*dam_mult/dam_div)/2)*cbt_diff_mod)/100-dmg_tresh-(((((base_damage*dam_mult/dam_div)/2)/cbt_diff_mod)/100-dmg_tresh)*(ammo_dr_adj+dmg_resist)/100

It seems that my formula discovered years ago is similiar to yours :)

I have proposition, to change the formula (it will fix the ammo problem) to this:


(((base_damage*dam_mult)/2)*cbt_diff_mod)/100-dmg_tresh/dam_div-(((((base_damage*dam_mult)/2)/cbt_diff_mod)/100-dmg_tresh/dam_div)*(ammo_dr_adj+dmg_resist)/100

dmg_resist – Damage Resistance of armour (this is those percent values in armour stats)

This is good algoritm, I tested this, and AP ammo will be better on hard armored creatures than JHP ammo and JHP is better against creatures in light amrours than AP.
Of course ammo stats should be changed a bit but it will be more easy, than now. It will work properly on small values of weapon base damage’s!

Please, implement new formula to code!
 
Yes, you're right, the variable I called ammo_dr_adjust isn't just the ammo_dr_adjust. It's (like in your corrected algo) the damage resistance of the target plus the ammo_dr_adjust.

It's also possible for the dmg_resist value to be reduced to 40% of its value and dmg_tresh to 72% of its value but I haven't fully understood the conditions yet:
dmg_resist is reduced to 40% of its value and dmg_tresh to 72% of its value if an unknown condition matches. The only thing I know is that it doesn't apply if the damage type of the weapon is emp_damages.
dmg_resist is reduced to 40% of its value if an unknown condition matches, I believe this condition has something to do with the weapon.
Also, if the attacker is the player and he has the finesse trait, it adds 30 to the dmg_resist of the target (after it's been reduced if one of the previous conditions matches).

These modifications are made before the ammo_dr_modifier is added to the final value.

Well, I'll try to write the code and replace the algorithm.
 
When I discover the algoritm years ago I tested this hundred times in Excell sheet and compare to Fallout2 during combats, and I do not saw nothing about reducing dmg_resist nor dmg_tresh to those values you wrote (40% or 72% of base values).

I do not know what conditions must be to make such reducing :(

I am thinking about it but I do not know.

EDIT: maybe this is some perk attached to weapon? Like "weapon penetrate"?
 
Traits that could/should affect damage calculations:
Bruiser --- should affect an increase melee damage
One Hander --- should affect a decrease in accuracy and/or damage with two handed weapons only
Finesse --- should affect an increase in critical hit chance
Kamikaze --- should affect a decrease in your damage resistance
Heavy Handed --- should affect a decrease in chance of critical but increase normal damage

Perks that could/should affect damage calculations:
Bonus HTH Damage --- should affect an increase in damage only in melee combat
Toughness --- should affect an increase in your damage resistance
Bonus Ranged Damage --- should affect an increase to damage with ranged weapons only
More Criticals --- should affect an increase in critical chance
Better Criticals --- should affect an increase in the damage done by a critical hit
Pyromaniac --- should affect an increase to damage with fire weapons only
Slayer --- should affect an increase in critical hit chance only in melee combat
Sniper --- should affect an increase in critical hit chance only with ranged weapons

All of the above should be taken into account somewhere in the formulas of damage calculation. I'm assuming the Traits and Perks that affect core character stats are handled else where, thus affecting damage calculations incidentally.
 
Ok, here's the patch that change the algo: http://www.megaupload.com/?d=M5ZBTNL4 (needs testing, I may have made a mistake).

Glovz: most of theses traits/perks modifies directly the stat(s) they affect so it's not needed to check for them, the function I'm working on isn't the one where it's determined wether or not it's a critical hit (but I suspect that if it's the case an argument that is passed to this function is different from its usual value).
Finesse, bonus ranged damage, pyromaniac and living anatomy do affect this function, I know there's also some check for melee at the end, but I can't remember exactly what it does (I'm pretty sure it doesn't add more damages points).
I remember having seen some tests on some of these perks/traits on functions using this one (or functions called by these ones).
 
Thanks Ravachol for good work!

Patch seems to work well, I tested this few times on different ammo and creatures with "flat" damage of weapons, and compared to tests in Excell sheet.

Good work!

I think that this formula is good but if I find new better then I will write this here.

If you are not bored of tinkering in fallout I have next propositions:
- where is offset of max range of grenade, throwing knife and other thrownig weapon?
- I saw on some topic on forum something about perks, but thisis about conditions of hero to gain perks, not a table of perks, could you find real table of perks?
- if you play Fallout you saw options of melee/handed weapons like this: "swing/thrust"
as i know this is not any different but I want to ask you check this in engine, maybe it could be possible to repair? Swing should be better on unarmored targets and thrust should be better on armored targets
- find action points used to reload weapon during combat and entering to inventory during combat,

I have more propositions but i know that all those things takes much your time and some of them are not very easy.

but if you have time and you like this you know what to search in engine.

Sorry for my English, my native is Polish but I hope you understand what i write.

Greetings!
 
Nice job :D

Sorrow said:
I can't download it because of "limit of connections for my country" :( .
You must install their damn Toolbar to download something. So, maybe someone will reupload it on another free hosting server.
 
Ok I upload the patch to my site and you can download it form my small site from download section.
The patch is for test and works good, but to very good working you need to make some changes to any ammo stats.

The patch is on English and Polish version on site.

Have fun!
Thanks to Ravachol for patch :)

I prepare such small ammo mod for good working with the patch :)
 
Continuum said:
Nice job :D

Sorrow said:
I can't download it because of "limit of connections for my country" :( .
You must install their damn Toolbar to download something. So, maybe someone will reupload it on another free hosting server.
The toolbar doesn't seem to work for me.

Cubik2k said:
The patch is on English and Polish version on site.
Thanks :) .

ravachol :arrow: Wow, it works :) ! Thanks for making the patch :D - it's great to see AP ammo is better against armored foes :D .
Hmm...
Any chances for a F1 version of the patch?
 
If you are not bored of tinkering in fallout I have next propositions:
- where is offset of max range of grenade, throwing knife and other thrownig weapon?
- I saw on some topic on forum something about perks, but thisis about conditions of hero to gain perks, not a table of perks, could you find real table of perks?
- if you play Fallout you saw options of melee/handed weapons like this: "swing/thrust"
as i know this is not any different but I want to ask you check this in engine, maybe it could be possible to repair? Swing should be better on unarmored targets and thrust should be better on armored targets
- find action points used to reload weapon during combat and entering to inventory during combat,

- Isn't the max range for throwing weapons calculated from the character's strenght? Well, maybe I'll check.
- You're talking about this: http://modguide.nma-fallout.com/#Engine009 aren't you? I had alook at these a while ago and I think it's pretty complete, other actions of the perks are hardcoded in the game (like in the damage function for adding damages points if the player has the bonus ranged damage perk).
- Maybe I'll check this too.
- I'm not sure to know why one would want to change the actions points for reloading a weapon and entering inventory but I can check.

Sorrow: I'll see what I can do for a FO1 version of the patch. It shouldn't be too hard if things are done the same way in FO1 (which is probably the case).
 
Very nice work ravachol!

Since you are digging through the Fallout2.exe, would it be feasible for some bugs associated with perks to be corrected? Two from Per's guide come to my attention.

Code:
The Pathfinder perk appears to be slightly bugged: the first level will cut 20% of travelling time (not 25%), while the second level doesn't seem to do anything at all. In Fallout the perk worked as it should.  
  
Sharpshooter is bugged and doesn't really do what the manual says; it's supposed to raise PE by 2 for sniping purposes, yet often improves your chance to hit less, and never more, than increasing PE by 1. Michal Burger figured out that this is because the perk thinks range modifiers are calculated based on PE when it's in fact PE*2, and so increases your chance to hit only half as much as it should. At least it gives you a bonus even if your PE is at 10 already.
 
Ok, I looked at these two perk, if the bug only comes from the fact that range modifier are based on PE*2, this fix should work: http://www.megaupload.com/?d=X5SME08B (however, it needs some testing).

About the pathfinder perk: the problem seems to come from the fact that values for terrains type in worldmap.txt are too low for this perk to have any effect except on the mountain terrain and only for the first level of this perk: if the terrain type minus the level of this perk is less than one then the result of this substraction is forced to 1. Well, with these values, you can understand why it doesn't seem to do a lot of things:

terrain_types=Desert:1, Mountain:2, City:1, Ocean:1

however, I haven't fully understood the function concerned yet, I may have a solution once It's done.

For the other things: throwing weapons max range seems to be calculated based on the character's strength, I'll post the algo when it's fully deciphered.
I also have located where the action points for reloading weapons and accessing the inventory during combat are minused from the character's AP. I'll post this later too.
It's interesting to note that for the solar scorcher, it's hardcoded in the exe and that it's not the first item whose behaviour is modified directly in the exe (so, to modmakers: if an item acts strange, try to change its pid, maybe that's where the bug comes from).

Well, that's all for now. Bye.
 
Questions:
1- Are these changes being done to the US 1.02D patch exe?

2- Will the final file have all the changes requested by anyone or will there be a file that only deals with bug fixes and a second that contains fixes+additions?

I would hope to see a file that contained bug fixes and say the city limit removed/changed.
 
1- Yes, I work on the 1.02d US exe
2- I'm not sure there will be anything "final", I just release patches (or infos) for each issue I fix or addition I make. There shouldn't be any conflicts between the patches (just ignore the message about the wrong CRC when you apply more than one patch).
If I ever release something "bigger", I'd imagine more a compilation of patches for modders.

bye.

EDIT: MIB88 made me notice that it's not possible to force patching over an already patched file, so here are the new patches, the patcher doesn't check the CRC anymore:

the ammo patch: http://www.megaupload.com/?d=3DGMDJ8B
the sharpshooter fix: http://www.megaupload.com/?d=YLPUEM7X

bye.
 
Hi Ravachol,

Here is formule of new damage algoritm ver. 2:
(((base_damage*dam_mult)/2)*cbt_diff_mod)/100-(dmg_tresh+dmg_tresh*DRammo)/dam_div-(((((base_damage*dam_mult)/2)/cbt_diff_mod)/100-(dmg_tresh+dmg_tresh*DRammo)/dam_div)*(DRammo+DRarmor)/100

where:

DRammo - ammo DR adjust
DRarmor - damage resistance of armor

ammo_dr_adj=DRammo+DRarmor

This algo is better than last you implemented to engine. It would be nice to have new version o damage patch.
I have a favour to you to make such patch.

Greetings :)
 
I have been trying to verify your algo Cubik, but I think it's incomplete (or incorrect). Could you please provide a little more detail or show what results you get from pumping in proper values for the variables.

Thanks
 
The short version of algo2 in pseudo-Turbo Pascal code is:

var1:=(dmg*mod1-trunc((DT+DRammo*DT)/mod2))
final:=var1-(var1*(DRammo+DRarmor)

or

final:=(dmg*mod1-trunc((DT+DRammo*DT)/mod2))-(dmg*mod1-trunc((DT+DRammo*DT)/mod2)))*(DRammo+DRarmor)

where:

dmg - weapon damage
mod1 - ammo Dmg mult
mod2 - ammo Dmg div
DRammo - DR modifier of ammo
DT - armor Damage Treshold
DRarmor - armor Damage Resistance

example

weapon damage is 12 - 22 --> randomizing is for example 15
dmg=15
armor is 3/25% -----> DT=3, DRarmor=25%==0.25
ammo is 1/2 -50% -----> mod1=1 mod2=2 DRammo=-50%==-0.5

final:=(dmg*mod1-trunc((DT+DRammo*DT)/mod2))-(dmg*mod1-trunc((DT+DRammo*DT)/mod2)))*(DRammo+DRarmor)

final=(15*1-trunc((3+(-0.50)*3)/2))-(15*1-trunc((3+(-0.50)*3)/2))*(-0.50+0.25)=
=(15-trunc((3-1.5)/2))-(15-trunc((3-1.5)/2))*(-0.25)=
=(15-trunc(1.5/2))-(15-trunc(1.5/2))*(-0.25)=
=(15-trunc(0.75))-(15-trunc(0.75))*(-0.25)=
=(15-0)-(15-0)*(-0.25)=
=15-15*(-0.25)=
=15-15*0=
=15

final is 15 because
if (DRammo+DRarmor)<0 then (DRammo+DRarmor)==0


I hope that this description is clear and understand

Greetings :)
 
Ok, I understand your variables and your values, and where those values are obtained from in their respective prototype files. What I don't understand is why you arrange the formula the way you do.


My understanding:

base_damage = a random value from the weapon's min.-max. range plus any modification from perks or traits
(example: .223 Pistol range = 20-30 + perk + trait)

dam_mult = a value pulled from the ammo type being used
(example: .223 FMJ multiplier = 1)

dam_div = a value pulled from the ammo type being used
(example: .223 FMJ divisor = 1)

dmg_tresh = a value pulled from the target's armor
(example: Metal Armor DT Normal = 4)

cbt_diff_mod = a value pulled from the difficulty setting of the game
(example: Normal = 100)


My assumption:

ammo_dr_adj = a value for DR pulled from the target's armor expressed as a percentage plus a value for DR modification pulled from the ammo type being used expressed as a percentage
(example: Armor DR Normal = 0.3 + Ammo DR Modifier = -0.2)


Given the above, I was wondering why the formula should not look like this:

damage=floor(((base_damage*dam_mult/dam_div)-dmg_tresh)*(1-ammo_dr_adj)*(cbt_diff_mod/100))
if damage<0 then damage=0

I think for this formula to work properly, there may have to be a condition prior that states:
if ammo_dr_adj>=1 then ammo_dr_adj=0

Then the prototype files could be adjusted to work with the formula and create better game balance.

Thoughts?
 
Back
Top