Jump to content

[FIX] Dodge Chance


Guest gonzalezbr
 Share

Recommended Posts

Hi! I'm not very used to big programming projects, but I consider myself a weekend-programmer ;)

While playing I was using some simulation tools and I found out my druid's dodge chance was really below what it should be. So I decided to investigate but I need more help in getting this right.

Before:

float Player::GetDodgeFromAgility()
{
   // Table for base dodge values
   float dodge_base[MAX_CLASSES] = {
        0.0075f,   // Warrior
        0.00652f,  // Paladin
       -0.0545f,   // Hunter
       -0.0059f,   // Rogue
        0.03183f,  // Priest
        0.0114f,   // DK
        0.0167f,   // Shaman
        0.034575f, // Mage
        0.02011f,  // Warlock
        0.0f,      // ??
       -0.0187f    // Druid
   };
   // Crit/agility to dodge/agility coefficient multipliers
   float crit_to_dodge[MAX_CLASSES] = {
        1.1f,      // Warrior
        1.0f,      // Paladin
        1.6f,      // Hunter
        2.0f,      // Rogue
        1.0f,      // Priest
        1.0f,      // DK?
        1.0f,      // Shaman
        1.0f,      // Mage
        1.0f,      // Warlock
        0.0f,      // ??
        1.7f       // Druid
   };

   uint32 level = getLevel();
   uint32 pclass = getClass();

   if (level>GT_MAX_LEVEL) level = GT_MAX_LEVEL;

   // Dodge per agility for most classes equal crit per agility (but for some classes need apply some multiplier)
   GtChanceToMeleeCritEntry  const *dodgeRatio = sGtChanceToMeleeCritStore.LookupEntry((pclass-1)*GT_MAX_LEVEL + level-1);
   if (dodgeRatio==NULL || pclass > MAX_CLASSES)
       return 0.0f;

   float dodge=dodge_base[pclass-1] + GetStat(STAT_AGILITY) * dodgeRatio->ratio * crit_to_dodge[pclass-1];
   return dodge*100.0f;
}

According to http://elitistjerks.com/f31/t29453-combat_ratings_level_80_a/, the druid fix of the code should be: (Gonna look at other parts of the dodge formula later. My client was showing more than 12% discrepancy between my dodge and the expected dodge, so this and Savage Defense not working - there is a patch already going on to fix it - is hurting my tanking a lot)

float Player::GetDodgeFromAgility()
{
   // Table for base dodge values
   float dodge_base[MAX_CLASSES] = {
        0.0075f,   // Warrior
        0.00652f,  // Paladin
       -0.0545f,   // Hunter
       -0.0059f,   // Rogue
        0.03183f,  // Priest
        0.0114f,   // DK
        0.0167f,   // Shaman
        0.034575f, // Mage
        0.02011f,  // Warlock
        0.0f,      // ??
        [color="Red"]0.04951f    // Druid[/color]
   };
   // Crit/agility to dodge/agility coefficient multipliers
   float crit_to_dodge[MAX_CLASSES] = {
        1.1f,      // Warrior
        1.0f,      // Paladin
        1.6f,      // Hunter
        2.0f,      // Rogue
        1.0f,      // Priest
        1.0f,      // DK?
        1.0f,      // Shaman
        1.0f,      // Mage
        1.0f,      // Warlock
        0.0f,      // ??
        [color="Red"]2.0f       // Druid[/color]
   };

   uint32 level = getLevel();
   uint32 pclass = getClass();

   if (level>GT_MAX_LEVEL) level = GT_MAX_LEVEL;

   // Dodge per agility for most classes equal crit per agility (but for some classes need apply some multiplier)
   GtChanceToMeleeCritEntry  const *dodgeRatio = sGtChanceToMeleeCritStore.LookupEntry((pclass-1)*GT_MAX_LEVEL + level-1);
   if (dodgeRatio==NULL || pclass > MAX_CLASSES)
       return 0.0f;

   float dodge=dodge_base[pclass-1] + GetStat(STAT_AGILITY) * dodgeRatio->ratio * crit_to_dodge[pclass-1];
   return dodge*100.0f;
}

I used 2 on the multiplier because I need double the agi to get 1% crit(83.33) than I need to get 1% dodge(41.667).

Is this right?

If it is, I'll finish translating the data here and try to determine better how to fix dodge chance.

Also.... where can I check the values to see if the crit ratings are right?

Any help would be dearly appreciated!

Sorry if I am making any stupid mistakes, I'm still kinda newb but I want to help with this great project that has given me so many hours of fun =)

Link to comment
Share on other sites

I don't know if this still applies... but I read somewhere that the data received by the client is different than the data handled by the server. Meaning that the dodge % server side is correct, but visible stats client side are off slightly.

The same may apply for other stats as well, I'm just not sure. Add a simple debug log script to output the current dodge of player id x in the source to the console or log file. I'm not on a comp with mangos pulled atm, so I can't write one.

Link to comment
Share on other sites

I analyzed the combat logs. It seemed to me that, although my dodge should be aroudn 39% and the client was showing 27%, I could mitigate only 17.7% of incoming normal attack hits(miss+dodge).

I'm sorry but I've never put up a server to run >.<

I was following the tutorial, and I think I just finished compiling mangos+acid2, but I still need to set up the SQL and get a db for items etc...

If this is the case, would anybody be interested in the item IDs that I used?

Also... is this the right place that calcs dodge? Because if it is, even though the client receives different data the calculation would still be wrong...

And yeah, I saw that topic about client getting wrong data. Just was not sure if it had been fixed or not, and when I found that my base dodge was negative I just thought maybe it was wrong :)

Link to comment
Share on other sites

I do agree that the values mentioned in the first post seem off, though i think the whole dodge calculation is not correct (anymore?).

Looking at wowwiki/elitristjerks, dodge from agility "suffers" diminishing returns, while MaNGOS just adds base doge and undiminished dodge from agility, i can't see where the diminishing formula is applied...

Same for dodge from defense rating btw, see Player::UpdateDodgePercentage()

Does anyone know if the client calculates those chances itself from the base stats and talents maybe?

Link to comment
Share on other sites

also....

parsing the combat log

http://www.wowmeteronline.com/combat/detail/169644511#damagetaken

this is the parsedcombatlog

According to modelling programs I should have about 36% dodge, my character screen shows only 26ish but new combat log shows 22.8% (stop the mouse over miss... i had a priest bubbling me so i had some absorbs.... + The usual miss that is not taken into factor from dodge)

EDIT: Is this where mangos get the chance to dodge from combat? or only where it gets the chance to dodge to show on player screen?

If this is... it seems most formulas are somewhat wrong =/ (according to elitistjerks)

Link to comment
Share on other sites

  • 1 year later...
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use