Jump to content
  • 0

[3.02] -Infinity bug is still active


Kregan

Question

12 answers to this question

Recommended Posts

  • 0

I have the same thing on damage taken. (it was a normal value, and only around level 14 it has changed to -infinity)

Edited by MaxQuest
Link to comment
Share on other sites

  • 0

I just had this bug happen to me... twice. I do have three fighters who just dinged level 15, and specced them all in Triggered Immunity. One fighter got the bug during a fight vs 3 adragans and a few beetles, another got it after the Sky Dragon fight. All within a few minutes of each other.

 

I reloaded the save from when I levelled up, specced the two fighters with triggered immunity, walked west to the temple of hylea and recklessly charged the Adragans from before (the ones in front of the passage to the sky dragon) with only my three fighters, monitoring their damage taken stat. One of them suddenly became -Infinity. So it's semi-reproductible this way.

 

Save file (from before the bug):

https://www.dropbox.com/s/3vfewgt6mj758bb/97d0683b1c7e40ef82b64784381f55ce%2032420309%20Northweald.savegame?dl=0

 

Output log:

https://www.dropbox.com/s/05q5imjo4rjq0x9/output_log_bug_infinity.txt?dl=0

 

 

Link to comment
Share on other sites

  • 0

I've poked through it a bit, can confirm that it is definitely related to Triggered Immunity (and Immunity in general). I could easily reproduce it with Esajin's save: gave the three Fighters Triggered Immunity, charged into the Adragan + Adra Beetle cluster in front of the Hylea temple and had them stand there doing nothing getting hit, continuously checking the character sheet page. A big Shocking Blast from one Adra Beetle to get Triggered Immunity: Shock, followed by a second Shocking Blast from another Adra Beetle was enough to get 'Damage Taken' to -Infinity. 

 

The problem seems to originate in the CharacterStats.AdjustDamageByDTDR_Helper() function. Among other things this calls the CalcDT() function to compute the damage reduction; key is that this function will return +Infinity if the character is immune to the damage type in question. A couple of lines later the damage amount X is reduced by the DT value, and thus X will become -Infinity if the character is immune to the damage type. The function does check whether DT is +Infinity and sets the IsMin flag and triggers the "Enemy is immune" notice, but it leaves X at -Infinity. At the adjusted damage X is returned to the calling function, to do with it as they will. Clearly most functions that use this value do check whether it is negative and set it to zero if so (you don't see +Infinity Endurance as a result, and the combat log also shows the damage amount being done as 0.0 when immune). But apparently the character sheet logging function doesn't, resulting in this bug. 

 

My suggestion would be to either a) set X to zero if DT is found to be +Infinity or b) check whether X is smaller than zero right before the return statement, and set it to zero if it is (or equivalently, just do "return max(X, 0);"). Option a) would be sufficient though, since the minimum damage value cannot become negative, and will replace any negative X if the DT is not +Infinity.

  • Like 1
Link to comment
Share on other sites

  • 0

@Obsidian Why is immune not plain zero in the first place? Some of your coding choices are out of my comprehension.

 

I certainly concur with the latter sentiment, though in this case setting "Immune == Infinite DT" is not unreasonable. The alternative would be to set an additional vector of "is immune" flags by damage type, and check those separately. You'd still want to do that at the DT/DR computation and/or reduction stage, rather than at initial damage computation, since that's a nice funnel where anything damage-y ends up. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...