PDA

View Full Version : Effect of attack rating on DPS


Mirana
02-21-2014, 10:28 AM
(I did a search and could not find anything, so please don't yell at me).

I'm trying to understand the exact implications of strength and attack on my damage (sorry, I'm an engineer, I need transparency).

I was looking at Yaolin's monk/warrior weapon dps charts. He mentions that:

"DMG ratio" = (dmg*2+Bonus)/delay &
"Max Hit" =(((OFFENSE+STR)/100)*DMG)+DMG BONUS

And I'm good with all that, it makes sense. Every 10 strength or 10 "offense" increases your max hit by one point of damage. But what I can't find is how attack rating impacts how often you hit in the higher end of your range. Obviously, more weapon skill and strength = more attack rating which means you will hit for your max (or near your max) more often. I understand it also depends on monster AC. Does anyone have the formula for calculating effective DPS, taking into account attack rating?

Please don't tell me to parse it, I've already looked at several parses. I'm interested in a formula. I like being able to calculate the exact dps increase I will get from buying a hero bracer, because I'm a nerd and it's fun to me.

Thanks.

Buriedpast
02-21-2014, 10:47 AM
STR is not ATK.

Dont confuse them.

Weltmacht
02-21-2014, 10:54 AM
It would seem as if OP is doing an extraordinary job of *not* confusing them. Would you happen to know the answer to his question?

imajester
02-21-2014, 10:59 AM
Wouldn't it be possible to just look at the eqemu source to see how the calculation is done?

Mirana
02-21-2014, 11:05 AM
Wouldn't it be possible to just look at the eqemu source to see how the calculation is done?

Where would I find this? I'm guessing it's a text document in my program files? I'm familiar with basic coding language and stuff but not much of a computer whiz.

imajester
02-21-2014, 11:12 AM
I believe here...

https://code.google.com/p/projecteqemu/source/browse/

I am going to dig around and see if I can find the calc.

Daldaen
02-21-2014, 11:12 AM
Melee Damage

Brohg writes the following description of melee damage recieved from mobs: "Mob damage is two parts, DB (Damage Base/Bonus or Fixed Damage /Vig), and (1-20)*DI, which is Damage Interval. You can see this by parsing, that there are 20 discrete amounts of damage any mob can deal on a successful hit. It's not quite /random 1 20, because AC makes a big huge difference in how many low hits you have, but you still have the whole range.
If a mob has a damage base of 200, and a damage interval of 20, then (once they hit you) they'll deal either 220 damage, or 240, 260... etc ... 580, or 600 damage."

"High AC (from gear /Vig) reduces the damage taken from the (1-20)*DI portion a lot, making many more low #*DI than high."

So all melee damage has two parts, one wich is random and affected by the AC on your gear, and one part that is never modified by AC. The Shielding effect in particular is extra interesting heresince Shielding affects only the Fixed Damage (and is the only thing that affects it), not the random Damage Interval.


Armor Class

Armor Class is what decides how much damage you take and how often you take damage. It mitigates damage and it makes the mob miss it's attacks against you. The first part of the AC is "mitigation AC" wich is calculated from the worn AC you gain from your gear. Taraddar writes: "Your "mitigation" ac comes from the AC on your gear and is what effects the distribution you get in the 1-20 portion of attacks. Higher ac gets more lower hits etc."

This means that the gear you wear decides how much of the random part ie Damage Interval (as described above) of the damage coming your way actually hits you.

The other part of AC is the "avoidance AC" wich is defined by your Defense Skill and your AGI stat. Taraddar writes: "Normally your defense skill and agility contribute to your "avoidance" ac and increase your chance of being missed. AC from gear doesn't effect this at all."


Attack

Attack, like AC, is also composed of two parts. One is based on your Strength and wielded weapon to decided how hard you hit the mob when you connect. Let's call this Power. Brohg writes: The Power part of Attack is how hard you hit, when you hit. No amount of power will raise your max hit, but those who are familiar with the (1-20)*DI nature of Everquest damage will understand that shifting your average hits higher on the 1-20 scale will lead to much more overall damage. This is what Power does. Power is modified by Offense skill, Strength score, and +ATK mods on items. In combat, Power is opposed by the target's Mitigation.

The other part of Attack decides how often you hit. This is based on your weapon skills. We can also safely assume that your Offense skill is also one part of the calculation. Again, Brohg teaches us: "Displayed "Attack" is Accuracy+Power. Accuracy is how likely one is to hit one's target, and in combat is compared to the Avoidance part of AC (more on that later). Accuracy comes from two sources, Weapon Skills and +Accuracy mods on items."

Is a solid description of how EQ mechanics work... But it doesn't have an exact ATK formula. Just what factors in, no numbers.

koros
02-21-2014, 11:31 AM
Atk affects the skewness of the hit distribution curve. General rule on live during Velious was that 10 atk = 1% dps increase at around 1000 atk vs level 60ish npcs. There's going to be some second derivative action going on making it hard to predict exactly how atk alters the curve, especially without hard numbers.

koros
02-21-2014, 11:32 AM
I believe here...

https://code.google.com/p/projecteqemu/source/browse/

I am going to dig around and see if I can find the calc.

Please do post if you find anything solid.

Swish
02-21-2014, 11:50 AM
If a druid offers you wolf form, take it :)

tristantio
02-21-2014, 02:06 PM
You know how you know someone is an engineer?

They'll tell you!

imajester
02-21-2014, 02:14 PM
//o--------------------------------------------------------------
//| GetHitChance; Yeahlight, Nov 24, 2008
//o--------------------------------------------------------------
//| Returns the chance to hit between attacker and defender
//o--------------------------------------------------------------
int16 Mob::GetHitChance(Mob* attacker, Mob* defender, int skill_num)
{
bool debugFlag = true;

//Yeahlight: If the target is sitting, the chance to hit them is 100%
if(defender->GetAppearance() == SittingAppearance)
return 999;

sint16 ATKadjustment = (attacker->GetLevel() - defender->GetLevel()) * 3;
sint16 hitRateAdjustment = (attacker->GetLevel() - defender->GetLevel());
int16 hitChance = 70;
int16 weaponSkill = 0;
if(ATKadjustment < 0)
ATKadjustment = 0;
if(attacker->IsClient())
weaponSkill = attacker->CastToClient()->GetSkill(skill_num);
else
weaponSkill = attacker->GetSkill(skill_num);
int16 accuracyATK = (int)((float)weaponSkill * 2.70f) + 5 + ATKadjustment;
if(accuracyATK == 0)
accuracyATK = 1;
int16 avoidanceAC = defender->GetAvoidanceAC();

//Yeahlight: 5% bonus evasion for defensive monks
if(defender->GetClass() == MONK || defender->GetClass() == MONKGM)
hitChance = hitChance - 5;
//Yeahlight: 5% bonus accuracy for offensive rogues
if(attacker->GetClass() == ROGUE || attacker->GetClass() == ROGUEGM)
hitChance = hitChance + 5;

//Yeahlight: As the attacker falls further under the level of the defender, it becomes harder to land a hit
// Note: This will become a major tweak for class balancing! We must keep this on par with spell casting level penalties
if(hitRateAdjustment < 0)
{
hitRateAdjustment = abs(hitRateAdjustment);
if(hitRateAdjustment > 15)
hitRateAdjustment = 15;
float tempAdjustment = (float)hitRateAdjustment * 2.00f / 3.00f;
hitRateAdjustment = (int)tempAdjustment;
hitChance = hitChance - hitRateAdjustment;
}

//Yeahlight: Adjust hit rate based on the gap between accuracy and avoidance AC
sint16 gapPercent = (sint16)(((float)(accuracyATK - avoidanceAC) / (float)(accuracyATK)) * 100.00f);
sint16 gapAdjustment = ((float)gapPercent / 5.00f);
if(gapAdjustment > 5)
gapAdjustment = 5;
else if(gapAdjustment < -5)
gapAdjustment = -5;
hitChance = hitChance + gapAdjustment;

//Yeahlight: Debug messages
if(debugFlag && defender->IsClient() && defender->CastToClient()->GetDebugMe())
defender->Message(LIGHTEN_BLUE, "Debug: %s's ATK accuracy: %i; Your AC evasion: %i; Hit rate: %i%s", attacker->GetName(), accuracyATK, avoidanceAC, hitChance, "%");
if(debugFlag && attacker->IsClient() && attacker->CastToClient()->GetDebugMe())
attacker->Message(LIGHTEN_BLUE, "Debug: Your ATK accuracy: %i; %s's AC evasion: %i; Hit rate: %i%s", accuracyATK, defender->GetName(), avoidanceAC, hitChance, "%");
CAST_CLIENT_DEBUG_PTR(attacker)->Log(CP_ATTACK, "Mob::GetHitChance: Your hit chance: %f", hitChance);
CAST_CLIENT_DEBUG_PTR(defender)->Log(CP_ATTACK, "Mob::GetHitChance: %s's hit chance: %f", attacker->GetName(), hitChance);

return hitChance;
}

drktmplr12
02-21-2014, 02:15 PM
You know how you know someone is an engineer?

They'll tell you!

i am an engineer, and this is true.

koros
02-21-2014, 02:46 PM
Interesting code snippet. However, that doesn't tell us how ATK functions(in the eq sense uses it). The code you posted looks to be for hit rate %, which ATK doesn't affect.

Skydash
02-21-2014, 05:17 PM
Ok, so if I read this code right, then your percentage of landing blows is between 65% to 75% if you are >= target level.
And between 50% to 75% if your < target level.

So the most you will ever hit a mob is 75% no matter what you do, and this is only based on level (and skill level which is based on level).

imajester
02-21-2014, 05:24 PM
Don't want to post all the code, but if you want to look...

https://github.com/EQEmu/Server/blob/master/zone/attack.cpp

tristantio
02-21-2014, 05:28 PM
I was just about to post that (was reading attack.cpp myself).

Important part:


// This is called when the Mob is the one being hit
int32 Mob::GetMeleeMitDmg(Mob *attacker, int32 damage, int32 minhit,
float mit_rating, float atk_rating)
{
float d = 10.0;
float mit_roll = MakeRandomFloat(0, mit_rating);
float atk_roll = MakeRandomFloat(0, atk_rating);

if (atk_roll > mit_roll) {
float a_diff = atk_roll - mit_roll;
float thac0 = atk_rating * RuleR(Combat, ACthac0Factor);
float thac0cap = attacker->GetLevel() * 9 + 20;
if (thac0 > thac0cap)
thac0 = thac0cap;

d -= 10.0 * (a_diff / thac0);
} else if (mit_roll > atk_roll) {
float m_diff = mit_roll - atk_roll;
float thac20 = mit_rating * RuleR(Combat, ACthac20Factor);
float thac20cap = GetLevel() * 9 + 20;
if (thac20 > thac20cap)
thac20 = thac20cap;

d += 10.0 * (m_diff / thac20);
}

if (d < 0.0)
d = 0.0;
else if (d > 20.0)
d = 20.0;

float interval = (damage - minhit) / 20.0;
damage -= ((int)d * interval);

damage -= (minhit * itembonuses.MeleeMitigation / 100);
damage -= (damage * spellbonuses.MeleeMitigation / 100);
return damage;
}


And the call to that looks something like this:

if (GetClass() == WIZARD || GetClass() == MAGICIAN ||
GetClass() == NECROMANCER || GetClass() == ENCHANTER)
mitigation_rating = ((GetSkill(SkillDefense) + itembonuses.HeroicAGI/10) / 4.0) + armor + 1;
else
mitigation_rating = ((GetSkill(SkillDefense) + itembonuses.HeroicAGI/10) / 3.0) + (armor * 1.333333) + 1;
mitigation_rating *= 0.847;

mitigation_rating = mod_mitigation_rating(mitigation_rating, attacker);

if (attacker->IsClient())
attack_rating = (attacker->CastToClient()->CalcATK() + ((attacker->GetSTR()-66) * 0.9) + (attacker->GetSkill(SkillOffense)*1.345));
else
attack_rating = (attacker->GetATK() + (attacker->GetSkill(SkillOffense)*1.345) + ((attacker->GetSTR()-66) * 0.9));

attack_rating = attacker->mod_attack_rating(attack_rating, this);

damage = GetMeleeMitDmg(attacker, damage, minhit, mitigation_rating, attack_rating);

imajester
02-21-2014, 05:32 PM
Interesting code snippet. However, that doesn't tell us how ATK functions(in the eq sense uses it). The code you posted looks to be for hit rate %, which ATK doesn't affect.


You are thinking of ATK as just one thing. There are two components to ATK (chance to hit and how hard I hit), just as there are two components to AC. The two values combined is your displayed ATK, just as the two combined AC components equal your displayed AC value.

fadetree
02-21-2014, 05:33 PM
lol, haven't seen code with THAC0's in it for a while.

koros
02-21-2014, 07:58 PM
You are thinking of ATK as just one thing. There are two components to ATK (chance to hit and how hard I hit), just as there are two components to AC. The two values combined is your displayed ATK, just as the two combined AC components equal your displayed AC value.

ATK from strength and from +atk effects has zero bearing on chance to hit.

imajester
02-22-2014, 10:51 AM
ATK from strength and from +atk effects has zero bearing on chance to hit.

I'll have to find the code snipit, but I thought the displayed ATK value in your inventory had weapon skill as one of the components. Then again, I could be horribly wrong, would not be the first or last time.

myriverse
02-22-2014, 11:58 AM
Skill does increase ATK, but it's not ATK that affects chance to hit.

Mirana
02-24-2014, 09:36 AM
So I'm at work Monday and just looking at all this code (I didn't look during the weekend, I was busy playing, duh).

I'm able to decipher bits and pieces of the code but it looks like there are variables that are referenced elsewhere in the code. It's like trying to read a book in Spanish when you only know half the language.

Does anyone know how floats work? Specifically these functions
float mit_roll = MakeRandomFloat(0, mit_rating);
float atk_roll = MakeRandomFloat(0, atk_rating);

MakeRandomFloat is some sort of function with the inputs of "0" and "mit_rating" or "atk_rating" which are calculated elsewhere. What does MakeRandomFloat do?

THAC0 stands for "To Hit AC 0" correct?

imajester
02-24-2014, 10:08 AM
So I'm at work Monday and just looking at all this code (I didn't look during the weekend, I was busy playing, duh).

I'm able to decipher bits and pieces of the code but it looks like there are variables that are referenced elsewhere in the code. It's like trying to read a book in Spanish when you only know half the language.

Does anyone know how floats work? Specifically these functions
float mit_roll = MakeRandomFloat(0, mit_rating);
float atk_roll = MakeRandomFloat(0, atk_rating);

MakeRandomFloat is some sort of function with the inputs of "0" and "mit_rating" or "atk_rating" which are calculated elsewhere. What does MakeRandomFloat do?

THAC0 stands for "To Hit AC 0" correct?

An 'int' is a Whole Number where a float is more like a Real Number, meaning a float has a fractional component to it. i.e. 3.14159 would be represented by a float, not an int.

MakeRandomFloat(a,b) will return a random value between a and b. MakeRandomFloat(0, 10) will return a random real number between 0 and 10.


You are correct on THAC0.

koros
02-24-2014, 10:38 AM
So I'm at work Monday and just looking at all this code (I didn't look during the weekend, I was busy playing, duh).

I'm able to decipher bits and pieces of the code but it looks like there are variables that are referenced elsewhere in the code. It's like trying to read a book in Spanish when you only know half the language.

Does anyone know how floats work? Specifically these functions
float mit_roll = MakeRandomFloat(0, mit_rating);
float atk_roll = MakeRandomFloat(0, atk_rating);

MakeRandomFloat is some sort of function with the inputs of "0" and "mit_rating" or "atk_rating" which are calculated elsewhere. What does MakeRandomFloat do?

THAC0 stands for "To Hit AC 0" correct?

Float means floating point, i.e. it can handle any number of decimal places but takes more storage/computational time.

It's making a roll between 0 and the rating.

fadetree
02-24-2014, 11:32 AM
THAC0 does stand for to hit armor class 0. It's a D&D term.