F2: new change to the damage calculation - hopefully a fix

Discussion in 'Fallout General Modding' started by Glovz, Jun 9, 2010.

  1. Haenlomal

    Haenlomal It Wandered In From the Wastes

    178
    Sep 25, 2003
    Thanks. :)

    I've finally looked at your changes. My only comment is that in HtHDamageFix1b(), the line:

    Code:
    shl eax, 2;
    multiplies the rank by 4 instead of 2, so each rank now receives a +4 bonus instead of the expected +2. I'll fix that as well as add some documentation to help me keep track of stuff.

    Other than that, though, thanks for spotting my error and fixing it up! :lol:

    Cheers,

    -- The Haen.
     
  2. Timeslip

    Timeslip Water Chip? Been There, Done That
    Modder

    921
    Aug 15, 2007
    eep. My turn to blame late night asm-ing. :oops:
     
  3. Nevill

    Nevill First time out of the vault

    85
    Mar 14, 2007
    Glovz, I've re-examined your first post and would like to ask: is it true that with the new formula Psycho pain-reducing effects are directly affected by DT of the armor you wear? Does that mean that the drug is almost useless while wearing no armor or Leather Armor? Does that mean that Toughness perk becomes obsolete?

    Can you please add a chart for Plasma/Pulse weapons? The fix is good in relation to normal weapons, but energy ones already dealt a good amount of damage in vanilla. Will Tesla Armor be really as effective as it should have been against these weapons? AFAIK, it doesn't have a DT of Power Armor and DT is all that matters with the new formula.
     
  4. Glovz

    Glovz Vault Dweller
    Modder

    736
    Sep 16, 2005
    Hi Nevill,

    Nothing in the code that was changed touches Psycho or Toughness, if either of these adjust the values of DR or DT it happens before those values are used in the modified code.

    I will add Plasma and Pulse soon, with the addition of Tesla Armor - though I must remind you, the change was meant to fix a bug which at the same time may or may not have adjusted balance favorably. For the most part I believe it has, but game play testing is needed.

    I'm hoping once RP 2.1 is released; and if killap offers the Fix in the installer, that feedback on balance will be reported by players. This will help decide if I need to release a mod for ammo, weapon, and armor proto files - also with critters adjusted to reflect any changes in armor.

    EDIT:
    I do understand your point though about the dependence on DT and what happens when you have no armor. I will have to give this some thought.

    If you are thinking specifically about unarmed/weapon melee then it might be possible to add a check and change the calculation specifically for that circumstance, but I'm not entirely sure that is a good thing.

    Like I said, it will need more thought.
     
  5. Nevill

    Nevill First time out of the vault

    85
    Mar 14, 2007
    What I am thinking is the will be no difference in regard to damage dealt to lightly armored characters when it comes to Psycho and Toughness, both of which increase only DR, not DT.

    To avoid the issue we might do one of the following:
    - Tweak Psycho item and Toughness perk (and Tesla Armor) so that they would increase DT a bit. Not a good idea since it requires changing things other than the damage formula, and that is what your fix is trying to avoid.
    - Tweak the formula so that DR close to 100% would halve the damage (compared to DR 0%). Perhaps random damage value needs a multiplier of (1-(ADR+RM)/200)? Of course the second part of the formula where the damage is further reduced would require tweaking as well. This will - hopefully - take care of the Tesla Armor problem as well.

    A chart for a PC that has extra 50% of DR from Psycho would be nice.

    Here it is for 10mm Pistol with 10mm JHP Ammunition:
    Code:
    Fixed formula, No extra DR           +50 extra DR                                   
    	  0	 2	 4	 5	12	15	   	  0	 2	 4	 5	 12   15
    RD	0	25	30	40	40	55	   RD	50	75	80	90	90   90
    ---------------------------------------------------------------------
    5	 7	 3	 0	 0	 0	 0	   5	 7	 1	 0	 0	 0     0
    6	 8	 4	 0	 0	 0	 0	   6	 8	 2	 0	 0	 0     0
    7	 9	 5	 1	 0	 0	 0	   7	 9	 3	 0	 0	 0     0
    8	 10	6	 2	 0	 0	 0	   8	 10	4	 0	 0	 0     0
    9	 11	7	 3	 0	 0	 0	   9	 11	5	 0	 0	 0     0
    10	12	8	 4	 1	 0	 0	   10	12	6	 0	 0	 0     0
    11	13	9	 5	 2	 0	 0	   11	13	7	 1	 0	 0     0
    12	14	10	6	 3	 0	 0	   12	14	8	 2	 0	 0     0
    
    As you can see, there is little to no difference with light armors. It is even less noticeable with AP ammo:
    Code:
    Fixed formula, No extra DR           +50 extra DR                                   
    	  0	 2	 4	 5	12	15	   	  0	 2	 4	 5	 12   15
    RD	0	25	30	40	40	55	   RD	50	75	80	90	90   90
    ---------------------------------------------------------------------
    5	 6	 4	 2	 1	 0	 0	   5	 6	 4	 1	 0	 0     0
    6	 7	 5	 3	 2	 0	 0	   6	 7	 5	 2	 0	 0     0
    7	 8	 6	 4	 3	 0	 0	   7	 8	 6	 3	 1	 0     0
    8	 9	 7	 5	 4	 0	 0	   8	 9	 7	 4	 2	 0     0
    9	 10	8	 6	 5	 0	 0	   9	 10	8	 5	 3	 0     0
    10	11	9	 7	 6	 0	 0	   10	11	9	 6	 4	 0     0
    11	12	10	8	 7	 0	 0	   11	12	10	7	 5	 0     0
    12	13	11	9	 8	 0	 0	   12	13	11	8	 6	 0     0
     
  6. killap

    killap Bear Dude Moderator Modder

    May 16, 2005
    I'm hesitant to include multiple ammo tweaks in the installer. I know what some of you might think, no harm in giving the player the option. Oh, if only that were the case... We'll see what I do. It's not like it's hard to enable the tweak anyway.
     
  7. Glovz

    Glovz Vault Dweller
    Modder

    736
    Sep 16, 2005
    @Nevill
    I not sure about the change you suggest as it may make things more unbalanced and your chart is slightly off.

    But I was thinking, to give DR more of a chance to reduce damage when no DT exists ONLY, how about:
    RR = Random(0,((ADR+RM)/10))
    ND = ((RD+RB-(RR*X/Y)+X)*CM/2*CD/100)

    I still have to play around with this idea but it seems promising.
     
  8. Nevill

    Nevill First time out of the vault

    85
    Mar 14, 2007
    I told you it needs further tweaking. :) The idea is that DR should influence the damage without relying on DT. The purpose of your new change seems to be the same. I think it shouldn't be limited to DT=0. Otherwise Psycho character in Leather will be more vulnerable than the one without armor. And what if you increased your DT with implants or on a boxing ring? You instantly lose the advantage (btw, it is currently possible for RR to reach as far as 9 - that's too much, considering it is then multiplied by X).

    I'm trying to find a formula that would stay close to your values under normal circumstanses while drastically reducing the damage when DR is high enough.

    And how come that my chart is off? I did not calculate this manually, you know. :)

    P.S. The more I look at it, the more I think that tweaking two items and a perk would be much easier. Let them add +2 to DT and the problem is solved.
     
  9. Glovz

    Glovz Vault Dweller
    Modder

    736
    Sep 16, 2005
    @Nevill
    Your chart is off because you failed to take into account that the 10mm JHP ammo adds 25. So when you have a critter with no armor and you are using 10mm JHP, ADR+RM is 0+25.

    Add Psycho and you get 75, and using my formula as it stands the damage would actually come out to 1 less from the values you listed in the first column. The 10mm AP ammo results remain the same.

    I'm against changing the perks, as you understand and I have stated, this is meant to be a FIX without other things being adjusted.

    And you are right, the random number could actually theoretically go as high as 10, but this is why I am unsure about the change.

    I am exploring this because while my formulas are not fully dependent on ADT (read the first post again, three of the formulas account for no ADT), a critter with ADR only is treated more severely with my fix than the original formula does.

    EDIT:
    The most reasonable change after playing more with the numbers seems to be multiplying (ADR+RM) by 2 before dividing by 100 ONLY when ADT = 0.

    Before I look into changing the code, any comments?
     
  10. Nevill

    Nevill First time out of the vault

    85
    Mar 14, 2007
    This will net you a bonus of -3 damage per hit of JHP bullet for a Psycho-ed character regardlless of the ammo you are using (assuming all JHPs add 25 to DR and X/Y=2). Not a terrible lot if you are facing something with a more punch than 10 mm Pistol. And the bonus from toughness is laughable, to the point of non-existence.
     
  11. Glovz

    Glovz Vault Dweller
    Modder

    736
    Sep 16, 2005
    If you have only one level of Toughness, 10 ADR on it's own should not offer much help, but add another level and it starts to.

    I think you are not considering that having only ADR should also not help as much as having armor on that has ADT and ADR.
     
  12. Nevill

    Nevill First time out of the vault

    85
    Mar 14, 2007
    In original, it used to negate 10% of damage. That is 1-2 pts. of damage from a single bullet. While not a lot, it at least offered something. And now? Even 90% does not offer sufficient protection, much less 10%.

    Damage resistance should directly reduce damage. There is a reason it was capped at 90% - because a character with DR at 100% was supposed to be invincible.
     
  13. Glovz

    Glovz Vault Dweller
    Modder

    736
    Sep 16, 2005
    @Nevill
    A main point of this FIX; outside of the issue with AP ammo, is that damage resistance had way too much affect on damage and thus scewed everything. I much prefer modifying the damage calculation then to assume all proto files are incorrect and to modify all of them.

    I think we have reached the point where we have to agree to disagree.

    I am still weighing whether or not I will make a final change, but if I do it will be close if not exactly what I have mentioned previously.
     
  14. pelicano

    pelicano It Wandered In From the Wastes
    Modder

    129
    Jun 14, 2008
    I'm looking forward for this fix. It will be good to have the combat damage calculations "corrected" without going through proto editing.

    Honestly I'm a little confused about all these ammo/damage fixes. Appearently they all try to tweak the combat damage to reasonable levels (fixing AP bug and whatnot). I thought Haenlomal's YAAM was pretty spot on but this is looking good as well.
     
  15. gurachn

    gurachn First time out of the vault

    13
    Jun 21, 2010
    It occurs to me from looking at the comparison between JHP and AP 10mm that there is a slight problem ballistically.
    JHP ammo should actually do significantly more damage to lightly armored targets than AP due to the increased energy transfer of the expanding hollow point.
    I suggest altering the numbers to reflect this.
     
  16. Glovz

    Glovz Vault Dweller
    Modder

    736
    Sep 16, 2005
    Hmmm...
    The FIX already allows for an increase from the weapons raw damage; ex. a minimum raw hit of 5 is increased to 7, also take into account this is without the hit being a critical or any range bonus being applied. If you compare this to the original numbers you will see the FIX is not far off.

    Although this may only be my opinion, the JHP ammo was over powered before given the damage calculations over emphasis on the ammo's X/Y modifiers.
     
  17. gurachn

    gurachn First time out of the vault

    13
    Jun 21, 2010
    Sorry, I can't comment on the changes to the formula, but I do know that against un/lightlyarmored targets Jacketed Hollow Point ammo should do more damage than AP. It is specifically designed to expand and/or fragment in order to impart maximum energy to the target. AP is designed not to mushroom on contact and is more likely to penetrate with much tighter wound channels.
    The disadvantage of JHP is that it has lesser ability to penetrate body armor, which is were AP will start to show greater damage.
     
  18. Glovz

    Glovz Vault Dweller
    Modder

    736
    Sep 16, 2005
    @gurachn
    The difference between the two ammo types is understood well.

    What I think some are having a hard time understanding is that the proto files for weapons, ammo, and armor are not optimal.

    So this FIX, while addressing the calculations and IMO improving them, may also be exposing further the balancing issues that exist within the game as well.
     
  19. Lexx

    Lexx Testament to the ghoul lifespan
    Moderator Modder

    Apr 24, 2005
    Are critical hits like this still possible with your fix?



    First I've made an aimed shot at the eyes, which made no damage. In my next turn, I've made an aimed shot at the head and instakilled the critter with a critical hit (leather jacket resistances in the proto file).

    Now I wonder, if this was an "accident" or some other bug in my files, because after this, I moved to some other city and my sniper rifle transformed into a wall tile, which was something I've never seen before...
     
  20. Glovz

    Glovz Vault Dweller
    Modder

    736
    Sep 16, 2005
    @Lexx
    There should be no chance of crazy critical hits due to my FIX. But there are other areas I believe that have been modified that possibly could pass bad critical hit value, such as the critical hit tables.

    Be sure you are using the latest release of sfall, my older mod was flawed.

    The changing of your rifle into a wall would seem to mean a possible bug where the wrong proto list is referenced. But that's just a guess.