My attempt to fix FO2 damage formula ("Vanilla+" Ammo Mod)

Discussion in 'Fallout General Modding' started by phobos2077, May 22, 2023.

Your DamageMod of choice

  1. Vanilla

    18.2%
  2. Glovz

    18.2%
  3. YAAM

    18.2%
  4. FO2 Tweaks

    18.2%
  5. Other

    27.3%
  1. phobos2077

    phobos2077 Vault Dweller
    Modder

    708
    Apr 24, 2010
    It has become a community tradition for people to take their shot at Fallout damage calculation, to fix that AP ammo issue, among other things. So here is my attempt...

    How I got to this

    I had a mod called EcCo that I was working on around 2012-2015. Because I decided I want more "realism" and also to have player choose between ammo types instead of defaulting on one, I somehow settled on YAAM formula. The way it addressed armor in terms of "armor defense class" vs bullet penetration clicked for me, because I was a gun/ammo nerd at that time, also playing and modding STALKER. But I understood that I needed to make some changes to armor and ammo values, to make them work with YAAM. I remember using some spreadsheet for calculations, most likely based on the one included in YAAM itself.

    Then gradually the development of the mod grinded to a halt, but I continued to receive a lot of criticism, some of that related to damage being either to high or too low in different situations. I had some spreadsheets, but I guess they weren't informative enough after all the edits I've made across weapon, ammo, armor and critter prototypes. So I've had a task on my TODO list of exporting all this data from proto into some kind of table format that I can then analyze...

    This task had to wait 8 years. Recently, I've started to work on the mod again, and I always remembered I need to take a close look at the damage output, to make sure it actually works as I intended originally. I was about to start writing a script to read and export prototypes, when I stumbled upon this feature already present in Mr.Stalin's Proto Manager. So I took that and started building my Ultimate Damage Spreadsheet™.

    Couple of days of work fiddling with numbers revealed a few issues:
    • Some weapons do very little damage to end-game armor. To counter this I can either buff ammo DT value or nerf armor DT values even further, which require to go even further into "custom values" territory. Not ideal.
    • Ammo with high DT ignore most of the game's armor completely, like it's not there.
    • The number of combinations of different formulas, weapon stats, ammo stats, made it very cumbersome to work on damage calculations in a spreadsheet format. I needed something better.

    What's on the market

    Naturally, if I want to switch formula again I need to study what options already exist. You already know what they are, so here's my take on them:

    Glovz:

    • Seems to be the most popular nowadays.
    • An enigma. Written by a mad man.
    • Designed around vanilla stats. Not flexible enough for my taste.
    • Seems to do it's job of making AP ammo not suck.
    • Has wild damage increases against early armor, even for AP, which I find questionable.
    • JHP doesn't seem to have much benefit. It makes AP always a better choice, if you can afford it.
    YAAM:
    • Easy to grasp (at least for me).
    • Makes sense in terms of bullets penetrating certain types of armor.
    • Doesn't work well with vanilla armor stats. They need tweaks, ammo changes are not sufficient.
    • Ammo stats probably need tweaks as well (hence why EcCo 0.6 had completely custom stats).
    • Does a good job of making both AP and JHP ammo viable, depending on target.
    • AP ammo is "too good" against early armor, there's no damage reduction, like it's not there. Maybe it's "realistic", but questionable for game.
    • All ammo, AP or JHP equally suck against high-DT target. You'd have to reduce max DT quite a lot across the entire game to make it work.
    Burn's (aka FO2 Tweaks):
    • Fully script-based, unlike all above (uses sFall hook scripts).
    • Ties everything to a single ammo parameter (cannot set dmg div/mod separately from DR Adjust).
    • Doesn't really achieve it's stated goal (based on my calculations): AP ammo sucks less but still sucks.
    • Has some novel ideas like "probability rounding" and every bullet in burst "rolling" their own critical.

    Numerical approach

    So, inspired by FO2 Tweaks script, I got to work. I took example damage mod included in recent Modderspack as a starting point - repeating vanilla formula 1-to-1 in script. Then, I implemented YAAM formula there, with a few changes (probability rounding and critical bursts nerf). It all worked well enough, sfall is amazing!

    But I thought now that I can do whatever formula I wish, I need to at least take a shot at it. I can always default back to my modified YAAM if I fail. So I decided to take a step back, and try to fully understand how original formula behaved, what exactly was wrong with it and if it's possible to improve it with minimal changes.

    But I needed a better visualization tool for that. So I spent 2 days freshening up my JS skills and came up with this damage calculator tool. It really helped to confirm what I already saw in spreadsheet. You can try to apply physics and realism to FO damage formula however you want, but it all comes down to numbers:

    • DT "soaks" damage and disproportionally affects lower-damage weapons, such as most early guns, miniguns, etc. I think about it as "how much energy can armor itself take without damaging the wearer". It's not just penetration.
    • DR "scales" damage and disproportionally affects higher-damage weapons. I think about it as "deflection" of bullets, laser rays, etc.
    • Ammo DR Adjust affects high-dmg weapons, because it only deals with DR. My guess is this was (as most other things) done intentionally by devs, otherwise they wouldn't bothered with 2 armor parameters instead of one. But maybe they didn't have time to fully dig into implications of this for all weapons.
    • DMG mod/div is just a multiplier. BUT, because it changes the damage curve differently than DR Adjust, you can change both in relation to each other to not just scale damage but change the steepness of the damage curve! Also because DT is applied after this multiplier, JHP ammo in vanilla will overpower armor DT easily and AP can't compete with that, especially for low-dmg guns. THIS is the reason why vanilla AP ammo suck.

    Vanilla+

    I came up with an idea. Let's take vanilla formula as is, but introduce a few changes from other formulas:

    1. Apply DT before ammo damage multiplier, not after.
    2. Reduce DT along with DR with ammo's DR Adjust parameter. There are two versions of this:
      1. Use addition based on DR Adjust and some fixed multiplier, like 1/10. So a DR Adjust = -20 means -2 DT. If DR Adjust is positive, separate multiplier can be used, like 0 to not ever increase DT.
      2. Use multiplication. Basically -20 DR will also reduce DT by 20%. This will work for low DT values as well, if we do all calculation in floats and round at the very end. Like (1), separate multiplier for positive direction can be used, to make high-DR ammo curve steeper.
    Writing this formula (in 2 versions) into my tool, reverting armor stats to close-to-vanilla values and configuring DR Adjust for ammo in my mod, revealed these properties:

    • (1) allowed to use high dmg mult/div ratio without ammo overpowering ammo DT. This effectively turns JHP ammo damage curve downwards against later armors.
    • DR Adjust and DMG ratio still balance each other to some extent, but allow to change steepness of the curve (high DR adjust -> steeper damage falloff). This allows having higher starting damage for early-game calibers that falls off quickly, but more straight curve for mid-game ammo types.
    • Ammo with high DR Adjust value now does much better job at penetrating armor, especially with base damage. This effectively solves "AP sucks" issue.
    • 2 variations of formula have different implications:
      1. With addition, you get behavior similar to YAAM. AP ammo will have a fairly flat damage (rip through early armor) up until certain point (based on their DR Adjust), then fall. But not as quickly as with YAAM (because unlike YAAM, DR is always affected).
      2. With multiplication, you get more "vanilla" (or Glovz-like) behavior - the curve is more or less uniform and overall not as steep. Armor will always give you some protection, even against AP ammo. But AP ammo will still dominate against JHP. Against top armor this option gives better damage.
    • Ammo with dmg ratio of 1 and DR Adjust >= 0 will behave exactly like vanilla.

    At this point, I feel pretty good about this formula. I'm leaning towards version with multiplication and already adjusted stats of my mod to use it. Will of course need playtesting.
     
    Last edited: May 23, 2023
    • [Rad] [Rad] x 4
  2. phooey

    phooey First time out of the vault

    5
    Apr 12, 2023
    IMHO, there should be the third version of this if it's possible. That is, subtraction for AP and multiplication for JHP.
     
    • [Rad] [Rad] x 1
  3. phobos2077

    phobos2077 Vault Dweller
    Modder

    708
    Apr 24, 2010
    This was my initial thought - to use New Vegas approach where JHP ammo multiplies DT. But if you think more about it, it won't work in FO2 very well. At minimum, you'll have to make sure there's always FMJ where there's JHP and that FMJ is the default. You won't see enemies in NV firing JHP at you? Otherwise you break the game - enemies won't be doing any damage to you once you get to metal armor. But I still wanted to use positive DR Adjust for reasons described in the OP, without making such ammo useless.

    This is valid approach of course if you want to make a more comprehensive weapon expansion mod with 3 ammo types per caliber. For EcCo, my goal is to entertain the idea of minimalist approach. Only add the bare minimum needed to fix issues with balance (I probably violated that rule in previous versions, oh well...). I don't want to clutter player's inventory with too many ammo types. If you think about vanilla calibers, you'll see that mid-late-game weapons don't have JHP. 14mm, .223, 7.62, etc. This makes sense because at the point where you get to these calibers, you won't be seeing a lot of enemies with low DR/DT (only random encounters, I guess).

    The beauty of scripted formula is you can change it however you want, all you need is Sfall Script Editor and some basic coding knowledge. And you can use my tool first to verify your formula.
     
  4. phooey

    phooey First time out of the vault

    5
    Apr 12, 2023
    The minor issue with formula number 1 is it gives protection bonus to unarmored critter if DR modifier is positive where multiplication formula doesn't do that. Maybe you can make DR/DT adjustment only applies to armored critter whether it's formula 1 or 2.

    Well, in EcCo setting which has harsher penalty for loot, you always wanna add surplus ammo type for early-mid game weapons. Just my 2 cents.
     
  5. phobos2077

    phobos2077 Vault Dweller
    Modder

    708
    Apr 24, 2010
    Actually in both versions, I only reduce DT, I forgot to mention that. To be precise, there are 2 multipliers for each formula, for positive and negative direction. Addition version doesn't work well in positive direction, so I always keep it at 0. With multiplication, you can get some interesting results, but for now I also keep it at 0.

    So what you want to do is very easy (just change a couple of line of code), but I won't be using that, for now. I look at the damage curves first and change tweak formula/values until I get what I want and for now I like what I see.
     
  6. phooey

    phooey First time out of the vault

    5
    Apr 12, 2023
    That I agree. DT should never be increased, only reduced. I always think DT as analogue to armor thickness in millimeters. So to make its thickness increased while getting hit by JHP is weird. DR is different story though, it can be thought as the armor's ability to deflect bullet while getting hit with standard ammo, so it is expected to get increased or decreased when getting hit by JHP or AP.

    Anyway, good luck with the scripting and really looking forward to version 1.0 of you damage mod.
     
    • [Rad] [Rad] x 1
  7. phobos2077

    phobos2077 Vault Dweller
    Modder

    708
    Apr 24, 2010
    Thanks. After days of calculations I finally implemented that in my damage script. Seems to work as expected, but I'm still torn between the 2 formula versions. I guess I'll decide during play test.

    Currently it's part of EcCo, but you can just take it and use it with any mod. It is configured via ini.
     
  8. phooey

    phooey First time out of the vault

    5
    Apr 12, 2023
    I suggest to keep both. Me personally, I like formula no.1 more. But others might find formula no.2 more compelling.
     
    • [Rad] [Rad] x 1
  9. Slaughter Manslaught

    Slaughter Manslaught Vault Senior Citizen

    Dec 11, 2006
    An interesting formula idea. I would have to do the hard math then play first to properly comment.

    Any chance you can take a look at Criticals in the future? More specifically, a related problem is that Fallout has too many Armor Bypass criticals. Josh Sawyer talks about how in Van Buren he wanted a lot less full armor bypasses and a lot more partial bypasses in the future.
     
  10. Timez

    Timez First time out of the vault

    84
    Feb 12, 2019
    Good one! Thank you for posting. Can it be applied by itself to 1in2 without RP?
     
    • [Rad] [Rad] x 1
  11. phobos2077

    phobos2077 Vault Dweller
    Modder

    708
    Apr 24, 2010
    You can definitely try it. I tried to make damage script as independent as possible. You can take gl_pbs_damage_mod.int and combat.ini from the latest EcCo release (or compile yourself from source), configure it how you like and try using in another mod by itself.
     
  12. bratmanntoffel

    bratmanntoffel First time out of the vault

    28
    Nov 17, 2015
    Dear @phobos2077, I'm a great Ecco Mod lover and want to share my oppinion (and mod setup) for the game.
    I started to use the Fallout 2 Weapons Redone Mod before your's and came to very satisfying results by using the vanilla damage formula and just tweaking weapon, ammo and armor stats accordingly. Here is an example spreadsheet of my personal Ecco Mod 0.6.3b setup, expanded by some weapons and ammo.
    I didn't draw graphs however, but as you can see, every weapon smoothly traverses from JHP-like to Armor piercing around the Leather MK2 to Metal border which I persoanlly found realistic. While the border of JHP-to-AP transition may be open for dispute, it proves that a reasonable and steady JHP-to-AP conversion is achievable just without changing the damage formula. As you already mentioned every other damage formula has its flaws and, with all the respect, even your newly invented Ecco 0.9+ formula has some quite sophisticated DT-calculations (which makes adding new weapons or changing balance quite difficult).
    I'd like to keep it simple and gently hope, that this easy approach might find it into your new Ecco version by chance.
    Loving your work and kind regards

    Damage Stats Ecco 0.6.3b modded A.jpg
    Damage Stats Ecco 0.6.3b modded B.jpg

    Legend:
    weapon stats are dmg mult and dmg mod
    red armor fields are changed values from vanilla
     

    Attached Files:

    Last edited: Sep 4, 2023
  13. bratmanntoffel

    bratmanntoffel First time out of the vault

    28
    Nov 17, 2015
    For the ridiculous critical-damage-while-bursting-problem I used following approach, which I find quite simple but effective:

    As critical hits are often converted into armor piercing everyone knows that JHP ammo benefits the most and can create ridiculous amounts of damage up to several thousands. AP cannot so this is truly a flaw, making JHP superior in these moments.

    my approach is to edit the CriticalOverrides.ini (can be found in the sfall modderspack) to remove (yes, remove) the armor piercing effect at all from all the concerning entries BUT adjusting some damage multipliers accordingly to account for a progresion in critical severity steps. Also I did some edits to the coresponding combat.msg to change the concerning combat messages.
    In doing so I did a complete review for all critters, fitted some inconsistencies, did some balancing (especially for regions which are more difficult to hit like groin while nerfing torso damage multipliers) and also streamlined some check modifiers (more weighting endurance).
    For all changes I attached my complete modified INI below.

    In my personal oppinion just having a damage mult progression in addition to upscaling crippling effects is rewarding enough for critical hits.

    EDIT: ! After testing I realised that the expample for the damage multiplier provided in the template from the sfall modderspack is WRONG. So instead of DamageMultiplier=100 it should be DamageMultiplier=1. I re-uploaded the corrected .ini-file on 15.Sept.23

    Expamles:
    Critical Hit Table Examples.jpg

    Critical Hit Table Examples Groin.jpg
     

    Attached Files:

    Last edited: Sep 15, 2023
  14. phobos2077

    phobos2077 Vault Dweller
    Modder

    708
    Apr 24, 2010
    In what way does it make it difficult? It's basically vanilla formula with a tweak. There are no "sophisticated" calculations, they are trivially simple. And you can adjust ammo effect on DT via ini however you like. There are separate options for positive or negative values. After playtesting through about 60% of the game, for me the question of damage formula and ammo balance is closed for now. I don't see a reason to reevaluate it as what's in the mod now feels perfect for me.

    Idk, for me the current script is simple enough and achieves desired outcome. I don't see a reason for going back and re-evaluating a solved problem when there are so many unsolved things on the todo list.

    Feels like nobody's interested in actually playing this game anymore, everyone's just modding it. Or people who play it don't write much. In any case, I'd suggest to actually try the latest version and get a feel for it. I generally dislike feedback that tells me "what" and "how" I should change, instead of describing what was the play experience that lead you to these ideas. Everyone's approach to design/code/modding is different. But what matters is the result - player experience.

    I mean, if it's fun for you to solve the same problems others have solved, but with your twist - go ahead. I'm fine with that. But if you're giving feedback on the mod, please focus on the things that you think aren't working and why they aren't working, and then let me think about it and find my own ways to solve it using the tools available to me. I'm fine with implementation ideas as well, but when they are a supplement to the main idea of feedback (something not working, bad experience, etc.).
     
    Last edited: Sep 4, 2023
  15. phobos2077

    phobos2077 Vault Dweller
    Modder

    708
    Apr 24, 2010
    Thanks for sharing. I'll keep that idea in mind. Since the whole damage calculation is in script, maybe penetration effect can adjusted in some cases to be less than 80%. You're not the first one to say it's too high. But keep in mind there's also a new "only 50% of bullets crit in a burst" feature in the script.
     
  16. bratmanntoffel

    bratmanntoffel First time out of the vault

    28
    Nov 17, 2015
    Fair enough. I highly value your decision to base your mod on the vanilla formula. I must admit that I did't had the chance to look into your new 0.9+ mod files. Especially the option to tweak or disable the DT calculations seems to be an optimal solution, making it optional.

    I also noticed your decision for having criticals only effect partially while bursting. It's just that the whole topic might not be finally settled even with this approach.

    May I ask a final question?
    I noticed that you put a lot of effort into a new barter formula. As I took the time to modify your old one towards the goal to account smoothly up to 300 barter, while at the same time making it possible to start having profitable trade routes for the PC between cities (starting with ~ 100 barter) by adjusting the demand modifiers, also improving the weighting of CH (+5 CH raises like +30 barter)...

    (price ratio (buy:sell) escalates from Klam to San Fran in reasonable (blance-wise: hard) way:
    8:1(KLA) to 15:1(SF) with barter=0, 3:1(KLA) to 5:1(SF) with barter=100)

    Does your new formula have these traits?

    Would be a shame if after having read the Fallout 2 Hintbook, giving 300 in all skills, or just raising barter to extreme levels would produce odd results (either breaking the buy:sell ratio or just reaching an artificial plateau or something..)
    For the buy:sell ratio itself I noticed that your most recent decision seems to be to lower the gap between buying and selling at lower barter, right?
     
    Last edited: Sep 4, 2023
  17. phobos2077

    phobos2077 Vault Dweller
    Modder

    708
    Apr 24, 2010
    You should probably write to appropriate thread, this is about damage formula. But anyway...

    I decided to keep price ratio low with the new balance so the player doesn't feel disincentivized to actually buy stuff, like good armor or weapons. But instead, it should feel like an achievable goal and selling prices should feel "fair". That was my goals, and based on your description I'm not sure what was yours.

    As to profitable routes, I aimed at being able to make profit around 100 barter or more, but only with certain items (like Jet). I dialed down town-based modifiers quite a bit as they didn't feel right for a normal non-trader playstyle. Maybe I will do a trader run someday and add tweaks to allow for more trade routes. But I strive for a minimalist approach in my mod: so maybe 1 or 2 additional wares that make sense to do a few trade runs when your skill is very high, to make enough money for whatever you need. But player also needs to have incentive to spend the earned money somehow.

    If you are a combat character, you will have enough money from loot either way, to buy ammo, drugs and occasional weapon or armor. For a non-combat player, there's really no incentive to earn money in the game (that I can think of). And if you're both combat and trader, then you're getting loot anyway, so what's the incentive to spend time doing trade runs? For me it's more like a small side activity. And town demands are more about giving reasons for player to travel around (and burn that extra fuel that is more scarce now, so you have to consider it as an additional expense..), when you got a bunch of pelts or hides but want to make the best value selling them - more interesting decisions to the player. It's not about playing as the actual trader. You're still an adventurer, a chosen one saving Arroyo. And money are just a means to that end... Maybe if there would be some end-game money sinks... But I'd still don't want to turn the game into Freelancer where there are traders who sell hundreds of items (instead of usual 1-5, maybe 10) and others with tens of thousands of caps (so you can actually sell that much).
     
  18. bratmanntoffel

    bratmanntoffel First time out of the vault

    28
    Nov 17, 2015
    Well you are right. This thread is about the damage formula. Forgive.

    But to answer your question, my goal is similar to yours "to make non-standard builds more viable (Barter, Throwing, Melee, Repair, etc.)".
    With enabling trade runs a diplomatic character (trader, doctor, talker, pacifist, ...), maybe with some companions, could be quite entertaining. For this I would aim (and did so in my modifications) for lore-friendly goods and routes like hides and meds between low tech areas and VC or drugs to New Reno or gold/uranium between cities. Even this character would need the money for ammo and weapons for his group and such. As for the money floating problem itself my personal approach is to remove most of the money on guys in random encounters in addition to like 50% weapon destroy chance, but thats another thing.

    But apologies, back to the damage formula :)
     
    Last edited: Sep 4, 2023
    • [Rad] [Rad] x 1
  19. bratmanntoffel

    bratmanntoffel First time out of the vault

    28
    Nov 17, 2015
    One more thing about the ammo modifiers.
    I came to the conclusion that while AP is mostly more effective, it becomes superior when also reducing targets AC. This leeds to the situation when it becomes the better choice even against soft targets with its ability to enhance hit chance. Also this situation is most relevant in the beginning of the game, when weapon skill is low. With this I decided to reduce all -AC modifiers from AP ammo except some shotgun, flame or explosive ammo.

    Maybe you might consider this too? I think the game might benefit more if some ammo wouldn't get obsolete very quick.
    Would make the game a bit harder though, but mostly at the end. Also have to carefully check NPC hit chances. But as you already lowered AC of higher tier armor this shouldn't be an issue.
    Just consider with Power Armor and Adv. PA having AC between 21-26 shooting with AC-reducing AP ammo of -10 to -30 makes skill progression a bit obsolete doesn't it? Just because I penetrate shouldn't mean I hit better...

    I am aware that the fallout damage system has a somewhat weird approach with AC "armor class" being both -armor and evasion, and maybe trying to simulate a damage reflection of some sort. And AP ammo breaking armor and therefore reducing AC to overcome this deflection.
    But this mixup has its flaws as I tried to point out, especially regarding the game flow.

    When seeing the AC as a true evasion ability, also as a measure of the target's skill to avoid being shot, maybe because of utilising cover or estimate enemy behavior, it could be used to enhance enemy scaling through out the game. Imagine a soldier better experienced and trained in combat. With this an Enclave Soldiers might be the most difficult to hit. Maybe this could be employed with its armor AC value being high and no AC-reducing ammo but elevated skill necessary to overcome this?
    With armor progression in a linear way (so Metal Armor higher than Leather and Power Armor the highest) this behavior or ability could be simulated along game progression.
    While the only issue would be also effecting AC of the player, one could argue that player's combat experience might improve with the game flow too (by achieving higher tier armors, as they are accessable at semi-fixed stages of the game). :)
     
    Last edited: Sep 4, 2023
    • [Rad] [Rad] x 1
  20. phobos2077

    phobos2077 Vault Dweller
    Modder

    708
    Apr 24, 2010
    What do you mean by "-30". What ammo does that? In EcCo, most normal AP bullets on get to -10, while Buckshot is -15. But you made a good point about reduced armor AC. I had the same thoughts when balancing armor so tried not to go too far with it. Most notably, Metal armor has relatively low AC but higher DR/DT compared to vanilla for balance. I'll think about reducing ammo AC penalties even more.

    Interesting thought. But, being "harder to hit" is traditionally handled by your base Armor Class stat which is derived from Agility. Boosting this relation will make Agility stat even more OP as it is. Alternatively, maybe AC of NPCs wearing high-tier armor can be un-tied from armor item AC. This might keep skill investments relevant, but will also make game arguably unfair against the player. Which might be a non issue. I'll think about it as well, you raised a good point.

    (still has nothing to do with damage formula though)