Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoidance DR is working incorrectly #17

Open
magey opened this issue Jul 18, 2022 · 4 comments
Open

Avoidance DR is working incorrectly #17

magey opened this issue Jul 18, 2022 · 4 comments
Assignees
Labels
Bug Something isn't working right

Comments

@magey
Copy link
Owner

magey commented Jul 18, 2022

WotLK introduced diminishing returns on the parry, dodge, and miss avoidance stats. The specifics of how these diminishing returns work and what is the formula to calculate them was the subject of a big research effort on EJ by Whitetooth that's documented here.

  • DR for Dodge, Parry, Missed are calculated separately.
  • Base avoidances are not affected by DR. (e.g. Dodge from base Agility, 5% base Parry, 5% base Missed)
  • Death Knight's Parry Rating from base Strength is affected by DR.
  • Direct percentage gains from talents and spells are not affected by DR. (e.g. 5% Dodge from talents, 4% Parry to weapon, 25 Defense to weapon)
  • $\large c$ and $\large k$ values depend on class but does not change with level.

The DR formula:

$\Huge\frac{1}{x'} = \frac{1}{c} + \frac{k}{x}$

$\large x'$ is the diminished stat before converting to IEEE754
$\large x$ is the stat before diminishing returns
$\large c$ is the cap of the stat, and changes with class
$\large k$ is is a value that changes with class

He then gives a nice table that summarizes the $\large k$ , $\large C_p$ , $\large C_d$ , and $\large C_m$ values for all classes.


We1 went to test avoidance DR on the beta (build 44644) to see how accurate Whitetooth's formula and coefficients are, and to find any quirks in DR behavior. We used the exact same race / class / gear/ talent combination and attacked the same target on all the collected logs so that we can easily combine the data.

We used a level 70 Orc DK template and were attacked by a level 57 Servant of Razelikh. Due to the natural weapon skill / defense difference we had an additional (70*5 - 57*5) * 0.04% = 2.6% to parry, dodge, and chance to be missed that is not diminished by the DR formula. Fully geared the character had:

  • 283 strength which resulted in 73 parry rating from Forceful Deflection and an additional 15 parry rating from gear, totaling in 83 parry rating which translates to +4.04% bonus parry
  • 37 dodge rating which translates to +1.70% bonus dodge
  • 349 defense rating which translates to 147 defense, which in turn translate to 147 * 0.04% = 5.88% bonus parry, dodge, and chance to be missed

The breakdown and summary of these stats in table form (note that only the Bonus column is subject to diminishing return):

Base Level Bonus Total
Miss 5.00% 2.60% 5.88% 13.48%
Dodge 5.94% 2.60% 10.05% 18.59%
Parry 5.00% 2.60% 9.92% 17.52%

This is verified by the character sheet (note these screenshots naturally do not include the 2.60% from level difference):

image

Calculating the diminished values of these stats with Whitetooth's formula:2

$\large k = 0.956$
$\large C_m = 16$
$\large C_d = 88.129021$
$\large C_p = 47.003525$

$\Huge Miss_{DR} = \frac{1}{16} + \frac{0.956}{5.88%} = \frac{1}{0.225085} = 4.442765%$

$\Huge Dodge_{DR} = \frac{1}{88.129021} + \frac{0.956}{10.05%} = \frac{1}{0.106471} = 9.392196%$

$\Huge Parry_{DR} = \frac{1}{47.003525} + \frac{0.956}{9.92%} = \frac{1}{0.117646} = 8.500079%$

Using these diminished values in place of the raw bonus values from the table above, our expected avoidance values from the test are:

  • ~16.10% parry
  • ~17.93% dodge
  • ~12.04% miss

And finally our test results from combined logs of 17572 incoming attacks:

Outcome Chance 95% CI Count
Miss 13.52% ±0.51% 2375
Dodge 18.35% ±0.57% 3225
Parry 17.69% ±0.56% 3108
Hit 50.44% ±0.74% 8864

As this table demonstrates, avoidance DR simply isn't working at all; our measured values are within error margin of our raw total values and nowhere near the diminished values.

Footnotes

  1. Thanks to Char, deance, and Kilo for helping collect data for this test

  2. Rounded to 6 decimal digits for easy reading

@magey magey added the Bug Something isn't working right label Jul 18, 2022
@magey magey self-assigned this Jul 18, 2022
@magey magey pinned this issue Aug 5, 2022
@magey magey changed the title Avoidance DR is not working Avoidance DR is working incorrectly Aug 5, 2022
@magey
Copy link
Owner Author

magey commented Aug 5, 2022

Testing on build 44930 it looks like avoidance DR has been implemented but now this mechanism has other critical bugs.

First let's cover what works correctly. If you only have defense rating from gear and no parry/dodge rating at all (so this can't be tested on a DK) then the character sheet total avoidance stats shown under the 'Defenses' tab and the values returned from APIs like GetParryChance() and GetDodgeChance() give the diminished values for dodge/parry, and the values are correct and match Whitetooth's formula. Indeed, this is how it worked in original WotLK and is how they collected all the data points back then to estimate the formula by using regression analysis.

Once you add parry/dodge rating into the mix things go horribly wrong, though. Let's take parry rating as an example, although dodge rating has the same problem. I ran a little experiment on my warrior that has 10% naked parry chance (5% base + 5% from Deflection); starting with a naked character, I incrementally equipped more and more gear with defense bonuses and documented the expected vs. in-game total parry chance. For the last 3 pieces of gear I equipped gear with parry rating on it as well. The experiment is summarized below, where the Total expected column is calculated as 10% + TotalBonusDR and Total bonus (DR) is calculated per the formula above:

Rating Rating Bonus Defense Total bonus Total bonus (DR) Total expected Total actual Base + BonusDR + RatingBonus
0 0.00% 400 0.00% 0.00% 10.00% 10.00% 10.00%
0 0.00% 411 0.44% 0.46% 10.46% 10.46% 10.46%
0 0.00% 421 0.84% 0.86% 10.86% 10.86% 10.86%
0 0.00% 437 1.48% 1.50% 11.50% 11.50% 11.50%
0 0.00% 445 1.80% 1.81% 11.81% 11.81% 11.81%
0 0.00% 451 2.04% 2.04% 12.04% 12.04% 12.04%
0 0.00% 458 2.32% 2.31% 12.31% 12.31% 12.31%
0 0.00% 470 2.80% 2.76% 12.76% 12.76% 12.76%
0 0.00% 479 3.16% 3.09% 13.09% 13.09% 13.09%
0 0.00% 484 3.36% 3.27% 13.27% 13.27% 13.27%
0 0.00% 491 3.64% 3.52% 13.52% 13.52% 13.52%
0 0.00% 497 3.88% 3.74% 13.74% 13.74% 13.74%
0 0.00% 501 4.04% 3.88% 13.88% 13.88% 13.88%
40 0.88% 509 5.24% 4.91% 14.91% 15.80% 15.79%
96 2.12% 519 6.88% 6.24% 16.24% 18.36% 18.36%
145 3.20% 525 8.20% 7.25% 17.25% 20.46% 20.45%

As can be seen in the table, the numbers match up exactly until we start adding parry rating. Once we do that, the total value given in-game by the character sheet and the APIs seems to be 10% + TotalBonusDR + RatingBonus, meaning we are gaining parry from rating twice - once correctly using the total diminished value of total parry from defense and rating, and once again using the un-diminished value of parry from rating only.

I also performed a test for dodge rating and the results were similar.

@magey
Copy link
Owner Author

magey commented Aug 5, 2022

Char ran a test to measure the actual avoidance values experienced in combat. He used a level 80 Orc DK template and was attacked by level 57 Servants of Razelikh. Due to the natural weapon skill / defense difference he had an additional (80*5 - 57*5) * 0.04% = 4.6% to parry, dodge, and chance to be missed that is not diminished by the DR formula. Fully geared the character had:

  • 809 strength which resulted in 202 parry rating from Forceful Deflection and an additional 136 parry rating from gear, totaling in 338 parry rating which translates to +7.47% bonus parry
  • 158 dodge rating which translates to +3.49% bonus dodge
  • 613 defense rating which translates to 124 defense, which in turn translate to 124 * 0.04% = 4.96% bonus parry, dodge, and chance to be missed

Summarized, with Total (DR) being the expected diminished value calculated using Whitetooth's formula:

Base Level Bonus Total Total (DR)
Miss 5.00% 4.60% 4.96% 14.56% ~13.52%
Dodge 4.95% 4.60% 8.45% 18.00% ~17.58%
Parry 5.00% 4.60% 9.92% 17.52% ~19.78%

Note that these values are the theoretically correct values assuming the beta has no bugs - the actual character sheet and API values reported in-game for dodge and parry were incorrect as per the post above this one. The game reported 16.48% dodge and 22.65% parry respectively, which would make the diminished totals with the level difference added 21.08% dodge and 27.25% parry.

And the results of the test logging 18775 incoming attacks:

Outcome Chance 95% CI Count
Miss 13.67% ±0.49% 2566
Dodge 20.90% ±0.58% 3924
Parry 19.87% ±0.57% 3731
Hit 45.56% ±0.71% 8554

Looking at these results, we can see that the values measured for miss and parry actually behave correctly and match our expected values, even though the game reports incorrect values for parry. With dodge, the story is different; the value measured actually matches the incorrect value reported by the game - 20.90% ±0.58% measured vs. 21.08% as calculated above.

In summary, it looks like parry is only bugged on the client but dodge is bugged both on the client and the server.

@magey
Copy link
Owner Author

magey commented Sep 3, 2022

Character sheet values and tooltips appear to be fixed in build 45327 so Char and I ran some more tests. The setup was as follows:

  • 734 strength which resulted in 183 parry rating from Forceful Deflection and an additional 145 parry rating from gear, totaling in 328 parry rating which translates to +7.25% bonus parry
  • 120 dodge rating which translates to +2.65% bonus dodge
  • 535 defense rating which translates to 108 defense, which in turn translate to 108 * 0.04% = 4.32% bonus parry, dodge, and chance to be missed

Summarized, with Total (DR) being the expected diminished value calculated using Whitetooth's formula:

Base Level Bonus Total Total (DR)
Miss 5.00% 4.60% 4.32% 13.92% ~13.12%
Dodge 4.95% 4.60% 6.97% 16.52% ~16.28%
Parry 5.00% 4.60% 11.57% 21.17% ~19.22%

And the results of the test logging 23003 incoming attacks:

Outcome Chance 95% CI Count
Miss 13.27% ±0.44% 3053
Dodge 18.72% ±0.50% 4306
Parry 19.01% ±0.51% 4373
Hit 49.00% ±0.65% 11271

In conclusion, it looks like dodge DR is still bugged and the value we measured here (18.72% ±0.50%) is the same wrong value from before, where we are gaining our undiminished bonus from dodge rating in addition to the total DR'd dodge - 16.28% + 2.65% = 18.93%.

@CharWS
Copy link

CharWS commented Mar 31, 2023

Will do a retest after next reset but should hopefully be fixed
https://us.forums.blizzard.com/en/wow/t/dodge-bugfix-and-algalon-tuning/1558852

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working right
Projects
None yet
Development

No branches or pull requests

2 participants