fix Boss avoidance value (#452)#453
Conversation
The avoidance is the sum of the chances to be missed by, to block, to parry or to dodge an attack from the enemy. Each of these possibilities receives a -0.2 % penalty for every level of the attacker above the player's level. The code currently takes the level difference in consideration only for the misses. This results in the "Avoidance (Lvl +3)" displayed value to be incorrect, being shown at -0.6 % compared to same-level avoidance, while the difference should be -2.4 %. Fix this by adding an enemyLevel parameter to the GetDodgeChance, GetParryChance and GetBlockChance methods and using it to properly take the level difference into account in the returned values.
| -- In theory we should compare the player's base defense skill with | ||
| -- the attacker's weapon skill. Unfortunately there's no API function | ||
| -- to retrieve the former. The following formula leads to the same | ||
| -- results except when the player just gained a level and his/her | ||
| -- defense skill did not catch up yet. |
There was a problem hiding this comment.
Why doesn't Data:GetDefenseValue() suffice here? We use it for enemy miss chance as well 🤔
There was a problem hiding this comment.
Unfortunately Data:GetDefenseValue() is based on UnitDefense() which takes talents into account. Specifically when testing on my level 70 paladin, this function returns 370 and not 350, because of talent Anticipation 5/5. However the parry chance penalty that should be applied must be computed by comparing the player's base Defense (without gear nor talents) with the attacker's base weapon skill.
I looked for an API function which would return the base Defense value, without talent modifiers, but could not find any. If you know of a way to obtain this value, please let me know.
There was a problem hiding this comment.
By the way, your use of Data:GetDefenseValue() to compute the chance to be critically hit and the chance to be missed, is correct, because this function adds both values returned by Data:GetDefenseValue(). While each value is individually incorrect (the talents contribution should be in the second value, not the first value in my opinion), the sum is right.
There was a problem hiding this comment.
The simulator is using full defense here https://github.com/wowsims/tbc-new/blob/aa7b0e67211802856ef7e78e9d16be8498b5cff8/sim/core/unit.go#L913
There was a problem hiding this comment.
The simulator is using full defense here https://github.com/wowsims/tbc-new/blob/aa7b0e67211802856ef7e78e9d16be8498b5cff8/sim/core/unit.go#L913
But method Unit.GetTotalAvoidanceChance is not called anywhere, so this is all effectively dead code. I can't see how that code could be correct anyway as the enemy's attack skill is not even factored in.
OTOH, I tested my gear in the online simulator at https://www.wowsims.com/tbc/paladin/protection/ and it displays the same (same-level) Dodge chance %, Parry chance % and Block chance % as the current ECS code and the default WoW BC interface.
There was a problem hiding this comment.
So @jdelvare @Alessandro-Barbieri are we fine with the current implementation of the fix then?
There was a problem hiding this comment.
Yes, I think the proposed fix should be applied.
There was a problem hiding this comment.
So @jdelvare @Alessandro-Barbieri are we fine with the current implementation of the fix then?
No
Blizzard is using full defense in the paperdoll
https://github.com/Gethe/wow-ui-source/blob/4cca594e4db26f8addc25b0c08aba144b00d2b67/Interface/AddOns/Blizzard_CharacterFrame/TBC/PaperDollFrame.lua#L598
There was a problem hiding this comment.
No Blizzard is using full defense in the paperdoll https://github.com/Gethe/wow-ui-source/blob/4cca594e4db26f8addc25b0c08aba144b00d2b67/Interface/AddOns/Blizzard_CharacterFrame/TBC/PaperDollFrame.lua#L598
This function is only used to display extra details for the Defense skill in the paperdoll view. It tells the player how much Defense contributes to Dodge, Parry and Dodge chance. It is not used to compute the Dodge, Parry and Block chance values, because the contribution from Defense is already included in the values returned by GetDodgeChance(), GetParryChance() and GetBlockChance(). It is thus irrelevant to this pull request, and more generally to the functions this pull request is modifying.
I would add that function GetDodgeBlockParryChanceFromDefense() in Blizzard's UI does not actually use the full defense. It starts from the full defense value, yes, but then subtracts UnitLevel("player")*5, which is essentially equal to the base defense (except during leveling). So in practice, this function uses the defense from gear and consumables to compute the contribution to Dodge, Parry and Dodge chance, not the full defense value. As a matter of fact, if you display the Blizzard paperdoll tooltip for Defense on a non-tank character (no defense gear), the value displayed is 0.00%, even though the base defense Skill is not 0.
There was a problem hiding this comment.
Afterall I got at the same formula you used but from different premises
See #452 (comment)
I only ask you to remove the comment above because it's misleading, the formula should be correct even if you have unleveled defense.
The avoidance is the sum of the chances to be missed by, to block, to parry or to dodge an attack from the enemy. Each of these possibilities receives a -0.2 % penalty for every level of the attacker above the player's level.
The code currently takes the level difference in consideration only for the misses. This results in the "Avoidance (Lvl +3)" displayed value to be incorrect, being shown at -0.6 % compared to same-level avoidance, while the difference should be -2.4 %.
Fix this by adding an enemyLevel parameter to the GetDodgeChance, GetParryChance and GetBlockChance methods and using it to properly take the level difference into account in the returned values.