MMO News and theorycrafting for advanced MMO gamers. News and articles that relate to your gameplay. World of Warcraft, SWTOR, Guild Wars 2, Rift, TERA, Eve Online, Star Wars the Old Republic, Diablo3, The Secret World and all Western AAA MMOs

Hello There, Guest! Register

 Primer on calculating DPS stat weights
Post: #1
 LagunaD Contributor Posts: 344 Joined: Nov 2011 Reputation: 6
Primer on calculating DPS stat weights
For purposes of theory-crafting, the effect of a given stat on the expected damage of an attack can be calculated fairly easily using knowledge of the rating formulae, combat table, and elementary calculus.

While somewhat cumbersome to carry out by hand, this type of calculation is very well suited for spreadsheets.

Expected damage of an attack

For a single attack, the expected (or average) damage Q can be written:

$\Large Q = (1 + \gamma) (1 - \mu) (a - \alpha) (\beta_1 \sigma + (1+\beta_2) w + \beta_3 b) (1 + c s)$

where:

$\begin{eqnarray} \gamma &=& \, \text{damage increasing buffs} \\ \mu &=& \, \text{defender damage reduction} \\ a &=& \, \text{attacker accuracy} \\ \alpha &=& \, \text{defender avoidance} \\ \beta_1 &=& \, \text{average of minimum and maximum standard damage percents} \\ \sigma &=& \, \text{standard damage from table} \\ \beta_2 &=& \, \text{average of minimum and maximum amount modifier percent} \\ w &=& \, \text{average of minimum and maximum weapon tooltip damage} \\ \beta_3 &=& \, \text{attack coefficient} \\ b &=& \, \text{attacker bonus damage for the attack type (melee, ranged, force, tech)} \\ c &=& \, \text{attacker critical chance} \\ s &=& \, \text{attacker critical damage bonus (base = 0.5)} \end{eqnarray}$

To avoid clutter, I have neglected the possibility of the defender using a shield, and if the attacker is over the accuracy cap:

$a - \alpha > 1$

the accuracy term should be omitted (and the weight for accuracy rating will then be zero).

Also note that the attacker's damage bonus, critical chance, etc, should include all buffs.

Fortunately, many of the quantities in the expected damage expression are constants (denoted by Greek letters) and most will not explicitly enter our calculation.

Logarithmic differentiation

The expected damage expression takes the form of a product of terms. This allows a convenient shortcut called logarithmic differentiation.

If

$f = u v ...$

then

${f^\prime \over f} = {u^\prime \over u} + {v^\prime \over v } + ...$

Using logarithmic differentiation, we can read off the derivatives of the attack damage with respect to the attacker's accuracy, bonus damage, critical chance and critical damage bonus:

$\Large \begin{eqnarray} {1 \over Q} {\partial Q \over \partial a} &=& {1 \over a - \alpha} \\ {1 \over Q} {\partial Q \over \partial b} &=& { \beta_3 \over \beta_1 \sigma + (1+\beta_2) w + \beta_3 b} \\ {1 \over Q} {\partial Q \over \partial c} &=& {s \over 1 + cs} \\ {1 \over Q} {\partial Q \over \partial s} &=& {c \over 1 + c s} \end{eqnarray}$

Note that for an ability that consists of a single attack, the denominator of the bonus damage derivative is just the average tooltip damage of the ability.

These are derivatives with respect to various derived stats, while the stat weights we seek are the derivatives with respect to raw ratings or attributes. To find how the average damage of an attack changes with raw ratings/attributes, we need to use the various conversion formulae, and the chain rule from calculus.

Stat conversion derivatives

For accuracy rating, critical rating, surge rating and the attribute bonus to critical chance, diminishing returns are applied to raw ratings or attributes.

The most convenient form of the DR expression for our purposes is:

$\Large \bar{y} = \chi (1 - e^{-r/\tau})$

where

$\begin{eqnarray} \bar{y} &=& \, \text{derived stat bonus from rating} \\ r &=& \, \text{raw rating or attribute} \\ \chi &=&\, \text{cap on bonus (from client files)} \\ \tau &=& - {\lambda \delta \over \ln(1 - \frac{0.01}{\chi} ) } \\ \lambda &=& \, \text{player level} \\ \delta &=& \, \text{percent divisor (from client files)} \end{eqnarray}$

then derived stat changes with the raw stat according to:

$\Large {dy \over dr} = { \chi - \bar{y} \over \tau }$

For Power rating, the derivative is much easier to calculate, since there are no diminishing returns. Assuming a +5% buff to damage bonuses (Jedi Knight/Sith Warrior), we have:

$\Large {db \over d{r_p}} = 0.23 \times 1.05 = 0.2445$

The variation of bonus damage with primary stats is also easy, assuming 5% buffs to both primary stats (Jedi Consular/Sith Inquisitor) and bonus damage (Jedi Knight/Sith Warrior):

$\Large {db \over d{r_n}} = 0.2 \times (1.05)^2 = 0.2205$

Stat weights for a single attack

Using the chain rule, we can now find the exact stat weights for a single attack (i.e. by what fraction does 1 point of a given rating or attribute increase the expected damage of that attack).

For Accuracy rating $(r_a)$:

$\Large \begin{eqnarray} {1 \over Q} {dQ \over dr_a} &=& {1 \over \tau_a} { \chi_a - \bar{a} \over a - \alpha} &(a - \alpha < 1) \\ {1 \over Q} {dQ \over dr_a} &=& 0 &(a - \alpha \ge 1) \end{eqnarray}$

Note that the attacker's total accuracy (a) and the attacker's accuracy bonus from accuracy rating $(\bar{a})$ are not the same quantity! This caveat applies generally (i.e. the "barred" quantity is the bonus from a particular rating or attribute, and the "unbarred" quantity is the total value of the stat).

For Critical rating $(r_c)$:

$\Large {1 \over Q} {dQ \over dr_c} = {s \over \tau_c} \, {\chi_c - \bar{c} \over 1 + c s}$

For Surge rating $(r_s)$:

$\Large {1 \over Q} {dQ \over dr_s} = {c \over \tau_s} \, {\chi_s - \bar{s} \over 1 + c s}$

For Power $(r_p)$:

$\Large {1 \over Q} {dQ \over dr_p} = { 0.2445 \beta_3 \over \beta_1 \sigma + (1+\beta_2) w + \beta_3 b}$

Attributes (Strength, Willpower, Aim, Cunning; generically denoted by $r_n$) are unique in that they increase both the bonus damage and critical chance for an attack. Therefore two terms in the logarithmic derivative of Q are non-zero:

$\Large {1 \over Q} {dQ \over dr_n} = {s \over \tau_n} \, {\chi_n - \bar{n} \over 1 + c s} + { 0.2205 \beta_3 \over \beta_1 \sigma + (1+\beta_2) w + \beta_3 b}$

Note that depending on the character's class and the attack type, either one or two attributes may affect it.

Stat weights for an ability involving multiple attacks

In general, a single ability may trigger multiple attacks, and we are more interested in the damage increase for the ability as a whole than for a particular attack.

When each attack has the same accuracy, and uses the same weapon (if any), we can simply add the coefficients $\beta_1, \beta_2, \beta_3$ and apply the math above to a single, larger "effective" attack.

When some attacks use different weapons and/or have different accuracy (e.g. off-hand attacks), we have to do a little more work.

Let each attack associated with an ability have an expected damage (given the weapon used, the accuracy, bonuses/penalties and the attack's beta coefficients) $Q_i$.

The total expected damage for the ability is then:

$\Large Q = \sum_i Q_i$

and the overall ability weight for a given stat can be expressed in terms of the weights and expected damage for each attack:

$\Large w \equiv {1 \over Q} {dQ \over dr} = {1 \over Q} \sum_i {dQ_i \over dr} = \sum_i {Q_i \over Q} w_i$

Stat weights for a rotation involving multiple abilities

Since most specs use half a dozen or more abilities regularly in a rotation or priority system, the most relevant stat weights for purposes of gear selection are those which average over all abilities.

It is at this stage that approximations may become necessary, since some abilities may receive buffs from random procs, and some attacks (e.g. Ataru form, saber techniques/charges, cylinders, etc) may proc randomly due to use of other abilities.

To first order, all that is necessary is to estimate the frequency at which each ability is used, for instance the number of times per minute. Then a weighted sum can be formed, similar to the one described in the previous section.

A more sophisticated, and probably more accurate, approach would apply resource constraints to the ability frequencies, adjusting the rate of "filler" or resource building abilities with resource spending abilities so the ability frequency reflects a sustainable rotation.

The proc rate for effects with an internal cooldown can also be calculated, based on the proc chance, rate of triggering attacks, and the internal cooldown:

$\Large R = {q r \over q r T + 1}$

where

$\begin{eqnarray} R &=& \, \text {proc rate} \\ r &=& \, \text{rate of attacks with a chance to trigger a proc} \\ q &=& \, \text{proc chance per attack} \\ T &=& \, \text{internal cooldown of proc} \end{eqnarray}$

Example of stat weight calculation for full rotation

A future post will illustrate the construction of stat weights for a full rotation using the Carnage Marauder as an example.

Alacrity

Alacrity has not been mentioned thus far, since unlike other stats, it does not directly affect the expected damage of any ability. Instead, Alacrity affects the expected damage done in a given period of time, by allowing more abilities to used. As such, it is only in the context of a full rotation that Alacrity's value relative to other stats can be estimated. A future post will attempt to illustrate the incorporation of Alacrity.
01-31-2012, 01:57 AM
Post: #2
 CaseyTheRetard Respected Member Posts: 243 Joined: Dec 2011 Reputation: 1
RE: Primer on calculating DPS stat weights
A couple of small points:
• r and tau are hard to distinguish in the math font used here; this makes the Stat Conversion Derivatives section a bit harder to follow than it could be.
• Most classes have a talent that increases primary stat by a percentage which combines additively with Mark of Power|Force Valor; should figure into $\frac{db}{dr_n}$.
01-31-2012, 10:37 PM
Post: #3
 Earctoth Newbie Posts: 1 Joined: Jan 2012 Reputation: 0
RE: Primer on calculating DPS stat weights
The equivalency of two attributes describes how much one equals the other.Equivalency ratings can be found like 1 agility = 1.5 strength. Equivalency describes the ratio of the stats to each other which is be used to get the stat weights. Example, an appropriate set of weights might be agility 3 and strength 2 which works out to agility being 1.5 times as valuable as strength.
Post: #4
 LagunaD Contributor Posts: 344 Joined: Nov 2011 Reputation: 6
RE: Primer on calculating DPS stat weights
(01-31-2012 10:37 PM)Earctoth Wrote:  The equivalency of two attributes describes how much one equals the other.Equivalency ratings can be found like 1 agility = 1.5 strength. Equivalency describes the ratio of the stats to each other which is be used to get the stat weights. Example, an appropriate set of weights might be agility 3 and strength 2 which works out to agility being 1.5 times as valuable as strength.

No offense, but that is extremely obvious stuff. Unclear what your point is.

The derivative of DPS with respect to a stat is its unnormalized weight. If we wish, we can choose one stat and normalize the weights so that the weight of the chosen stat is 1.

Equivalency is just the reciprocal of each stat's normalized weight, and is less intuitive since smaller equivalencies are better.
02-01-2012, 05:09 AM
Post: #5
 Kaedis Super Moderator Posts: 1,587 Joined: Sep 2011 Reputation: 7
RE: Primer on calculating DPS stat weights
One thing it might be worth mentioning is that due to standard optimization techniques in calculus, the optimal point for any distribution of n substitutable stats is the point where the benefit slope for all n stats is equal to each other (ie. their stat weights are equal). This isn't necessarily obvious to many players.

Even Angels must kill from time to time...
02-03-2012, 05:21 AM (This post was last modified: 02-03-2012 05:24 AM by RuQu.)
Post: #6
 RuQu Respected Member Posts: 103 Joined: Feb 2012 Reputation: 1
RE: Primer on calculating DPS stat weights
When looking at the Effect Details on torhead, often it lists multiple effects and subeffects, for example Disturbance for sages. When modeling the damage from abilities like this, I assume you simply sum the coefficients, StandardHealthMin, etc? They seem odd in that Disturbance appears to only have one effect when used in-game.

I am seeing this a lot on some melee abilities, like Master Strike for Knights. While I would expect one set of values, along with the standard duration and tick values, it has multiple.

When it says IgnoreDuelWield>=1, does that mean that ability only applies the modifier to the Main Hand?

For some Sentinel abilities, the AmountModifierPercent is negative. For others it is positive. What is the in-game implication of this?

My understanding is that bosses have 10% avoidance, necessitating 110% accuracy. Is this correct? Do we have any information on their damage reduction?
02-03-2012, 01:25 PM (This post was last modified: 02-03-2012 01:30 PM by Kaedis.)
Post: #7
 Kaedis Super Moderator Posts: 1,587 Joined: Sep 2011 Reputation: 7
RE: Primer on calculating DPS stat weights
Quote:When looking at the Effect Details on torhead, often it lists multiple effects and subeffects, for example Disturbance for sages. When modeling the damage from abilities like this, I assume you simply sum the coefficients, StandardHealthMin, etc? They seem odd in that Disturbance appears to only have one effect when used in-game.

The additional effects are for talents and similar. For example, for Disturbance, for example, Effect 1 Subeffect 2 is the standard damage, while Effect 2 Subeffect 1 is the damage for the Forked Lightning proc.

Incidentally, given those numbers, the Forked Lightning proc isn't precisely 30%. the Coefficient is 30.30%, the StandardMin is 26.79%, and the StandardMax is 32.89%. This gives an average of 29.84% base + 30.3% coeff.

Quote:For some Sentinel abilities, the AmountModifierPercent is negative. For others it is positive. What is the in-game implication of this?

AmountModifier is added to 1 to get the weapon coefficient, so an AmountModifier of -0.5 would be 1 - 0.5 = 50% weapon damage, while an AmountModifier of 0.5 would be 1 + 0.5 = 150% weapon damage.

Quote:When it says IgnoreDuelWield>=1, does that mean that ability only applies the modifier to the Main Hand?

What it actually says is "IgnoreDualWieldModifier=>1", and that means you don't get the standard -70% (or -44% with Dualwield Mastery) damage modifier on the offhand attacks in that attack. For example, Master's Strike has 3 attacks. When dual-wielding, Effect 1 Subeffect 8 strikes with the offhand at full damage instead of normal offhand damage.

Quote:My understanding is that bosses have 10% avoidance, necessitating 110% accuracy. Is this correct? Do we have any information on their damage reduction?

We're still unsure as to actual numbers, as calculating the precise accuracy cap requires statistical analysis of a large dataset, which is nearly impossible without an exportable combat log. However, some less rigorous testing has suggested the operations boss cap may be 8% rather than 10%.

Even Angels must kill from time to time...
Post: #8
 LagunaD Contributor Posts: 344 Joined: Nov 2011 Reputation: 6
RE: Primer on calculating DPS stat weights
I have updated the original post, and included a link to a Combat/Carnage spreadsheet which calculates stat weights as described:

http://tinyurl.com/89d27x5

Although Carnage is fairly easy to theorycraft for, there is a complicated relationship between stats, procs, resources and the rotation. I've tried to model this as accurately as possible in a spreadsheet, and the ideas might be applicable to models of other specs.

Accuracy affects hit chance, which affects the hit rate, which affects rate of Ataru procs.

The rate of Ataru procs affects damage (obviously) and also affects the rate of Blood Frenzy procs. Blood Frenzy does not stack, so effectively it has a 6-second ICD.

The rate of Blood Frenzy procs affects the amount of Rage available, since 1 point of Rage is refunded each time the buff expires.

The Rage available per minute affects the ratio of Assaults (no-cooldown Rage builder) to Massacres (no-cooldown Rage spender); I assume all other relevant abilities are kept on cooldown and the rate of Assaults/Massacres is adjusted to keep the overall ability "rotation" Rage-neutral.

The rates of Assault and Massacre affects the rate of Ataru procs since they involve a different number of attacks, Massacre includes an automatic Ataru AND grants a buff which increases the chance of a random Ataru proc from other hits for the next 6 seconds.

Thus, there is circularity (the rates of Assault and Massacre depends on the rate of Bloody Frenzy, due to Rage constraints, and the rate of Blood Frenzy depends on the rates of Assault and Massacre, due to number of attacks, the automatic Frenzy from Massacre, and the proc-chance buff from Massacre). And all of these things depend on Accuracy.

The combined rate of Assault + Massacre is fixed, so really there is one number (which we can choose to be the Massacre fraction of this fixed total) which needs to be determined for a given Accuracy.

Spreadsheets don't like circular dependencies, obviously. While it may be possible to work out the Massacre fraction in closed form (e.g. with Mathematica), the equations are intractable to a solution by hand. The Solver in Excel (but not Google) could also solve it, but it would have to be re-run every time stats change.

Given a rate of Massacres and the player's Accuracy, we can calculate everything else, including the Rage balance (which must be zero for the full rotation).

The solution to the circularity problem is to make a table of Rage Balance vs. Massacre Rate (for the player's Accuracy), and then (using the TREND spreadsheet function) interpolate the Massacre rate for the desired Rage balance of 0. This allows the spreadsheet to automatically use a Rage-neutral rotation for any value of Accuracy, despite the circular dependencies.

This works well, but turns out to be overkill - the difference in rage generation between 0 Accuracy Rating and capped Accuracy rating, for the same Massacre Rate, is about 1 Rage per hour.

It is useful to check the stat weights (i.e. derivatives) by manually incrementing stats. If there are no mistakes, the change in the estimated DPS (which doesn't involve any derivatives) from adding 1 point of a stat should equal the calculated derivative with respect to that very closely...and it does to within about 0.3% for the values I tried (in the process of checking, I did find and correct a couple bugs).

This indicates that the calculation is consistent (i.e. the calculated derivatives ARE the derivatives of the calculated DPS). It does not rule out mechanical errors in the DPS calculation (i.e. if the actual damage in-game is not what I have calculated). To help identify the latter, I include a calculation of the player stats and ability damage displayed in the tooltips (including the bug for skill-tree abilities...).

Edit: Updated to v1.2 to include Fury-stacking and the Berserk buff
02-05-2012, 06:01 AM
Post: #9
 RuQu Respected Member Posts: 103 Joined: Feb 2012 Reputation: 1
RE: Primer on calculating DPS stat weights
Laguna,

I created a Commando/Merc healing calculator with the formulas from the compiled formula list, and simply incremented the stats by 1 for separate rotations.

Of course, Alacrity does funny things, and can really mess with the rotations, as well as Ammo regen. I'd be curious to get the sithwarrior community feedback on it. Currently that's up and running in the swtor.com forum Combat Medic guide I wrote, and I'd like to give the CM community the best info possible.
02-07-2012, 02:48 AM
Post: #10
 RuQu Respected Member Posts: 103 Joined: Feb 2012 Reputation: 1
RE: Primer on calculating DPS stat weights
Trying to make sure I'm reading some of this right.
For Critical Chance, as an example:
X = 0.3
delta = 2.5 for Aim, or 0.45 for Crit rating?

So a reasonable way to right this out in code would be:
float x = 0.3;
float r = alacRating;
float t = -max(Level,20)*0.55/log((1-0.01/x));
float speed = (1- (alacBuff/100)-x*(1-exp(-r/t)));
 « Next Oldest | Next Newest »

Forum Jump:

User(s) browsing this thread: 1 Guest(s)