Jump to content
  • 0

Stacking multiplicative bonuses doesn't work properly


Question

Posted

While testing some concepts revolving around hostile effect reduction, I ran into this unexpected issue. Stacking multiple instances of hostile effect reduction (through RES or otherwise) is done multiplicatively. This post will prove that there is an error in the game's calculation of that statistic.

 

I made a new character to prove that this mechanic was behaving unexpectedly. Here are the relevant stats of the character:

 

A8heWrl.png

 

INT is 10, which is noteworthy because I'm using Powder Burns to test (you can self inflict it, but its duration increases with INT, so I remove that factor with ant INT of 10). My RES is 25, which provides a baseline hostile effect reduction of 45%.

 

To test, I fire a plain, non-unique Blunderbuss at an enemy and pause the game immediately after the Powder Burns debuff appears in the character sheet. For this test, expected value is 5.5 seconds, which is correct (10 sec * (1 - 0.45) = 5.5 sec).

 

GeeLojz.png

 

With Monk's ability Clarity of Agony, which provides 50% hostile effect reduction, we get these results:

 

m9OqqIC.png

 

This value is not correct (10 sec * (1 - 0.45) * (1 - 0.5) = 2.75 seconds, not 3.5 seconds.

 

This ring provides 35% hostile effect reduction when there are no allies nearby (that condition was satisfied for this test). It also provides +1 RES, which will be taken into consideration in calculation below (45% reduction from RES -> 48% reduction).

 

DPW5OK5.png

 

The weapon fire test provided these results:

 

Le5aZlF.png

 

The expected value is 10 sec * (1 - 0.48) * (1 - 0.5) * (1 - 0.35) = 1.69 seconds. Again the actual value is off by a significant margin. These results show that stacking hostile effect reduction (and likely other similar stacking bonuses) produces incorrectly calculated values.

 

The only test scenario that actually worked was the one where we only tested reduction from RES. Adding any additional sources of hostile effect reduction produced unexpected values. It seems that the way multiplicative bonuses are calculated is not correct when more than one of the same bonus is present. I highly recommend that this be investigated as a bug.

4 answers to this question

Recommended Posts

  • 0
Posted (edited)

The expected value is 10 sec * (1 - 0.48) * (1 - 0.5) * (1 - 0.35) = 1.69 seconds. Again the actual value is off by a significant margin. These results show that stacking hostile effect reduction (and likely other similar stacking bonuses) produces incorrectly calculated values.

That's because they are not factored in multiplicatively, but via double inversion.

 

The math behind this is:

step_sum = [1 - 1/(1 - 0.48)] + [1 - 1/(1 - 0.5)] + [1 - 1/(1 - 0.35)]

step_sum = [1 - 1/0.52] + [1 - 1/0.5] + [1 - 1/0.65]

step_sum = -0.923 + -1 + -0.538 = -2.461

 

final_coef = 1 / (1 - step_sum) = 0.288

 

So if default duration was 10s, it will get reduced to 2.88s.

Edited by MaxQuest
  • 0
Posted
That's because they are not factored in multiplicatively, but via double inversion.
 

The math works out, that's gotta be the reason. But it's kind of a misleading formula to use since there's no documentation anywhere (that I could find). Players will expect the multipliers to stack in a straightforward way unless mentioned otherwise. How did you find this out?

  • 0
Posted (edited)

The math works out, that's gotta be the reason. But it's kind of a misleading formula to use since there's no documentation anywhere (that I could find). Players will expect the multipliers to stack in a straightforward way unless mentioned otherwise. How did you find this out?

Yeap, while there are a few pros in current approach, it's indeed a bit confusing.

 

As for finding out, at first I have deducted the formula, and later found the related code in the decompiled source (as Boeroer has mentioned). During beta this was used mainly for attack speed calculations. Later, damage was calculated using these as well.

 

P.S. You can check Onyx/Math.cs and Game/AdjustedValue.cs for more info.

Edited by MaxQuest

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