## Guest Post: Yuki Learns you Stat Weighting (p2)

June 24, 2009*As stated last week, here’s the post outlining how to determine weights to plug into lootrank to figure out your best in slot. It’s a general list written by (alas) a DPS-type, so it’s not aimed at healers specifically, but I hope you all can still find it useful. Yuki’s been my guildie, my buddy, and enabler of my anime addiction for several years now. He’s also the first person who told me that such a thing as mathcraft exists. Be warned, there’s numbers ahead.*

## Step 4: Methodological Chaos

At this point, there are basically three potential methodologies for settling on the final values to be used: **The Quick and Dirty method, the Numerical Model method, and the Simulation method.**

Whichever method you choose, **at this point you’ll need to know a few things:** the average non-crit heal/damage/threat/whatever for each ability you use, whether and how each ability scales with your baseline stat (so, for instance, if an ability gains extra potency per spellpower due to a talent), and whether the ability scales with any other stats (can it crit? affected in any way by haste? etc), and how frequently you use each ability. For the quick method, you can get the last one from a WWS report, but in general you’ll get better results if you determine it from your ideal usage or rotation.

### 4a: Quick and Dirty

The fastest way to generate values is to just do them based on a parse. First you’ll need to know how much a point of spell power adds to each ability’s net effectiveness. Look up its scaling coefficient and figure out how much 1 spellpower would actually increase that average use of the ability. You’ll be using this as a point of comparison to determine how much each ability actually scales per point of other things; I’ll henceforth be referring to it as **“the baseline scaling value”** of for that ability.

Second, you pull out all your averages for all your abilities, and your % usage for each. Next, figure out how much each would scale with 1% effectiveness of each rating you’re trying to calculate a weight for. Divide this value by your baseline scaling value, then multiply it by the % of usage your WWS report shows; sum these values up to get your effective spell/attack power value for 1% of each rating, from which you derive the final ESP/EAP per rating point by dividing by its conversion factor for you level.

**Advantages/Disadvantages: **The advantages of this method should be clear, as well as its drawbacks: it’s pretty easy, doesn’t take too long, and requires relatively little mathematical modeling, but it’s also really, **really bad at things like haste on abilities with cooldowns.** But if you’re just looking for a quick approximation and you don’t plan to redo your weights ever, its numbers aren’t too horribly off unless you’re very dependent on those kinds of things.

### 4b: Numerical Modeling

This is the “purest” methodology, and also the one that’ll be your best bet if you’re planning to really do a lot of your own stat weighting, since it’s the easiest to revise.

Essentially, you model what your ideal rotation would look like in practice. I’m going to use an offensive spell as my example, because it’ll give me a chance to show how to model hit and similar stats.

**Start with the average base damage of the spell.** Because you’ve already determined how your rotation works, you’ll know how many times you can cast it during that time. Therefore its total contribution of damage during your rotation is:

Damage = (Times cast) * (Average Base damage)

Now, we add in spell damage scaling:

Damage = (Times cast) * (Average Base Damage + [Baseline Scaling Value * Spellpower] )

To add crit, we’ll start with the value of a crit, which is (1 + Crit Bonus Damage Value). Now we multiply that by your chance of actually getting a crit, which is Base Crit + Crit Rating/Crit Conversion. Add all that to one and multiply it by the original value and you’ll have modeled what your damage from that ability would be with crit!

Damage = (Times cast) * (Average Base Damage + [Baseline Scaling Value * Spellpower]) * (1 + (1 + Crit Bonus Damage Value) * (Base Crit + Crit Rating/Crit Conversion)

Hit works as basically a “penalty” on damage until it’s capped. Whatever damage you could have been doing would be a miss, so it’s 1 – Miss Rate + Hit Rating/Hit Conversion in a ceiling function that can never be above one. For notational simplicity I’ll just assume we’re below the hit cap. Note that “Miss Rate” above includes everything other than hit rating that increases your chance to hit (like misery or a draenei aura), because we’re only comparing the gear stats, so those should be included in the baseline of the model.

Damage = (Times cast) * (Average Base Damage + [Baseline Scaling Value * Spellpower]) * (1 + (1 + Crit Bonus Damage Value) * (Base Crit + Crit Rating/Crit Conversion) * (1 – Miss Rate + Hit Rating/Hit Conversion)

Haste is where things get interesting. If the ability in question is not cooldown limited, you can effectively cast it “more times”, so our Times Cast actually scales with haste.

Damage = (Times cast * (1 + Haste Rating/Haste Conversion) * (Average Base Damage + [Baseline Scaling Value * Spellpower]) * (1 + (1 + Crit Bonus Damage Value) * (Base Crit + Crit Rating/Crit Conversion) * (1 – Miss Rate + Hit Rating/Hit Conversion)

What if it IS cooldown limited? Well, in this case, it basically doesn’t scale with haste even if its casting time would be reduced; you can never cast any more of them than the cooldown allows. But because you’re casting it faster, you have more room for casting other things in your rotation, so those can actually generally be modeled as scaling normally with haste unless you’re trying for complete precision, because they can fill in the extra time left open even though you’re squeezing them between cooldown casts.

This example should show you basically how to handle all the various ways to scale when modeling. **Your final equation will be the sum of all these terms.** Run through it first for only the baseline stats you selected earlier, then once for spell damage; the difference between these two becomes your baseline scaling value for the whole rotation. Now just add a point to a rating and solve through and divide by the baseline scaling value for the ESP/EAP value of that stat.

**Advantages/Disadvantages:** If your eyes glazed over reading this section **you will probably hate this method.** It’s very math intensive, and requires you to think like a numerical modeler, which can be hard if you’re not a numbers person. Also, an error in the model can lead to grossly inaccurate results; this can occur as a math error, or just in terms of how you model your ideal rotation, so there’s a lot of points of potential fail.

On the other hand, if you get it right, you have a comparatively easy way to change your baseline (just change the values), and you’re ahead of the game if your rotation changes (since you can just fiddle with the numbers a bit). If done well it also produces the best numbers theoretically possible.

### 4c: Simulation

This method is both similar to and very different from the previous. Basically you build (or download) a simulator for your class that effectively “runs” a combat action-by-action for an arbitrarily large amount of time and reports back its results. You basically just tweak a base value, run the simulation, and compare it to a baseline simulation to determine the comparative value of each stat.

**Advantages/Disadvantages:** Building your own sim would, of course, require programming knowledge and a slightly less rigorous form of numerical modeling. Downloading someone else’s requires neither of these, but also requires that you trust THEIR programming knowledge and numerical modeling. You could also run in issues of RNG-fail, but a sufficiently arbitrarily large number of actions should statistically smooth those out.

The biggest advantage that this method has is that it’s the **best option for procs and other random mechanics**. Trying to do a numerical model for something like Windfury (a 20% proc with a 3 second internal cooldown) will quickly make you want to throw yourself under a bus. I’ll talk about trying to model procs in the following section, but suffice to say this method produces more accurate results than that one.

*Part two is done! You’ve almost made it. Stay tuned for the final bit tomorrow!*

I wonder… This may exceed the topic of the post a bit but you assume at some point to know the best spell rotation and take a fixed build. While this is excellent for finetuning, imagine we’re trying to find the maximum achievable dps for a given class. You would have to examine / calculate / simulate this for various builds, combinations, spell cycles and stat distributions. As these options can be combined, the number of possibilities explodes to an unmanageable number.

Here we could apply your 2 methods:

– numerical modeling: given a build, and spell cycle it can calculate which stats you need, their weights etc. If you make it a tad complexer, it could even compare different spell cycles for you and show which stats would work best for which spell cycle. In short, you could, per build, have a cycle light up as best cycle with it’s stats and weights. The downside of this approach being that it is quite complex (tho it’s merely an expansion on your weight number formulae) and limited to spell cycles you enter in the calculation. It is recommended for experienced dps’ers as they can guess good spell cycles or enter experimental ones and compare them. For new players, they might get lost if they start off with bad spell cycles.

– Simulation: using a genetic algorithm we could build a simulator that spawns different builds, point distributions, spell cycles and simulate their effectiveness. This is a whole new level of programming compared to your post’s suggestion even tho it could reuse a lot of the code. Effectively, you replace personal experience and mathcrafting and let your computer fight it out.

Perhaps it would even be better to combine both. Have the machine dig out effective builds, cycles and point distributions and let the calculator maximize/finetune it. :)

by Zusterke June 25, 2009 at 6:31 amDamn, what a monster that would make!

I’ve actually seen simulations used for precisely this, as well as modeling. Usually though the class mechanics are intuitive enough that you can figure out what’s best just from comparing the basic information of the spells/abilities; that is, there are relatively few cases where the result would be significantly different than what a careful perusal of the abilities in their dps/resource form would predict.

It is exceptionally handy for proving that your counter-intuitive rotation/skill usage can actually produce superior results however :D They’re very good for revealing things you hadn’t considered due to previous biases. For instance, those of us who focused on testing DKs during the beta completely failed to find the DW build that was super-dominant in 3.0, primarily because for a very long time in beta, IT was not a good spell for anything other than the disease. It wasn’t until someone else went back and re-examined the coefficients on live that it was revealed to be as broken as it was.

Optimizational theorycrafting can be a pretty deep rabbit hole sometimes :D

by Yuki June 25, 2009 at 3:55 pmIndeed those biases tend to be mind killers. Just recently I read somewhere (was it blizzard fora or Plusheal? can’t recall) that dropping a point from spiritual guidance into blessed resilience could actually boost your output. I would never, ever, have considered that options because I automatically fill that talent since lvl 58.

by Zusterke June 26, 2009 at 6:50 am[…] Continued in: Yuki Learns You Stat Weighting (p2) […]

by How to determine best gear stats (Part 1) | WoWphiles: The WoW Community Blog for players of World of Warcraft June 26, 2009 at 8:24 am