Jump to content
  • 0

[3.02] -Infinity bug is still active


Question

12 answers to this question

Recommended Posts

  • 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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...