AffLock: Spell Priority List Question

Topics: Rawr.Warlock
Feb 11, 2010 at 1:59 PM

First, thanks to all the awesome volunteers that make Rawr great.  Fantastic idea, fantastic app, great job.

I realize the Warlock module is still being worked on, so forgive me if this question is premature.  It's my understanding that the current 2.3.8 version of the module is more-or-less complete as far as number-crunching is concerned, however, and is just missing pets and the combat event list.  I'm posting under that assumption, so if it's wrong, let me know.

I'm curious about how the spell priority list is calculating its numbers.  I'm assuming (again) that it's taking the listed priorities (for AffLocks, generally accepted to be Haunt > Corruption > CoA > Unstable Affliction > SB filler, or some variation thereof) and calculating a per-stat DPS value based on what contribution each stat would contribute to improving DPS of the given rotation.  If that's wrong, let me know. ;)

This is probably something that wouldn't even come up if the combat event list was functional, but until it is, I just want to make sure that I'm correctly configuring the spell priority to get correct numbers.  Here is, as I understand it, the generally accepted combat events list for an AffLock:

  1. Life Tap (to proc Glyph of Life Tap, granting spirit bonus to spell power)
  2. Haunt (to apply Shadow Embrace, increasing DoT damage, and to "capture" dealt damage for healing)
  3. Corruption (straight-up DoT)
  4. Curse of Agony (straight-up DoT)
  5. Unstable Affliction (straight-up DoT)
  6. Shadow Bolt (filler DD; also stacks Shadow Embrace up to 3x)
  7. Re-cast Haunt when it falls off (also stacks Shadow Embrace up to 3x)
  8. Re-cast UA when it falls off
  9. Continue re-casting as necessary

The missing component (which I understand is coming in the future, so I'm not including it for now) is Drain Soul's < 25% HP execute, which replaces Shadow Bolt in the priority list after that line has been crossed.  I've left this out of my Rawr priority list for that reason.

So, after all that, my question is: is Rawr doing what I assume it is with spell priorities, or is it handling it in a different way? 

Thanks!

Feb 11, 2010 at 4:15 PM

Most likely, yes.  However, see issue # 16291 - it appears that the talent Everlasting Affliction isn't working.  This means that Corruption falls off, requiring recasting it frequently.  This will alter the Haste/Crit usefulness.  Trinket Procs are also screwed, particularly the #3 BiS trinket for Affliction Locks [NIC].  Between the lack of pets working [and therefore Dark Pact working properly], everlasting affliction borkedness, trinket issues and drain soul problems - I wouldn't trust the model to provide precise gearsets.

Feb 11, 2010 at 4:46 PM
Edited Feb 11, 2010 at 4:48 PM

The quick answer is: yes - the combat simulator is built around a priority queue, and will cast each spell based on its priority in the event timeline.

 

Think of the combat simulation as a sequence of events over time, starting at 0 and finishing at say 300 (for 5 mins combat).

At the start of combat, all spells in the queue have the same priority (i.e. 0). (General rule of thumb in this implementation is that when spells have the same priority, the simulator casts them in FIFO order.)

 

The casting process is (briefly):

- remove spell at the front of the queue,

- evaluate damage (miss, hit, crit)

- re-prioritize, i.e. take the current event simulation time and calculate when the spell should be recast (based on its cooldown, duration, casttime or gcd [in that order])

- add it to the back of the queue

- rinse / repeat until the end

- calculate total damage,

- calculate an effective DPS value (which is a quick and dirty TotalDamage / ActiveTime - not really 100% correct, but it will do for now)

 

Now thats just 1 simulation. This gets repeated for every single item in the comparison list and compared to the baseline for your actual gear.

 

Having said all that, its still a work in progress and there are some buff mechanics (e.g. Everlasting Affliction) on my todo list.

Feb 11, 2010 at 5:21 PM
Edited Feb 11, 2010 at 5:30 PM

I had a go at the code trying to fix the warlock model, atleast for affliction. I found the spell priority system a bit redundant, yes, it can be used to provide very precise results, but it will take alot of work imo. What I did was to replace it with a simple model, just calculate DPS on all spells, assume 100% uptime on dots and haunt, then figure out time left to cast filler spell(shadowbolt or drain soul). No priority system, no combat simulation, not accurate, I know, but it's not Rawr's job to tell exacly what DPS you will be doing, but figure out what item that will give you the most DPS increase.

 

One or two drawbacks with this model, no ramp up time, so very inaccurate DPS on short fights, stat values _should_ be correct though.  Also having problems figuring out haste softcaps, but i'm working on that one.

Feb 11, 2010 at 5:46 PM

That's exactly the same approach that's used in the warlock spreadsheet. Its not very accurate though.

Feb 11, 2010 at 5:50 PM

Thanks, Karindra and ArPharazon. :)

Neurohex wrote:

I had a go at the code trying to fix the warlock model, atleast for affliction. I found the spell priority system a bit redundant, yes, it can be used to provide very precise results, but it will take alot of work imo. What I did was to replace it with a simple model, just calculate DPS on all spells, assume 100% uptime on dots and haunt, then figure out time left to cast filler spell(shadowbolt or drain soul). No priority system, no combat simulation, not accurate, I know, but it's not Rawr's job to tell exacly what DPS you will be doing, but figure out what item that will give you the most DPS increase.

 

One or two drawbacks with this model, no ramp up time, so very inaccurate DPS on short fights, stat values _should_ be correct though.  Also having problems figuring out haste softcaps, but i'm working on that one.

Er, I think this is going to produce wildly inaccurate gear predictions, actually. You can't just calculate the DPS of a spell without accounting for talents, procs, and stacking, which requires simulation and modeling. AffLocks, in particular, do substantially more damage the longer they're fighting.

Personally, I would prefer accuracy (and giving ArPharazon the time he needs to implement it) over a generic semi-sorta-okay boilerplate calculation that could diverge wildly from actual experience.

Feb 11, 2010 at 6:47 PM
Edited Feb 11, 2010 at 6:55 PM
You can't just calculate the DPS of a spell without accounting for talents, procs, and stacking, which requires simulation and modeling

All buffs and procs are in account, but no synergy between the procs/buffs during the active time on the procs.  It will affect DPS calculation, but I belive it will have very little effect on stat values (except haste stacking and reaching haste softcaps, but I think that can be worked out).

 

Also, the combat simulation give an inaccurate haste value in it's current form, haste it worth nothing unless it's value is high enough to allow the simulator to cast an extra spell.

Feb 11, 2010 at 6:51 PM

Personally, I would prefer accuracy (and giving ArPharazon the time he needs to implement it) over a generic semi-sorta-okay boilerplate calculation that could diverge wildly from actual experience.

As corny as this sounds, THIS.  As much as I complain about how long things are taking, I'd rather have a 99.99% accurate model available in April than a 95% accurate model in February.  Well, I guess the ideal would be having both, with the 95% accurate being fully labeled as inaccurate.

Since nobody here knows me, I just thought I'd mention I'm a Civil Engineer.  Math is my strong suit; people aren't.  And as an Engineer, I get mortally offended by the idea of being compared to "Software Engineers" - if my work had half as many issues as most programs I see - commercial or not - I'd be destitute and homeless.  So, I tend to be harder on programmers than most people; most programmers I talk to seem to think 95% is good enough, when it really isn't.

Oh yeah, and I'm an asshole.  Can't forget that.  But hey, I'm cognizant of this and fully admit it.

Neurohex, the model you are discussing would be terribly, horribly inaccurate.  Something like it *might* come close to accuracy for a Destro spec, but would be next to worthless for Affliction - between ramp up times, specially-timed procs, DoT uptime losses and execute range, a model is required.  Warlocks don't [well, rarely] clip dots and there's always a priority of spells to reapply, so 100% uptime is a pipe dream.  UA, CoA and Haunt will have cast-time collisions dozens of times in a single fight; each one will drop uptime.  I'd rather do the math by hand <shudder> then use a spreadsheet or other system that did that.

 

Feb 11, 2010 at 7:01 PM

You can estimate the dps of a spell (taking talents, buffs) into account without having to do a full simulation :P

 

The main difference is that the spreadsheet model (which is the approach that Neurohex is following) only looks at 1 minute of combat, which is not accurate enough imo.

The simulation model attempts to replicate all combat events over the fight duration. Yeah it is a lot of work, but worth it in the end.

Feb 11, 2010 at 7:10 PM
Since nobody here knows me, I just thought I'd mention I'm a Civil Engineer.  Math is my strong suit; people aren't.  And as an Engineer, I get mortally offended by the idea of being compared to "Software Engineers" - if my work had half as many issues as most programs I see - commercial or not - I'd be destitute and homeless.  So, I tend to be harder on programmers than most people; most programmers I talk to seem to think 95% is good enough, when it really isn't.

Oh yeah, and I'm an asshole.  Can't forget that.  But hey, I'm cognizant of this and fully admit it.

Neurohex, the model you are discussing would be terribly, horribly inaccurate.  Something like it *might* come close to accuracy for a Destro spec, but would be next to worthless for Affliction - between ramp up times, specially-timed procs, DoT uptime losses and execute range, a model is required.  Warlocks don't [well, rarely] clip dots and there's always a priority of spells to reapply, so 100% uptime is a pipe dream.  UA, CoA and Haunt will have cast-time collisions dozens of times in a single fight; each one will drop uptime.  I'd rather do the math by hand <shudder> then use a spreadsheet or other system that did that.

 

 Hey, go easy on me then, I'm a truck driver, not a programmer! ;)

Developer
Feb 11, 2010 at 7:37 PM

Hey Karindra, I already like what you say :D

 

I agree entirely on what you say with software issues. However this isn't a full time job for any of us, so its slightly unfair if you intended to compare your work to what we do in Rawr.

 

And yes, the rotation of Affli/Demo and ShadowPriests is horrid to get right due to collisions. And sometimes a collision lots later might make an earlier choice wrong, although it looked smart earlier. Rawr attempts to model play, not simulate it, mostly for performance reasons.

Feb 12, 2010 at 11:24 AM
ArPharazon wrote:
...............

He lives!!

Welcome back m8!

To be frank ill go ahead and ask the question on behalf of the rest of us demon-magic users out there..... Makin any progress with the module?

Good luck!

Feb 12, 2010 at 2:09 PM
ArPharazon wrote:

At the start of combat, all spells in the queue have the same priority (i.e. 0). (General rule of thumb in this implementation is that when spells have the same priority, the simulator casts them in FIFO order.)

This is a bit confusing. Say, for example, that I like to open combat with Haunt. My instinct would be to put Haunt at the top of the priority queue. However, Haunt has a cast time of 1.5s (or so, depending on buffs, equip, etc.). Suppose I have Corruption next in my queue. When you say "FIFO," does that mean that since Corruption would go out "faster" (no cast time), it would get cast before Haunt, despite being lower in the priority list?

- re-prioritize, i.e. take the current event simulation time and calculate when the spell should be recast (based on its cooldown, duration, casttime or gcd [in that order])

I'm a little uncertain why cooldown comes before duration. Using Haunt as an example again, Haunt's cooldown (8sec) will generally be up before it finishes its duration (12sec). That's an extra 4 seconds of cast time for something else that, if I understand you correctly, would be "wasted" re-casting Haunt while it's still on the target.

Have I got it wrong?

Feb 12, 2010 at 7:24 PM
McC wrote:
ArPharazon wrote:

At the start of combat, all spells in the queue have the same priority (i.e. 0). (General rule of thumb in this implementation is that when spells have the same priority, the simulator casts them in FIFO order.)

This is a bit confusing. Say, for example, that I like to open combat with Haunt. My instinct would be to put Haunt at the top of the priority queue. However, Haunt has a cast time of 1.5s (or so, depending on buffs, equip, etc.). Suppose I have Corruption next in my queue. When you say "FIFO," does that mean that since Corruption would go out "faster" (no cast time), it would get cast before Haunt, despite being lower in the priority list?

- re-prioritize, i.e. take the current event simulation time and calculate when the spell should be recast (based on its cooldown, duration, casttime or gcd [in that order])

I'm a little uncertain why cooldown comes before duration. Using Haunt as an example again, Haunt's cooldown (8sec) will generally be up before it finishes its duration (12sec). That's an extra 4 seconds of cast time for something else that, if I understand you correctly, would be "wasted" re-casting Haunt while it's still on the target.

Have I got it wrong?

Haunt is a very odd spell.  Under truly ideal circumstances, you would cast it every 11.5 seconds.  However, this true ideal is [almost] never in play.  It's a missile spell, meaning it has travel time - coincidentally, at maximum range it takes about 1.5 seconds to travel [12 seconds - 8 seconds - 1.5 second cast = 2.5 seconds, leaving only a slight lag overlap], so casting it on CD is the way to go unless you are in melee or very close to melee.  Keep in mind that while the damage it does is extremely minimal, the buff is vital.

I'm hoping that ArP is actually intending different things when he says priority vs. cast order; starter rotation needs to be different than continuing rotation.  Example standard rotation, keeping in mind that LT/DP needs to be cast @ 40 second cd's as well:

  1. Haunt
  2. Corruption [should be kept rolling]
  3. Unstable Affliction
  4. Curse of Agony
  5. Drain Soul @ <25% HP
  6. Shadow Bolt

However, this isn't the ideal start rotation.  To start, I suggest (assuming you are using the NIC, and that the fight will allow you to keep corruption rolling:

(pre-combat) LT rank 1, Pot of Wild Magic [time this correctly, you don't want to waste it during BL - wait if BL is cast early]

  1. Shadow Bolt
  2. Shadow Bolt
  3. Haunt
  4. Unstable Affliction [use NIC after casting UA if you have it]
  5. Corruption [recast NIC and refresh @ 35%]
  6. Curse of Agony
  7. Drain Soul @ <25% HP
  8. Sbolt otherwise [if you are the only demo/affliction lock or if you are assigned Shadow Mastery duty, Sbolt often enough to keep it up]

This rotation allows you to stack up Shadow Embrace with the initial Sbolts and Haunt, and casting UA between Haunt and Corruption allows the Haunt missile to land (it can crit, which would reduce the NIC proc by 4% before corruption is cast).  By stacking all of these abilities at the front-end of the fight, Corruption's crit rating should be somewhere around 50-60% even for a poorly-crit-centric warlock.  If you don't have the NIC available, the initial rotation changes to

  1. Pre-combat Lifetap/Pot
  2. Shadow Bolt [to try to proc Shadow Mastery and add a stack of SE]
  3. Haunt
  4. Unstable Affliction
  5. Corruption [refresh @ 35%]
  6. Curse of Agony
  7. Drain Soul @ <25% HP
  8. Sbolt otherwise [if you are the only demo/affliction lock or if you are assigned Shadow Mastery duty, Sbolt often enough to keep it up]
Feb 12, 2010 at 9:37 PM

Karindra wrote: Haunt is a very odd spell.  Under truly ideal circumstances, you would cast it every 11.5 seconds.  However, this true ideal is [almost] never in play.  It's a missile spell, meaning it has travel time - coincidentally, at maximum range it takes about 1.5 seconds to travel [12 seconds - 8 seconds - 1.5 second cast = 2.5 seconds, leaving only a slight lag overlap], so casting it on CD is the way to go unless you are in melee or very close to melee.  Keep in mind that while the damage it does is extremely minimal, the buff is vital.

You do not need to factor in travel time, since the debuff didn't start until that long AFTER the last cast.  So you still only need to cast every [cooldown - cast_time] seconds to keep 100% uptime.  Unless you are farther away this time than you were last time, in which case you have to cast a little earlier to make up the *difference* in travel time.

Feb 12, 2010 at 11:59 PM
Edited Feb 13, 2010 at 12:03 AM

erm - I never said "priority vs cast order" anywhere in my original post, but yes - your example outlines exactly what I mean Karindra.

At the start of combat, all spells have priority 0, they are performed in the order listed (btw FIFO = first-in-first-out), so Shadowbolt > Haunt > UA > Corr > CoA and so on.  [basically shadowbolting before haunt to get maximum stacks of the shadow buff up].

As each spell is cast, I take the current event time and calculate when that spell must be cast again (based on cooldown > duration > its actual cast time or GCD), which basically means that the continuing rotation (I hate that word) will definitely be different - infact its very likely that UA, Corr and CoA will trade places due to their different durations. Haunt is basically cast on every cooldown, and the rest of the time is spent spamming shadowbolts.

Please note that the simulator is quite basic at the moment, and will be updated to handle pre-casting actions and also the execution phase just as soon as I get pets finished (aiming for today!).

Feb 13, 2010 at 2:32 PM
ArPharazon wrote:

(I hate that word)

Perhaps 'sequence' might be more accurate and palatable?

Please note that the simulator is quite basic at the moment, and will be updated to handle pre-casting actions and also the execution phase just as soon as I get pets finished (aiming for today!).

Awesome! Thanks for the update. :)

Feb 14, 2010 at 7:08 PM
ArPharazon wrote:

erm - I never said "priority vs cast order" anywhere in my original post, but yes - your example outlines exactly what I mean Karindra.

At the start of combat, all spells have priority 0, they are performed in the order listed (btw FIFO = first-in-first-out), so Shadowbolt > Haunt > UA > Corr > CoA and so on.  [basically shadowbolting before haunt to get maximum stacks of the shadow buff up].

As each spell is cast, I take the current event time and calculate when that spell must be cast again (based on cooldown > duration > its actual cast time or GCD), which basically means that the continuing rotation (I hate that word) will definitely be different - infact its very likely that UA, Corr and CoA will trade places due to their different durations. Haunt is basically cast on every cooldown, and the rest of the time is spent spamming shadowbolts.

Please note that the simulator is quite basic at the moment, and will be updated to handle pre-casting actions and also the execution phase just as soon as I get pets finished (aiming for today!).

I apologize, I was unclear.  I meant that when you said "At the start of combat, all spells in the queue have the same priority (i.e. 0)" you meant that that they all needed to be cast, not that they wouldn't be cast in a specific rotation.  The vs. cast order was my short-form way of telling myself to edit it when I could think of a way to phrase it better; I got interrupted halfway through the post and forgot to change it.  FIFO and all spells being priority 0 would tell me that the spells would be launched in a way to get them all on the boss asap [because instant are faster to get out than shadowbolt, for example] if I followed the logic pedanticly.  [I prefer FCFS; I know it's a little inaccurate but what can you do?]