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

  2. Glovz

  3. YAAM

  4. FO2 Tweaks

  5. Other

  1. phobos2077

    phobos2077 A Smooth-Skin

    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:


    • 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.
    • 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.


    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 2
  2. phooey

    phooey First time out of the vault

    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 A Smooth-Skin

    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

    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 A Smooth-Skin

    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

    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 A Smooth-Skin

    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

    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