# What are the best practices in theory crafting around generating an optimal spell/ability rotation in an MMO?

When SWTOR rolls out, I'd like to have a firm grip on how to approach the theory crafting of working out my DPS rotation during encounters.

How do I determine and model things like spell coefficients, management of cool downs, haste, and buff procs?

In the past, I've simply consumed data produced by sites like elitistjerks, but I've really never had a handle on HOW they approach modeling these issues.

## 2 Answers

The basic formula is: DPCT = average_damage * modifiers / effective_casting_time. (DPCT = Damage Per Cast Time)

average damage usually is easy: (min + max) / 2. min and max are given in the abiliity description. For dots (damage over time effects), sum all the damage it will do during its lifetime.

effective casting time frequently is easy as well: just read the ability description, and subtract bonusses from talent trees.

modifiers usually are the hard part. The descriptions of modifiers might be clear, but it seldomly is clear whether they are additive or multiplicative when combined.

And even if the description from the game is clear, it might be wrong. Tooltips are not always updated the same patch as the code that does the calculations. As SWTOR recently has had a beta with lots of balancing changes, it's a safe bet that some tooltips will be wrong!

Let me give an example: if two effects each increase damage by 10%, the combination could be 10% + 10% = 20% (additive) or 1.1*1.1 = 1.21 = 21% (multiplicative).

Not much of a difference, but elitistjerks will want to be as exact as possible. This is where things get time consuming: use the ability 1000 times, parse the combat log, and see whether it is closer to 20% or 21% on average. A basic knowledge of statistics might be required to know when you've parsed enough log files.

A quicker trick might be to observe the maximum possible. If the maximum hit is e.g. 100, and there are two 10% increasing effects active, a hit of 121 is a clear indication that the modifiers are multiplicative. If you are able to rule out other causes (other modifying effects, crits, level difference with target, ...).

It gets even harder when effects are coupled: e.g. a very good ability with a cooldown of 12 seconds, but only usuable when another effect with a chance of 25% to happen is active. One cannot assume that this ability will be used every 12 seconds, as that other effect might not be active when the cooldown is finished.

In those cases, it might be easier to simulate a combat. Repeat the simulation many times and take the average. Again: a basic knowledge of statistics might be required to know how many times the simulation should be repeated.

Those are the basics.

For more details, just read the elitistjerks posts. WoW is a complicated games, and has many effects, both multiplicative and additive, so formulas can appear to be complicated. However, the basics are still the same.

Once you grasp each and every detail of the simulations, and as a proof have written some simulations yourself, you might consider to change your job :). Those skills are highly wanted by e.g. banks and insurance companies...

Step1: You need to decide what you're trying to achieve in the model. You can make a model that illustrates many different things:

• DPS over 1 minute.
• DPS over some known duration (such as a boss phase - long, or pvp burst - short).
• AOE DPS given known number of targets.
• Damage potential given a full starting resource
• Damage potential given a full starting resource and accounting for some replenishment over time
• Time until resource is depleted.
• Effective health (this much raw damage kills me)
• Immortality line (this much incoming dps will kill me eventually, otherwise I just heal it back)

There's some more aspects to consider as well. You might want to keep some of these steady while working on others. Don't try to answer all the questions at once.

• Are you determining which talent to pick while leveling or at endgame?
• Are you trying to decide if a new piece of gear is better than what you have with your current setup or an ideal setup?
• Are you trying to decide on a rotation order?
• Do you want to consider the actions/buffs/debuffs of other players. Do you want to consider raid composition? Are you infact modeling, not the character, but the raid.

Step2: You need to measure everything.

• Measure all the abilities damage and cost.
• Measure resource replenishment (mana, energy, etc)
• Measure cooldowns
• Measure the modifiers (how do stats/talents affect what was already known?)

A damage meter (such as Recount in Wow) can be very helpful for this. Log parsing (with timestamps) is another way to go. A low tech approach: timing with a stopwatch and using pen-paper is also possible. To observe modifiers you should simply test with and without them.

Step3: ???

After you've done step1 and step2, you can probably figure this out on your own.

Step4: Profit.

spell coefficients, management of cool downs, haste, and buff procs?

"Spell coefficient" is a modifier. You just test with a range of the stat (int) and observe the change in damage. Then back out the formula from the data. This takes a lot of testing when the spell has a range of damage (you can use average, min or max).

Cooldown abilities and procs are modifiers with durations. The two ways to consider them are percent uptime or simulation. It gets tricky (simulation better than percent uptime) if they behave different when they overlap, or if the player has to/wants to wait for a random event to activate some other ability.