The Unofficial ShadowCraft Documentation-Resource Budget Modeling

One of the most basic questions when writing a model is what is the model actually modeling? Those of you who have been around the rogue community for a while will remember the Wrath (and earlier) notation of “3s/5r/5e” corresponding to 3 cp slice and dice, 5 cp rutpute, 5 cp eviscerate. This fixed rotation is clearly an abstraction however it exposes a useful concept which is still used in ShadowCraft today, resource budget modeling (my term).

There are three basic ideas of resource budget modeling:
1) Rogue ability selection can be defined in terms of finisher usage.
2) Certain finishers must be kept up 100% of the time and can be considered a fixed cost.
3) The duration of one of these 100% uptime finishers defines a time slice or cycle.

Bringing these three ideas together we have a pool of resources per cycle. Since we are being finisher centric the next step is to define the energy cost of one finisher, that is the energy cost of both the combo points and the finisher. This can actually be a bit more complex than it seems as I’ll discuss in a later post but the simple solution is reasonably apparent. Simply divide the target number of combo points per generator by the total combo points for the finisher noting that the total number of combo points per generator includes things like blindside procs.

Now we have energy costs per finisher and we have a resource pool of energy per cycle. By assuming 100% uptime on certain finishers those finishers can be considered a fixed cost in our resource pool and whatever is left over can go into the “spammable” finisher, eviscerate or envenom. With numbers of each finisher per cycle, a cycle duration and combo generators per cycle we can generate attacks per second for each ability. There are some complexities the above discussion ignores, honor among thieves combo points as subtlety and revealing strike rather than sinister strike usage as combat but both of those can be handled using basically the same approach.

Now some code. Since this is the first post in this series a quick word on how ShadowCraft is organized. The major theorycrafting function in ShadowCraft is the attack_counts function for each spec. These functions drive ShadowCraft generating a list of attack counts per second for each ability that is then used to do the actual damage computation.

For this code example we’re going look at the assassination anticipation attack counts function because it is the simplest. From line 1648 in ShadowCraft. From here on the line numbers will refer to line numbers in the code block below.

cp_per_finisher = 5
avg_rupture_length = 4. * (6 + self.stats.gear_buffs.rogue_t15_2pc_bonus_cp()) # 1+5 since all 5CP ruptures
avg_wait_to_strike_connect = 1 / self.geometric_strike_chance - 1
avg_gap = 0 + .5 * (avg_wait_to_strike_connect + .5 * self.settings.response_time)
avg_cycle_length = avg_gap + avg_rupture_length
attacks_per_second['rupture'] = 1 / avg_cycle_length
rupture_ticks_per_second = 2 * (6 + self.stats.gear_buffs.rogue_t15_2pc_bonus_cp()) / avg_cycle_length # 1+5 since all 5CP ruptures
attacks_per_second['rupture_ticks'] = [0, 0, 0, 0, 0, rupture_ticks_per_second]

energy_regen_with_rupture = energy_regen + attacks_per_second['rupture_ticks'][5] * vw_energy_per_bleed_tick
energy_per_cycle = avg_rupture_length * energy_regen_with_rupture + avg_gap * energy_regen
cpg_per_finisher = cp_per_finisher / avg_cp_per_cpg

energy_for_rupture = cpg_per_finisher * cpg_energy_cost + self.get_spell_stats('rupture', hit_chance=self.geometric_strike_chance, cost_mod=ability_cost_modifier)[0]
energy_for_rupture -= cp_per_finisher * self.relentless_strikes_energy_return_per_cp
energy_for_envenoms = energy_per_cycle - energy_for_rupture

envenom_energy_cost = cpg_per_finisher * cpg_energy_cost + self.get_spell_stats('envenom', hit_chance=self.geometric_strike_chance, cost_mod=ability_cost_modifier)[0]
envenom_energy_cost -= cp_per_finisher * self.relentless_strikes_energy_return_per_cp
envenoms_per_cycle = energy_for_envenoms / envenom_energy_cost

envenoms_per_second = envenoms_per_cycle / avg_cycle_length
cpgs_per_second = envenoms_per_second * cpg_per_finisher + attacks_per_second['rupture'] * cpg_per_finisher

Since slice and dice is refreshed by envenom we use rupture to determine cycle length. Lines 1 through 8 above determine the length of the cycle. Line 2 handles the length of rupture so it checks for the existence of T15 2pc. Lines 3 and 4 handle the additional time caused by miss rates and player reaction time.

Lines 10 through 12 determine the resource pool, note that line 11 makes a distinction between the portion of the cycle with rupture up and the portion without rupture up.

Lines 14 through 20 determine the total costs of each finisher. Lines 14 and 18 account for the additional cost added by misses and lines 15 and 19 handle relentless strikes. Line 16 computes the remaining energy available for envenom and line 20 uses that number to determine how many envenoms are used per cycle.

Finally lines 22 and 23 convert those envenoms per cycle into envenoms and combo generators per second.

Beyond this the computed values are written into the attacks_per_second list for damage calculations. I did not show the computation of combo points per combo generator but that can be found above the discussed section.

If you would like to look at how other spec’s resource budgeting works you can look at sections starting at line 1522 (assassination no anticipation), 1919 (combat) and 2225 (subtlety).

Since this is the first post in what I hope will be a long running series I’m still trying to work out some of the formatting. Any feedback on where things are unclear would be welcome. ShadowCraft is also a big topic so if there is some part of it you are especially curious about let me know in the comments on twitter.

The Unofficial ShadowCraft Documentation-Introduction

In my very first post on this blog I talked about the difference between simulations and models. Simulations most people get, they correspond pretty closely to how most people think about theorycrafting and testing. Run a test of some behavior and look at the results. Models are a bit trickier because models rely on simplifying assumptions which can often be somewhat obtuse. The goal of this series of posts is to to explain those simplifying assumptions and show examples of them within the ShadowCraft codebase.

Another goal of this series is to get more people looking at and contributing to the ShadowCraft codebase. I know from experience the ShadowCraft codebase can be very intimidating to start working through partially because there isn’t an obvious starting point. By showing and explaining pieces of the ShadowCraft model I hope to make the prospect of digging into ShadowCraft a bit easier.

ShadowCraft is written entirely in Python, for the purposes of this series I am going to assume the reader has a decent understanding of Python. There are some pieces of code which are a bit obtuse and I there I will explain the syntax to an extent. For people who don’t know Python I will still explain the underlying concepts in plain English (and possibly a little math). If you do want to learn Python I recommend the free book A Byte of Python. Python is one of the easier programming languages to learn and is about as close to plain English as a programming language can get. For those with experience with C style languages (Java, C, C++, C#, etc.) a lot of Python syntax should look very familiar.

A final caveat, ShadowCraft is an actively developed project so the code samples I use may not be what ShadowCraft actually uses at the time you are reading this however the focus of this series are the underlying modeling techniques which should still remain broadly applicable even if the code changes.

Rogue Spec Balance in High End Raiding

In my last post about subtlety I briefly mentioned the goal of spec balance without really going into details on how Blizzard can create it. A recent post by Lore about combat dps addresses the question of spec balance at the high end of progression raiding so lets talk about spec balance a bit more.

Rfeann, over at his essential rogue blog, questioned whether spec choice is possible for players on the high end. This is a common view however I think it ignores the fact that high end players have the same sorts of spec preferences as everyone else. They may not act on their preferences as often but if given the opportunity they certainly will. The issue is giving them that opportunity which requires two things:

    1) The specs are overall reasonably close. What reasonably close means is a tricky question but probably within 3-5% all things being equal.
    2) Specs have slight advantages on certain fights that cater to their spec strengths.

To use a recent example, consider combat in T14. During T14 there were a number of players, most prominently Killars in vodka, who played combat as their primary spec. This was viable because combat and assassination were reasonably close in dps potential and more importantly there were a number of fights that catered to combat’s cleave advantage. As we all know, Blizzard did decide to nerf combat’s cleave advantage because it was too powerful however even in its nerfed form combat would likely have been equally viable in T14. While combat would have been weaker on fights like Stone Guard and Garalon fights like Empress Skekzeer and Sha of Fear would have benefited from the new blade flurry design.

Spec balance at the high end hinges heavily on (2), a player, even a high end progression player, can to an extent, justify weaker dps as a tradeoff for stronger dps on other fights. If the dps difference on sub-optimal fights for a given spec is small enough (point (1)) greater gear optimization and spec familiarity can cover that difference.

The problem in T15 is twofold, first combat while close on paper required putting up with the excessive spamminess and latency dependence of T15 4pc. Secondly, and more importantly, there isn’t much in ToT for combat to take advantage of it’s niche, blade flurry is useful on Council but does not have a strong advantage over assassination rupture multi-dotting on much else. Compare this to the number of fights this tier with an important execute range burn and its easy to see why most players gravitated toward assassination.

Blizzard has shown that it can balance dps reasonably well, the tuning knob abilities like Assassin’s Resolve and Vitality serve their purpose well however for spec balance to be achieved more attention needs to be paid to dps niches. Assassination is too good, at too many things or at least too many broadly applicable niches whereas combat and subtlety are left with much more situational niches. There is also the issue of difficulty, while balancing around spec difficulty can undermine spec balance and difficulty is difficult to objectively judge, it is hard to honestly say that assassination is as difficult as combat or subtlety. Assassination is a substantial difficulty outlier compared to other rogue specs and other specs in general and increasing the complexity of the spec is probably needed for long term spec balance. Additionally if T16 design features more fights that favor combat’s cleave niche that would go a long way toward making combat a more common default spec.

Spec balance isn’t easy, it exists at the intersection of a lot of complex mechanics, dps niches, rotational complexity, fight design and even loot distribution play a role (If your raid group runs an enhance shaman, windwalker or brewmaster monk combat may be less optimal given weapon sharing) but it isn’t impossible. I am fond of citing T8, T12 and T14 as tiers where at least two rogue specs were used as default specs in high end raiding. If Blizzard is serious about spec balance, and the 5.2 blade flurry nerf suggest they are, more attention needs to be paid to combat and subtlety spec niches as well as assassination rotational complexity. This is probably not something that can be solved in a mid-expansion content patch however if rogues do get a substantial redesign for 6.0 hopefully these issues will be looked at carefully.

Haileaus on Subtlety Positional Requirements

During some of the forum discussions of subtlety positional requirements Haileaus, the author of the EJ and official forum Subtlety Guides and one of the more prominent subtlety boosters in the rogue community, approached me to write a guest post with his view on subtlety positional requirements. Given Hail’s experience with subtlety and as one of the more vocal subtlety rogues in the community I thought his perspective would be both interesting and instructive.

Hey all. First, note that when I refer to BS, I actually mean Backstab and Ambush; similarly, Hemo refers to Hemorrhage and Garrote.

Understanding the issue

It’s pretty easy to grasp the issue on a basic level: In PvE, subtlety rogues can only be competitive if they are attacking a mob from behind. This means there are certain fights for which a rogue simply cannot justify playing subtlety based solely on mechanics.

That said, let’s look a bit deeper. BS is a subtlety rogue’s main combo point generator. Hemo’s place is as a bleed, BS’s place is as a Ka-POW! With that in mind, there’s a distinct psychological difference between Hemo and BS rotations. Instead of our rotation being like “Ka-POW! (HaT) Ka-POW! Ka-POW! (HaT) EVISCERATE!! It becomes, HemoSpamTillICanGetAnEVISCERATE!! Note the difference in the number of capital letters and exclamation points. Alright, that was far from technical, but seriously. BS is perceived as the subtlety rogue’s main CP generator (Or in the case of Ambush, a super cool buffed generator) and Hemo as a maintenance DoT (or in the case of Garrote, useless and disappointing). Even if the difference between using BS and Hemo is under 1%, losing out on the ability to use our main generator sucks. Have you ever fought a frontal boss as sub and had to use garrote instead of ambush during Shadow Dance? It feels terrible, because you know you *should* be using ambush. Similarly, when fighting a mob from the front, there’s a distinct feeling of “I should be behind you to use BS.”

So yeah, there’s the issue of balancing PvE, and that is very important, but one thing that should be considered is the fact that even if mastery/Hemo were buffed to the point where a Hemo build was viable from behind, it would still feel wrong.

Comparing Positional Requirements to Old Blade Flurry

Lately I’ve come to the conclusion that the BS positional requirements are the evil twin of the old Blade Flurry. For those of you who don’t remember, BF used to cleave 100% of physical damage to a second target. This made combat the spec to play for any cleave fight. Many raiders felt compelled to have a combat off-spec since for certain fights since it was so completely OP. Combat was already pretty decent (generally a bit lower than the other two theoretically on single target DPS), but BF, with its ~80% damage boost, made raid leaders ask their rogues to go combat for certain fights. Trust me, I know.

Let’s do some comparing:

(Cmt) In certain fights, due to mechanics, combat rogues would have a clear advantage – so much as to compel people to respec solely for BF. (sub) In certain rights, subtlety rogues have a clear disadvantage – so much as to compel people to respec solely to be able to play their spec to its potential.
(Cmt) The norm is single target, which means being able to cleave with BF is a bonus. (Sub) The norm is behind the boss, which means not being able to BS is a punishment.
(Cmt) BF hurt players by pressuring them to play a spec which they may potentially dislike. (Sub) Positional requirements hurt players by pressuring them to not play a spec which they may potentially prefer.
(Cmt) BF made it possible for there to be two “wrong” specs for certain fights. (Sub) BS makes it possible for there to be a “wrong” spec for certain fights.

I don’t know about you, but this sort of comparison helps me alot, because the issue with BS is a lot like that of BF. Yeah, sure, there are differences, but the crux of the issue is that on certain fights one spec performs vastly differently than average solely due to fight mechanics. With BF, that meant combat was OP sometimes. With BS, that means sub is UP sometimes.

Trying to balance around this is incredibly difficult, especially with players being able to switch specs on the fly. Now yes, it is easier to balance sub’s frontal damage to be more in line with other specs by buffing Hemo, but you still run into the issue of sub rogues wanting to use BS. Also, garrote during ShD will never stop sucking.

When you put positional requirements into this context, it is easy to see that it is an issue of spec health. Since very recently, I had always viewed positional requirements as a skill issue, and something to justify higher theoretical dps. Fact is though, it is only a skill issue in PvP; and I’m not convinced the higher theoretical dps needed to bump sub up would be consistent enough through the patches to make it worthwhile. (That said I think sub’s place during DS was about right) It’s easy to say “that’s the way it’s always been,” and leave it at that, but tradition for the sake of tradition rarely makes logical sense. This one mechanic clearly has hurt the spec, and will continue to have a toxic influence on it regardless of its current viability, theoretical or otherwise. With that in mind, something does have to change. The question though, is what? After all…

Subtlety Rogues do it from Behind

Don’t try to fool me, I know a lot of you feel it too. What if the positional requirements were outright removed? You’d see all those little nublet sub rogues using their wee BSs facing the enemy. There’s just something so wrong about that isn’t there? In theory I like some of the ideas about a bonus from attacking from behind with Backstab, but as Fierydemise noted, removing the positional requirements and buffing BS from behind is mechanically the same as removing the positional requirements and nerfing BS from the front – which is almost the same as buffing Hemo’s base damage and nerfing its bleed (to keep the Hemo DoT damage unchanged; this is only the same outside ShD). The problem with that approach (as laid out by my host earlier) is that you still have an unnaturally large gap between sub’s frontal dps and its back dps. Thus you may have closed the gap a bit, but the same issues persist, including the feeling that you aren’t getting the most out of your abilities when you are facing the target. And with that, I’ve backed myself into a corner. Of course, a good rogue always has another option.

Tear Down The Wall!

All of these issues stem from the assumption that sub rogues, with their Stealth and Backstabs and Ambushes, just want to sneak up behind someone and kill them before they turn around. Maybe I’m self-projecting, but I do think there’s a belief that if you are a subtlety rogue and you are face-to-face with your enemy, you’re doing it wrong. Well guess what, NPCs have parry, so if you are a melee and are face-to-face with your enemy, you’re already doing it wrong. Fact is a good combat rogue will maximize their time behind the boss just as much as a good subtlety rogue. I don’t know about you, but when I am in the right position, pressing my buttons at exactly the right time, I get a great deal of satisfaction, and I sure as hell don’t need a nerf to my BS when I am facing the boss to remind me that such behavior is highly suboptimal.

I don’t care if BS is an outdated mechanic or not. That’s an irrelevant and stupid argument that holds no meaning. What I do care about, is the state of subtlety PvE. When the viability of a spec depends so strongly on how many fights in the current tier have a specific mechanic, something is wrong. When something is wrong, something needs to change. Removing the positional requirements of BS would change optimal play only in the sense that it would allow the spec to be played to its fullest capacity on every fight, which can only be a good thing. Yes, the positional requirement of subtlety is part of its identity, but so was the old Blade Flurry; just because something is part of one’s identity doesn’t mean it isn’t toxic.

Oh Yeah, that PvP Thing

All you PvPers whining about how sub’s positional requirements should be removed are being dumb. Getting behind a player really isn’t that hard. That said if the positional requirements were removed I wouldn’t think much would change in PvP – at least not in the higher brackets. (I did Tweet Rzn asking what his take on it would be. His response was “would be interesting…that would mean i could play on EU servers more efficiently :P” (Source) Honestly I’m not sure what to make of that.

A Final Aside

With the introduction of LFR contact with bad tanks has become a lot more frequent, and as such positional requirements have gotten a lot more annoying, so there is now something to be said for the quality of life argument. I haven’t tried Brawler’s Guild, but I hear disgruntlement on that front as well.

Subtlety and Positional Requirements

For the past week or so I’ve been engaged in several long arguments on the official forums about the viability of Subtlety PvE and positional requirements. In this post I want to present an organized case for why positional requirements should be outright removed from subtlety for PvE balance reasons. If you’ve read some of my official forum rants this will look somewhat familiar, if you haven’t this may still look somewhat familiar but hopefully a bit less so. This is going to be the first in a series of posts about subtlety, with a guest post from Haileaus on this topic and either this week or next week I plan to run subtlety during my farm this week to actually get some experience with the spec.

The basic problem with positional requirements in rogue PvE is that rogues have options that means that subtlety’s positional requirements must be balanced against the other rogue specs. This makes the balance picture for subtlety substantially more complex than it is for feral although for consistency and because positional requirements don’t work well given current raid design trends I support removal of feral positional requirements as well.

Before I get into a discussion of why positional requirements are a balance mess lets first outline our goals. The fundamental goal of spec balance is to allow all players at any level of progression to play their prefered spec without feeling like they are a liability to their raid group. For LFR and normal mode raiders Blizzard has already achieved this but for heroic, progression oriented raiders it is still a problem. Getting the exact tuning target for this correct is hard because you have to balance around dps niches and other factors such as target swapping capabilities but Blizzard has been able to do reasonably well with combat and assassination balancing in the past so clearly its doable.

This brings us to the big problem with positional requirements they make this already difficult but basically achievable balancing act that much harder. Blizzard must set a positional uptime to balance subtlety around, on fights where subtlety can achieve greater positional uptime, subtlety is doing more damage than intended and vice versa. What distinguishes this from other forms of dps niches (cleave, multi-dot, execute, etc.) is how all encompassing it is. If Blizzard wants to limit multi-dotting they can have tools for that, if they want to limit cleave they can reduce AoE damage taken or force targets to be separated but with single target damage it is much harder.

There is a larger problem as well that I mentioned above, rogues can swap specs. If a fight isn’t good for subtlety because of lack of positional uptime a rogue can always swap to combat or assassination. The question becomes if you are swapping to another spec on a decent number of fights in a tier and you aren’t gaining any benefit from playing subtlety then why play subtlety at all? This is the real question for anyone looking to play subtlety, if for some fights I may have to go combat then why not be combat all the time? If subtlety with good positional uptime only does comparable damage then it becomes very hard to justify without some other substantial utility advantages. This means our balance point must be fixed such that subtlety is balanced versus other rogue specs with less than ideal positional uptime and doing significantly more damage with full positional uptime. This design of course has the opposite problem, now every progression rogue is sitting on a subtlety off spec for those fights where you can achieve high positional uptime.

In discussions on this topic there are a few frequent objections or solutions proposed to the above mentioned balance problems. The most common and popular response is a proposal to remove the positional requirements from backstab and ambush but grant some form of buff when attacking from behind. There are a couple problems with this solution, first and most importantly this solution doesn’t actually solve anything. If backstab now has no more positional requirements but does 236% weapon damage when attacking from the front, and 275% weapon damage when attacking from behind, congratulations you have changed nothing (note that hemorrhage deals 203% weapon damage at 5 less energy so 35*(2.03/30)= 2.36). This solution despite being functionally identical to the current system is in fact worse because it provides no feedback mechanism. In the current design if backstab isn’t usable you know you aren’t behind the target, in this new design if you are just outside of the positional arc you will be doing less damage without an obvious indication.

The basis of this proposed solution is an objection from flavor saying positional requirements are an integral part of what makes subtlety, subtlety. The central problem with objections from flavor is that flavor should not override balance or good game design. For instance it would make sense from a flavor perspective if plate wearers moved slower since plate armor is heavy and restricts movements however that isn’t a WoW mechanic because it creates its own balance difficulties. Blizzard has on occasion held onto flavor mechanics despite balance considerations but most of those cases, most prominently shaman totems during Cataclysm were eventually removed because of balance considerations. Fundamentally flavor must be subservient to balance if balance is the primary goal.

Another common objection to removing positional requirements from subtlety is, you should be behind the boss anyway to avoid parries so positional requirements shouldn’t be an issue. This objection ignores current raid design trends and mechanics. As I suggested above there are certain raid mechanics which are fundamentally not amenable to positional requirements. Consider for instance Durumu, most groups to handle the maze stack up below the beam and then move to the start location when it appears, on heroic you stack even earlier to handle the ice walls. Clearly during this stack period players cannot be behind the boss and then during the maze getting behind the boss is unlikely since you are attempting to outrace a beam coming from the front of the boss. Similarly fights like Tortos provide only a small area that is considered “behind the boss” which you frequently have to move out of to dodge rockfalls. Fights are becoming increasing mobile creating a far greater likelihood that a player will be forced to attack from the front for some portion of the fight.

I understand why many players have glommed onto positional requirements because they are really all subtlety has left of its original kit. However as I hope I have shown positional requirements create fundamental spec balance problems that are very difficult to resolve without outright removal of positional requirements. Subtlety does need an actual kit that defines the spec but that kit must be defined in terms of mechanics that can be balanced such as Find Weakness uptime or similar rather than by positional requirements.