Monday, April 19, 2010

Character Math: Measuring Survivability in Turns to Die.

Most of the current game theory for D&D 4E is focused on measuring and comparing each character's offensive prowess. There are several reasons for this: damage-dealing is the most common role in adventuring parties, and quantifying the result of an attack is relatively straightforward. Also, players just love to destroy monsters (and peers) with absurdly high damage numbers. But even the most well-oiled killing machine needs some degree of defensive capabilities, lest his enemies knock him down in a single turn (as certain players in my group can attest).

But how do you measure survivability? It's trivial to come up with damage as the universal unit for comparing attacks, but which one should be used for toughness? It should factor in Hit Points, Armor Class, and the other three defenses - and also mechanics such as resistance or temporary hit points. After considering the issue for a while, I think I have come up with a good solution: we can (and should) calculate the number of turns that a character can endure monster attacks before becoming unconscious. The basic formula would have the following form:

Survivability = Character HP / Enemy's average attack damage

or, abbreviated:

S = HP / monster DPR

S (survivability), as defined above, provides a good estimate of the effort required to bring a character down. Players can use it to have a better knowledge of the resilience of each member of a party, or of different builds for a certain character. As an example, it would be a useful tool to determine whether it is better to invest in higher defenses, hit points, or resistance, at any given time.

One disclaimer, though: there are aspects of a character's resilience that aren't covered by this stat. Specifically, it doesn't describe how well a character staves off negative conditions - for that, you need to resort to AC and the other defenses. For this reason, when you see two characters with the same survivability, both will be able to endure the same number of attacks, but the one with higher defenses (and, conversely, lower HP and resistance) will suffer less from hindering effects.

This Survivability formula implicitly assumes that the enemy attacks are targeting a specific defense (since we wouldn't be able to calculate average damage otherwise). For this reason, a character will actually have four different S values: S(AC), S(For), S(Ref) and S(Wil). We can define overall survivability (or just S) as the weighted sum of all defense-specific S values:

S= 1/2* S(AC) + 1/6* S(For) + 1/6*S(Ref) + 1/6*S(Wil)

Note that Fortitude, Reflex and Will are all worth the same, and AC counts as much as the three together. This roughly reflects the frequency with which monsters tend to attack each defense - it may not be exact, but I think it's close enough.

The mandatory math section

If you want to play a bit with the idea of survivability, find out actual values for your PCs, and see how long a bunch of theoretical Skirmishers of your level would need to kill you, the quickest way is to go to my online Survivability calculator and start introducing stats. On the other hand, if you are curious as to how it works, this is how the formulas break down:

S(defense) = HP / monster DPR

,where HP depends on the measured character, and monster DPR is (as shown in my monster DPR post, considering standard damage for a skirmisher):

DPR=Hit rate * (8 + 0.5*Level)

I have ignored the monster crit damage because the difference is minor, and it somewhat simplified the code. I'll add it back someday - for completeness' sake, this is how it would look like:

DPR=Hit rate * (8 + 0.5*Level) + 0.225 + 0.01 *lvl

We still need to find out the hit rate. According to the formulas from my post about AC normalization, it would be:

Hit rate (AC) = (26-nAC)/20
Hit rate (Def) = (24-nDef)/20

Or, using plain AC and defenses instead of normalized ones:

Hit rate (AC) = (26 + level -AC)/20
Hit rate (Def) = (24 + level-Def)/20

This leaves us with:

S(AC) = HP*20 / (26 + level -AC)*(8 + 0.5*level)
S(Def) = HP*20 / (24 + level -Def)*(8 + 0.5*level)

Finally, if we want to take a character's resistances into account, we just need to substract any resistance value from the hit damage:

S(AC) = HP*20 / (26 + level -AC)*(8 + 0.5*level - resistance)
S(Def) = HP*20 / (24 + level -Def)*(8 + 0.5*level - resistance)

The above formulas are accurate except for extremey high values of resistance. In particular, any resistance greater than the monster bonus to damage will not be as effective as the formulas show, because monsters never do negative damage. This way, a creature which deals 1d10-5 damage after substracting resist would not average 0.5 damage (5.5 average from the die, -5), but a few points more than that. This is a rare occurrence because such high resistances are very hard to get outside of short term powers, but you should be aware that it exists.

Future refinements

In addition to adding critical damage, there are a few improvements that could be added to this model (and to the calculator!). The most urgent would be the calculation of S values for characters (usually defenders) that can gain temporary hit points each time they attack. This is slightly more complicated than the basic case, as it depends on the character's own hit rate, and varies depending on the number of attacking enemies. I'll write about that in the following days, and add it to the code as soon as I can.

Apart from that, I'd like to hear some reader feedback. Can you think of ways to improve this model? Let me know!


  1. This fails to take into account healing, specifically healing surges. I know that at a simple level characters only get 1 use of a healing surge per encounter, but that is far from average. Since you are trying to measure actual survivability as apposed to (the theoretical) maximum survivability the "average work day" problem comes up again - well for me it does. Divide number of surges by number of average/expected encounters per day and then multiple that number by the HS value and add it to the total HP of the character. Even if you think this to granular to utilize in your formula, a singular HS Value should be added to the total hit points as it does represent the 2nd Wind of every character.

  2. I play a wizard or sorcerer about 90% of the time. Half of my utilities are encounter powers that give me a bonus to defense as an interrupt-and, since I'm using those powers consciously, that basically turns a hit into a miss. It certainly factors into the equation, but I have to wonder how, exactly.

  3. Yep, this ignores healing and defensive powers, among other things. The PC here is supposed to be doing nothing, except perhaps making at-will attacks every turn (which grant resistance or DPR). Consider it the equivalent of at-will DPR - perhaps we should call it 'passive survivability', or 'intrinsic survivability', or something like that.

    This was a conscious decision: I had to draw the line somewhere. I wanted to model the PCs as static bags of hit points first, and then add all the limited use stuff on top of that.

    There is a rough plan, which goes as follows: I have a couple more pending articles on the topic of survivability, addressing different aspects of this basic model. Then I'd like to discuss the application of the same concept as a benchmark of a PC's offensive capabilities.

    Once that is out of the way, I would address healing, and how it relates to survivability, and then control, which I think translates well into negated monster turns. Defensive encounter powers would go somewhere in between.

    But to give a quick answer to your concerns, assuming that each character always gets to use 1 healing surge per encounter equals to increasing survivability by roughly 25% (ignoring leader bonuses for now, for sanity's sake). As for the value of defensive interrupts in this model, a good estimate would be to calculate each one's effects on a monster attack - let's say Shield makes one skirmisher attack 30% less effective. You could then add that difference (0.3) to your final survivability value. But more on that in a future post! ;)

  4. This is somewhat similar to measuring your Damage output in DPR - it's somewhat derived from the (not entirely original) MMO-players habit of measuring their survivability in Time to Live. The point isn't to model an actual combat, but to give you a grasp on how long it would take to cut you down if you just stand there, don't receive any heals, etc. That said, second wind is probably a good idea to throw into the model, though not entirely necessary.

  5. I like the using term 'intrinsic survivability' to define how many rounds of punishment a character can take before factoring in second wind and other defensive and healing powers. Combat's too dynamic to describe in a single static number, so it's necessary to figure out the impact of each defensive power separately, just as you'd measure each separate attack when calculating a PC's overall damage.

    Once intrinsic survivability is determined, the next step is to calculate the survivability modifier of each defensive and healing power. This would provide meaningful figures to help the player decide when to use specific powers during battle and still leaves room to factor in daily powers and powers that target other PCs. A daily power that boosts defenses until the end of the encounter would reduce monster damage per round. A leader's healing power would effect the survivability of the recipient.

    Also, don't forget that second wind adds +2 to defenses and adds the healing surge value to hit points, which isn't always 25%. It's also helpful to calculate the effect of any heal or defensive boost you can receive from an ally. This must be calculated for the recipient, since different characters have their own defenses and healing surge values.

    Factoring control powers might work as negating a round whittled off of survivability as long as the odds of the power hitting are factored in, if it requires a successful attack roll. Often, control powers will change who (not if) an enemy attacks or merely punishes the enemy for certain choices. Naturally, you have to remember that a given PC may not be attacked for several rounds or might be attacked by multiple enemies. The effect of many control powers will come down to getting an enemy to attack a PC with higher intrinsic survivability.

    This method is more work, but if anyone's serious about doing the math, it will pay off.

  6. I like the updates you've made to the Calculator, but I still wonder if healing surge value shouldn't be included in the calculation? It certainly affects survivability IME.

  7. It's on the 'to do' list, but right now I have other features on queue, such as calculating the effect of temporary hit points and other defensive bonuses that trigger on your hits.

    Also, I'd like to have some kind of theoretical framework for healing in general, which is the main reason I'm delaying the use of surges.

  8. Hmm...wouldn't you need to include attack bonuses and attacks vs. defenses to determine accuracy to match to that? At that point you're looking at something much more like a generalized "Effectiveness Calculator" than "Survivability." I think you should keep your "PC Tofu" as passive as possible since the further you get from your initial model (static AC, NADs, and resistances), the more assumptions you will have to make, but trying to incorporate anything that's dependent on the game's semi-random elements (i.e., Attacks) is going to confuse things and reduce value beyond the LOE involved, IMO.

    For Healing, I think a KISS principle should be involved. Accounting for the Leader bonuses that could be applied is probably out of your scope. If you assume that a character is likely to spend at least one surge per combat, you could add their surge value to effective hit points. If you wanted to calculate how likely a character is to spend an additional surge, you might be able to approximate that as a bonus based on the number of surges a character has (a character with Durable or a Belt of Raging Endurance would then be rewarded with increased Survivability, which only seems fair)...perhaps if their # of surges exceeds 7 + Con you might include an additional surge spend?

    Just some thoughts for you! Thanks for all of this, I really find it cool and useful.