An extension of the assorted ideas I was posting yesterday. Might lead towards some pretty convenient results for abstract computation of the total damage done by mana-using classes in a fixed amount of time.
The problem is cast as it was yesterday. A player has n different "modes of operation," whatever they are, indexed on i. For each, we know the DPS d_i and the MPS m_i. We want to find t_i, the time spent in each mode.
Constraints:
1) Sigma(t_i) = T :: total length of time is fixed
2) (t dot m) = M :: total net mana usage is fixed (that is, sigma(t_i*m_i))
3) all t_i >= 0
The goal is to maximize (t dot d)
What I didn't notice yesterday is that this is just a problem in linear programming (a "simplex" problem). All of the constraints are planar. Recall that the set of all points whose dot product with a constant vector V is constant forms a plane normal to V.
Result #1: there are only two nonzero t_i. Which is to say, of the choices you have of various behaviors, you should never be using more than 2 in a given fight.
Proof: A point in n-space is defined by the intersection of n (n-1)-planes. Constraints (1) and (2) can provide two of the planes locating the desired optimum point P. All of the rest must come from constraint (3). Hence, at least (n-2) of the t_i are 0.
Analysis: Anytime you do more than 2 things in a given fight, you're being inefficient.
For example, a Mage might have a high-burn cycle (lots of Fireball), a low-burn cycle (lots of Scorch), a regen cycle (downranking), and the option to wand. Now we know, a priori, that any strategy for a long fight that involves more than two of these options is suboptimal.
A Warlock might have a high-burn cycle, and lower-burn cycle (reducing the mana you spend on inefficient spells might seem like a reasonable thing do to when you're late in a mana-intensive fight), and the option to Lifetap. Again, the right solution is to pick exactly two which, when combined, give the best result.
------------------
Threat:
Any mode of operation can also have a TPS associated with it. In a fight where aggro might be a limited factor, all this does is impose another planar constraint. Hence, the maximum number of modes usable in given fight increases from 2 to 3 (a proper choice of 3 cycles can keep your mana and threat both right at the limit, while 2 cannot).
An interesting point here is that you can assume that, like with mana consumption, order of usage doesn't matter. You can always assume that the tank's threat generation is linear or slower (at least in fights we've seen), and you can always assume that the caster's threat is linear or faster (by using you lower-threat cycle early on).
------------------
Damage computation:
This was completed yesterday. Total damage done by two cycles, called 1 and 2, is
D = (M*(d_1 - d_2) + T*(m_1*d_2 - m_2*d_1))/(m_1 - m_2) --I entirely forgot what my sign convention was.
For a given setup and choice of casting cycles, this should be quite an accurate measure of the total damage done. Not only that, it should pretty good at telling you excatly when you need to change cycles. And that could be really helpful--if I ever want to work a fight with Patchwerk-level stringency that lasts 11 minutes, for example, it would great to plan in advance exactly at which boss HP% I start downranking.
-----------------
What's left:
Given m_i and d_i, choose the two i that are the optimal cycles to combine. Note that this can be dependent on T and M. For spreadsheet purposes, I'd like to have to way to do it which is better than combining every possible pair and testing. I think some vector math should be able to do it, but it's not obvious.
can't read math without \LaTex notation...but still...I don't see how cooldowns are incorporated into the model, does that matter?
Ignoring that for a second, some quick observations.
1. For me, it's easier to write a lagrangean (cuz I don't know linear programming really, lol). Asssuming some set of t_i are positive, you can see they must lie on the same line in (d_i,m_i) space. So, yeah, use at most two, or if you use more they are linear combos of the first two.
2. For the "what's left" part, I wouldn't be surprised if the solution is one of a small number of classes. For sure, if the mana constraint doesnt bind, the solution is obvious.
Hmmm, gotta go work, this is more interesting as a little diversion tho, hope you get it soon.
Maybe I'm misunderstanding you, but I don't see how those contraints hold in a real fight.
For constraint 1, if you do more dps while the mob is alive, the mob dies faster. So time isn't fixed. It might be possible to say that each individual dpser can't affect the duration of the fight in a significant way, but then if everyone uses this, they wind up optimizing their dps for a fight that's longer than it needs to be. It seems like you're essentially planning for say, a 7 minute fight, so if you happen to down Patchy in 6m, you end the fight with some mana and wasted a bit of dps by being in a low-burn mode.
For constraint 2, I don't see how this works unless you assume that optimal behavior is to be a zero mana when the fight ends. Let's assume that you'll expend all the mana that you knew ahead of time would be available: your inital mana pool, sortof evo, the max mana you could get from stones in the fight, and the max mana you could get from mana potions in the fight. There are mana sources that aren't fixed like that though, which from what I can tell, wouldn't be modeled properly - mana due to clearcasting (both the proc and chance of getting out of 5sr) and the relationship between spell cast time on Judgement of Wisdom.
Also, I don't see how you're constrained to never dip below 0 mana or go over max mana in your model. If you assume you'll never hit bottom, that assumes that the cooldowns on your mana abilities aren't relevant except in limiting the number of times you can use them. I'm also not sure if you can guarantee to get the full benefit of mana potions, gems, and evo with this. The model might say you should Evo right away whereas that would do nothing due to a maximum amount of mana.
I don't know that you can represent everything in the necessary way to do this analysis, but a little more explanation of what you intend each part to be would help.
I don't see how cooldowns are incorporated into the model
You mean the long timers we have (ToEP, PoM, etc.)? Right, those aren't in yet.
I did think about it, and concluded that, at least in the case of ToEP, it can safely be ignored for now. The fact that cycles can be arranged in almost any order within a fight, with little ill effect, means that you can assume that ToEP will be popped during whatever cycle is most efficient for it.
Interesting aside: in a fight which is long enough to make me downrank Frostbolt at all, it is slightly more efficent to use ToEP on R4 Frostbolt than on R11 (since the +dmg bonus functions at 3.0/2.5 efficiency on the high-rank spell, and 2.6/2.1 on the low-rank). The difference is small, but if you're being perfectionistic, you'd need to know in advance whether you need to downrank in a particular fight.
Maybe I'm misunderstanding you, but I don't see how those contraints hold in a real fight.
For constraint 1, if you do more dps while the mob is alive, the mob dies faster. So time isn't fixed. It might be possible to say that each individual dpser can't affect the duration of the fight in a significant way, but then if everyone uses this, they wind up optimizing their dps for a fight that's longer than it needs to be. It seems like you're essentially planning for say, a 7 minute fight, so if you happen to down Patchy in 6m, you end the fight with some mana and wasted a bit of dps by being in a low-burn mode.
For constraint 2, I don't see how this works unless you assume that optimal behavior is to be a zero mana when the fight ends. Let's assume that you'll expend all the mana that you knew ahead of time would be available: your inital mana pool, sortof evo, the max mana you could get from stones in the fight, and the max mana you could get from mana potions in the fight. There are mana sources that aren't fixed like that though, which from what I can tell, wouldn't be modeled properly - mana due to clearcasting (both the proc and chance of getting out of 5sr) and the relationship between spell cast time on Judgement of Wisdom.
Also, I don't see how you're constrained to never dip below 0 mana or go over max mana in your model. If you assume you'll never hit bottom, that assumes that the cooldowns on your mana abilities aren't relevant except in limiting the number of times you can use them. I'm also not sure if you can guarantee to get the full benefit of mana potions, gems, and evo with this. The model might say you should Evo right away whereas that would do nothing due to a maximum amount of mana.
I don't know that you can represent everything in the necessary way to do this analysis, but a little more explanation of what you intend each part to be would help.
Clearcasting, JoW, and the 5SR are all taken into account in the MPS of any cycle.
1) Right. The assumption is that fight length is constant. It's a valid first-order approximation. The only real complication is that if a fight has many people whose damage slow down near the near the end, boss HP can no longer be used as a measure of time. This is easily corrected for, however.
Your comment on Patchwerk raises an important point. Assuming I don't actually know how long my guild takes to kill him (say we're working towards a first kill), my strategy should be to aim for precisely a 7min fight. If the fight comes up shorter, sure, I may lose out on the DM's to somebody who anticipated that and aimed for a short fight. However, by aiming for 7 mins, I maximize the raid's chance of success, which is what counts.
I think what I'm hung up on is what a "mode of operation" can be. From the other threads you linked, I'm sure R11 Frostbolt with AM on clearcast is one, R4 with AM on clearcast, the same two with R11 FB instead of AM, etc. Where does Evocation fit in? I'd love to call it a fixed duration mode of operation, but I don't see how you could represent the cooldown as a constraint. What about the ordering of the modes? The mps of an alliance-buffed R4 mode is zero at max mana but positive (going by the sign convention in the other threads) at less than max mana. It seems like this problem assumes the order in which you spend time in each mode is independent, but I'm not convinced that's valid, given that this model seems to say you'll have a dps mode and a regen mode and you can't regen until you've spent enough mana to utilize the regen.
However, by aiming for 7 mins, I maximize the raid's chance of success, which is what counts.
I don't agree entirely or disagree entirely. If you plan for 7 minutes, you'll do the most damage possible in 7 minutes. But if it takes 6 minutes and each mage could've shaved off a little time by acting differently, the chance of a mistake or lag spike wiping the raid goes down slightly. Another similar situation is a fight with periodic damage on a night where we have backup healers. I try to frontload my damage to squeeze out as much as possible since the chances of dying increase with time. On the other hand, if everything goes as intended, planning for a 7m Patchwerk as opposed to 6m is the more reliable decision. I suppose it's too much work to reliably estimate the chance that someone DCs or the server gerbil chokes to truely model what I mean, so I'll probably just have to take what theory I have available and slap on intuition later. Also note I've never been in Naxx, just using Patchwerk as an example since it sounds like a perfect mage theory fight.
(Hopefully I've been polite as intended, I just want to be absolutely sure of an optimization before using it.)
Papaj: the order is independent, because (ignoring minor edge effects on the 5SR) - the difference between 5 minutes straight in R11 mode and 5 minutes straight in R4 regen vs. 1 minute R11, 1 R4, repeat 4 more times, is zero. You have the same mana expenditure and the same effective damage dealt. From the perspective of the model, the actual breakdown into cycles, and the location of consumable useage, is unimportant.
From a technical perspective, it's a time-invariant problem - the values don't change based on when they're employed, so the cycles are effectively commutative.
As to Evocation: for the same reason, you can reliably model Evocation as an 8 second subtraction from available cycle time (6:52 instead of 7:00, for example) and a fixed amount of extra mana available from the beginning. There are a few problems with this, in that if Evocation restores more mana than you can spend in N timeframe, and you can only get two Evocations in if you use one N seconds into the fight, you don't get as much back as you think, but effectively Evocation can be modeled as a static reduction in fight time and a static increase in initial manapool as long as you work with relevant assumptions.
Melador> Incidentally, these last few pages are why people hate lawyers.
Viator> I really don't want to go all Kalman here.
Bury> Just imagine what the world would be like if you used your powers for good.
First, pseudo latex of the LP, both for the above poster who requested it and to make sure I am understanding everything correctly:
\max \sum_{i \in I} d_i t_i
s.t.
\sum_{i \in I} t_i \leq T
\sum_{i \in I} m_i t_i \leq M
Where I is the set of "candidate modes" we are considering, t_i is the amount of time spent in mode i, d_i is the dps of mode i, m_i is the mps of mode i, T is the length of the fight, and M is the total amount of mana available during the fight. Also note that I have relaxed the equalities to inequalities; this should produce the same results for fights that are both time and mana limited, but also work correctly in fights where only one of the two is binding. This is probably unnecessary given the scope of the discussion, but may become more relevant when threat is added in as an additional constraint.
Originally Posted by Arawethion
What's left:
Given m_i and d_i, choose the two i that are the optimal cycles to combine. Note that this can be dependent on T and M. For spreadsheet purposes, I'd like to have to way to do it which is better than combining every possible pair and testing. I think some vector math should be able to do it, but it's not obvious.
As for choosing the optimal pair... since we have an LP formulation, why not use it? This would still involve a bit of leg work: the d_i and m_i for each candidate mode i would have to be calculated with the spreadsheets... but at least this is linear work in the number of candidate cycles, instead of quadratic (i.e. testing every pair).
This raises the immediate question: how many candidate modes need to be considered? At first glance, it seems like it shouldn't be too bad; a mode for pure spamming of each rank of each offensive spell, with variations for the following: what to use on clearcasts, what to use on focus procs (if applicable), and whether or not to use fire blast / coc when up. This might still be too large to do manually, but should be somewhat easy to automate, given the relevant information for each rank of each spell.
This also go tme thinking... it may be possible to include gear selection for a given fight in the optimization. This would change it from an LP to a MIP, but still, it might be interesting. Big hurdle I see is that M, d_i, and m_i would all be dependent on the gear selection, and those calculations are probably too complex to linearize in any kind of straightforward manner.
Unfortunately I am at work and pressed for time, so my apologies if I have just repeated observations made in the previous threads; I'll catch up on everything, and try to actually contribute instead of just rambling when I get home tonight.
I think what I'm hung up on is what a "mode of operation" can be. From the other threads you linked, I'm sure R11 Frostbolt with AM on clearcast is one, R4 with AM on clearcast, the same two with R11 FB instead of AM, etc. Where does Evocation fit in? I'd love to call it a fixed duration mode of operation, but I don't see how you could represent the cooldown as a constraint. What about the ordering of the modes? The mps of an alliance-buffed R4 mode is zero at max mana but positive (going by the sign convention in the other threads) at less than max mana. It seems like this problem assumes the order in which you spend time in each mode is independent, but I'm not convinced that's valid, given that this model seems to say you'll have a dps mode and a regen mode and you can't regen until you've spent enough mana to utilize the regen.
Evocation does not fit in. It's added to the max mana total, and thus far, I'm ignoring the 8 seconds. I should remember to just subtract them off at some point.
This doesn't work perfectly, of course. Sometimes, when I'm running out of mana right near the end of a boss fight, the best thing to do is Evocate for one tick, just to get off a few more high-rank Frostbolts. But that's a very obscure case.
As far as the min and max mana constraints, I don't see how it's a problem. You start a fight by dipping your mana comfortably below full, you use the light-mana or regen cycle for the appropriate length of time in the middle, and you finish by using the high-mana cycle to take you right to 0. Why is the order in the middle a problem? You can manipulate it however you want to make your Evoc/gem usage most convenient.
However, by aiming for 7 mins, I maximize the raid's chance of success, which is what counts.
I don't agree entirely or disagree entirely. If you plan for 7 minutes, you'll do the most damage possible in 7 minutes. But if it takes 6 minutes and each mage could've shaved off a little time by acting differently, the chance of a mistake or lag spike wiping the raid goes down slightly. Another similar situation is a fight with periodic damage on a night where we have backup healers. I try to frontload my damage to squeeze out as much as possible since the chances of dying increase with time. On the other hand, if everything goes as intended, planning for a 7m Patchwerk as opposed to 6m is the more reliable decision. I suppose it's too much work to reliably estimate the chance that someone DCs or the server gerbil chokes to truely model what I mean, so I'll probably just have to take what theory I have available and slap on intuition later. Also note I've never been in Naxx, just using Patchwerk as an example since it sounds like a perfect mage theory fight.
(Hopefully I've been polite as intended, I just want to be absolutely sure of an optimization before using it.)
In these situations you just have to use your judgement. If you think you have a significant chance of dying early, burn your mana ASAP and the use a zero-mana cycle for the rest of the fight. But you'll lose against a Mage who maintains a steady burn for the whole fight. The question here is how to maximize damage over the course of the whole fight, for someone who's trying to do that.
As to Evocation: for the same reason, you can reliably model Evocation as an 8 second subtraction from available cycle time (6:52 instead of 7:00, for example) and a fixed amount of extra mana available from the beginning. There are a few problems with this, in that if Evocation restores more mana than you can spend in N timeframe, and you can only get two Evocations in if you use one N seconds into the fight, you don't get as much back as you think, but effectively Evocation can be modeled as a static reduction in fight time and a static increase in initial manapool as long as you work with relevant assumptions.
The only problem with treating evocation this way is it skews the average DPS output. If, for example, you're trying to determine what your maximum effective DPS in, say, a 7 minute fight given a specific size initial mana pool and a specific number of consumables, then evocation has to be factored differently (and similarly for consumables.) Ideally the model used would handle these things in a natural and elegant fashion. Unfortunately I'm at work right now, so I can't get much deeper into this right now.
As for choosing the optimal pair... since we have an LP formulation, why not use it? This would still involve a bit of leg work: the d_i and m_i for each candidate mode i would have to be calculated with the spreadsheets
This is actually already done. I just realized that I never directly linked the old spreadsheet in this thread; here it is:
the order is independent, because (ignoring minor edge effects on the 5SR) - the difference between 5 minutes straight in R11 mode and 5 minutes straight in R4 regen vs. 1 minute R11, 1 R4, repeat 4 more times, is zero. You have the same mana expenditure and the same effective damage dealt. From the perspective of the model, the actual breakdown into cycles, and the location of consumable useage, is unimportant.
If it isn't possible to spend the first 5m in R11 or you would hit full mana after 30s of 1m R4, then the strategies are very different. Like you said, it doesn't model when you do whatever. Because of that, it doesn't guarantee that a breakdown into cycles (with time points for each consumable, etc) actually exists given the amount of time total in each mode, as far as I can tell. If there's some implicit guarantee that you'll never hit 0 or full mana and I've missed it, that'd be cool, but I don't see it anywhere.
Oh Hamlet, you card. I don't think I understood a single word you said in the OP.
Hey! This applies to you as well (especially since the new Lifetap changes--the absurd MPS of the Lifetap cycle might change the desired behavior that gets paired with it).
First model--critting as a Poisson process. Casting is a continuous process, and n Mages each crit at an average rate of \lambda crits/sec (I'll type LaTeX-style here, since people seem to prefer it). Also, each stack on an Ignite tick contributes d damage.
In a 4-second period, the chance that a particular Mage crits at least once is
(1 - \exp{-4\lambda}).
The chance that at least one Mage crits is
P = (1 - \exp{-4n\lambda}).
The probability distribution for the height of a particular stack, once it gets started, is
p(k) = P^{-k}.
The average time between stacks is $t = \frac{1}{\lambda}$.
The average total length of a stack that reached height k is $2*(k + 1)$.
First sanity check: does
\sum_1^\inf{P^{-k} * 2*(k+1)}
converge? The answer is yes, so the expectation height of a stack is not infinite.
The damage done by an Ignite reaching hieght k is $d/2*k*(k+3)$.
the order is independent, because (ignoring minor edge effects on the 5SR) - the difference between 5 minutes straight in R11 mode and 5 minutes straight in R4 regen vs. 1 minute R11, 1 R4, repeat 4 more times, is zero. You have the same mana expenditure and the same effective damage dealt. From the perspective of the model, the actual breakdown into cycles, and the location of consumable useage, is unimportant.
If it isn't possible to spend the first 5m in R11 or you would hit full mana after 30s of 1m R4, then the strategies are very different. Like you said, it doesn't model when you do whatever. Because of that, it doesn't guarantee that a breakdown into cycles (with time points for each consumable, etc) actually exists given the amount of time total in each mode, as far as I can tell. If there's some implicit guarantee that you'll never hit 0 or full mana and I've missed it, that'd be cool, but I don't see it anywhere.
The implicit guarantee is in the twin statements
"Ordering is not important" and "5 minutes of R11 is equivalent to 5 interspersed 1 minute cycles of R11". Again, the important assumption is that cycle resultant values are commutative.
If you would hit full mana 30s into 1m of R4, then you obviously only use 30s of your optimal strategy there, and save the rest for later on in the fight. Since the constraints guarantee that total mana burnt and total mana available are at worst equal, by appropriately choosing your ordering and initial conditions (initial conditions represent the time-constraints on consumable usage if set intelligently - if you can't burn N mana in the first M time, s.t. you could use one more mana gem or potion, then obviously you can't count that gem or pot in your total available mana) *you* can implicitly guarantee that a sequence exists s.t. you spend the requisite amount of time in each phase.
Melador> Incidentally, these last few pages are why people hate lawyers.
Viator> I really don't want to go all Kalman here.
Bury> Just imagine what the world would be like if you used your powers for good.
/agree, it's only mana-regen/drain casts whose total time used can't be "broken up" into smaller cycles. Operationally, that probably means mana pots/gems.
First model--critting as a Poisson process. Casting is a continuous process, and n Mages each crit at an average rate of \lambda crits/sec (I'll type LaTeX-style here, since people seem to prefer it). Also, each stack on an Ignite tick contributes d damage.
In a 4-second period, the chance that a particular Mage crits at least once is
(1 - \exp{-4\lambda}).
The chance that at least one Mage crits is
P = (1 - \exp{-4n\lambda}).
The probability distribution for the height of a particular stack, once it gets started, is
p(k) = P^{-k}.
The average time between stacks is $t = \frac{1}{\lambda}$.
The average total length of a stack that reached height k is $2*(k + 1)$.
First sanity check: does
\sum_1^\inf{P^{-k} * 2*(k+1)}
converge? The answer is yes, so the expectation height of a stack is not infinite.
The damage done by an Ignite reaching hieght k is $d/2*k*(k+3)$.
This will be refined into something more useful when I feel like applying either MATLAB or some calculus skills, and have checked it one or twice.
EDIT: lamdba != lambda. Bad memories of Scheme.
Hmm, I am just trying to check the maths here...
1. I am unclear as to why the distribution of the stack height is $P^{-k}$. I assume you're right but I thought ignite kept going as long as someone critted. In which case isn't it geometric $P^{k-1}(1-P)$, for k \geq 1 (you said conditional on the ignite starting, right?). What am I missing?
1. I am unclear as to why the distribution of the stack height is $P^{-k}$. I assume you're right but I thought ignite kept going as long as someone critted. In which case isn't it geometric $P^{k-1}(1-P)$, for k \geq 1 (you said conditional on the ignite starting, right?). What am I missing?
No, I was just asleep. Every time I said P^(-k), I meant P^k (I like how I still claimed that the sum converged).
Yours is correct, although I'm probably going to try to formulate this in an entirely different way to be more practical.
btw, could you clarify the _exact_ question we are addressing for the ignites? It'd make it easier to think about the best approach.
For n Mages at a given crit rate, what's the mean height of the Ignite stack at any time?
Up there, I computed the damage and time taken by a particular stack height. But then trying to get a probability distribution on stack heights and take a weighted average got really messy.
The other question is whether it's even worth pursuing the continuous-time approach. I'm guessing it might be surprisingly valid since different Mages will cast at slightly different rates, so issues of phase will average themselves out anyway.
The goal here is to try to find a basis for gear comparisons (what's the real value of a crit% when 3 Mages are stacking? 6?).
Now, that's almost just geometric. Hence, if we take as a working assumption that in the vast majority of realizations will be where the stack size $k$ never gets close to $t$, can we not then conclude that a good approximation of the expected stack size at time t is:
\text{E}(\text{Stacks at time } t)
P/(1-P)
EDITED the final answer, thought it was pure geometric at first. Also, reversed P and 1-P, sigh, anyway gotta run might be off a bit but seems close.
Each of my crits applies an Ignite that "lasts" as long as its stack lasts. So let's consider individual Ignites, rather than stack heights.
Problem: Stack height and duration are not equivalent. According to the other ignite thread, the tick "pulse" does not reset on a crit, so all we care about is the length the stack lasts after I crit. So what we need is a probability distribution of stack length, starting at any point, and we can condition on that to get the expected damage contribution of a single crit. This will not apply the 5-cap correctly, but should be a good start.
So, how does one accurately predict stack duration? Note that stack height is easy; it's the geometric progression discussed above. Is the mean duration of a stack of height k simply $k/(n*\lambda)$? If so:
p(k) = P^k * (1-P) --probability that my crit gets stacked k "extra" times, regardless of how high the stack was when I started
for a given k, then, assume that $t = k/(n*\lambda)$, and hence the number of times the Ignite ticks is $k/(2n*\lambda) + 2$
So now the final mean value of a crit is:
\frac{1-P}{2n*\lambda} \sum{k * P^k} + 2
Much simpler, in fact, quite usable, but I'm convinced yet that the above assumption works.