8
\$\begingroup\$

When optimizing character builds, it is common to use the average expected damage to estimate damage output. Calculating the average of a single die is simple, fixed modifiers are then added to it to obtain raw damage output. That raw damage output is then multiplied with the expected to-hit chance for the share of attacks that actually, connect to arrive at the expected damage from the attack.

However, there is the issue of critical hits and misses - a one always misses, and a 20 always hits, and there are also some ways to increase the critical range, for example the Champion fighter has an Improved Critical feature that allow them to critically hit on a 19 or 20, and a Superior Critical feature that does the same for a roll of 18 to 20. A correct calculation for expected damage needs to factor this in.

The rule for calculating damage of a critical hit is:

When you score a critical hit, you get to roll extra dice for the attack’s damage against the target. Roll all of the attack’s damage dice twice and add them together. Then add any relevant modifiers as normal.

What is the correct formula for seprately calculating the added expected damage from just the critical hit contribution?

What is the factor with which you can multiply the average damage dice result to obtain the raw die damage from the attack including expected contribution of criticals, for then adding static bonuses and multiplying the result with the to hit chance?

Bonus question: how do these formulas look like when you attacking with advantage or disadvantage?


To clarify what I am looking for using an example :

Attack damage is 1d6+3, and I hit 65% of the time and crit on a 20.

Expected damage without considering critical is 6.5. What is the expected average damage with crits factored in?

Is it (3.5+3) x 65% + 3.5 x 5%? Is there a factor with which I can multiply the 3.5 in the parentheses instead of adding 3.5 x 5% afterwards? What is it?

With advantage, is it (3.5+3) x 87.75% + 3.5 x 9.75%, and what would the factor in parentheses be?

\$\endgroup\$
4
  • \$\begingroup\$ Huh, I was just about to ask the same question for "damage from attacks". It would be nice if we had something to refer back to! \$\endgroup\$
    – user77842
    Aug 4 at 0:32
  • \$\begingroup\$ You've got plenty of good answers to your stated questions, but I'm curious if you're willing to share how you intend to use the information? For example, are you building a tool to get a feel for expected damage in arbitrary 5e combat situations? (No response needed if you'd prefer to keep your intentions private, of course.) \$\endgroup\$
    – posita
    Aug 5 at 3:38
  • \$\begingroup\$ @posita The goal is to correctly calculate the average per attack expected damage for a given build, for example to compare two different builds to see which one deals more damage. I’m not developing a general tool for it, its more ad-hoc, either just on a calculator, or if its more involved, using a spreadsheet. \$\endgroup\$ Aug 5 at 5:27
  • \$\begingroup\$ I know it deviates somewhat from your plan, but I took a stab at an in-browser calculator based on Jupyter in my answer below. It accommodates a zero minimum damage limit (per the rules), which is not easily captured by averages and comes up with damage penalties (e.g., 1d8-2). The interface is a little clunky (being limited by the UI widget library available in that context), but I hope it's helpful to your exploration. Let me know if you think of any improvements that might be useful to you or others. \$\endgroup\$
    – posita
    Aug 8 at 14:28

6 Answers 6

18
\$\begingroup\$

When calculating DPR of attacks, you can use:

$$ \text{DPR} = \sum_\text{attacks} \Big[h(D+M) + cD\Big] $$ where h is the hit chance, D is the dice damage, M is the modifier or static damage, and c is the critical chance (normally 0.05).

To ease up on the notation we can deal with a single attack and rewrite the expression to $$ h\left(\left(1+\frac{c}{h}\right)D+M\right) $$ Which creates a factor \$1+\frac{c}{h}\$ which can be multiplied onto the damage dice to correct for criticals. When assuming a hit rate of 65%, this factor equals 1.077. This can be most useful when you're otherwise just dealing raw damage; DPR/h.

You're not gonna get away from having hit chance affect this factor though, since hits and crits are coupled. To informally show that point, consider the case where you'd only hit on a 20 on the die anyway. In that case, all your hits would be crits, so the crit adjustment would double the damage contribution of your dice.

The above works with advantage, except you need to recalculate the factor since both h and c will change with advantage. \$h_\text{adv} = 1-(1-h)^2\$ and \$c_\text{adv}=1-(1-c)^2\$ (normally 0.0975).


†: For completeness, this expression can be obtained from setting up the average of a hit (considering the probability and damage from missing, normal hits, and critical hits, respectivly): $$ DPR = \sum_\text{attacks}\Big[(1-h)\times0+(h-c)\times(D+M)+c(2D+M)\Big] $$

\$\endgroup\$
12
  • \$\begingroup\$ Thank you, a very clear explanation, and also nice to have a formula to derive the advantage % factors from the raw to hit and crit percentages. \$\endgroup\$ Aug 3 at 11:41
  • \$\begingroup\$ @GroodytheHobgoblin: note that barbarian Brutal Critical and/or half-orc Savage Attacks replace the cD terms with c(D+1d12) or whatever, one or more of the highest damage die that's part of D. This makes it harder to factor out D to get the later formulae in this answer. But fortunately, most builds just double the damage dice on crit, so this answer applies to most. \$\endgroup\$ Aug 3 at 21:01
  • \$\begingroup\$ @PeterCordes Not really, those just add D again, so you could expand to a 1+nc/h, where n is the number of crit dice added, which is normally 1, but BC/SA increase it (that just leaves maul/greatsword as awkward since you get n=1.5) \$\endgroup\$
    – Someone_Evil
    Aug 3 at 21:04
  • \$\begingroup\$ @Someone_Evil: If your normal hit damage is 2d6+3, your crit damage with one die of Brutal Critical or Savage Attacks is 4d6+3 + 1d6, not another whole 2d6. i.e. D + largest_die(D). \$\endgroup\$ Aug 3 at 21:05
  • 1
    \$\begingroup\$ @PeterCordes At that kind of complexity, I wouldn't use this method if you're looking for exact values. Per turn effects are actually best dealt with slightly separate to the normal attacks anyway, since their hit chance would differ with multiple attacks (eg. two-weapon fighting). \$\endgroup\$
    – Someone_Evil
    Aug 3 at 21:20
5
\$\begingroup\$

Let's start with a brief refresher of high school algebra, in case you've forgotten:

$$\begin{aligned} & (D + M) \times h + D \times c \\ =\;& D \times h + M \times h + D \times c \\ =\;& D \times (h + c) + M \times h . \end{aligned}$$

Here (as in Someone_Evil's answer) \$D\$ is your average damage dice roll, \$M\$ is the sum of the relevant modifiers, \$h\$ is your probability of hitting the target and \$c\$ is your probability of critting.*


*) Of course the equalities above would be just as valid with any other interpretation of the variables, as they're just based on rote application of the distributive and commutative laws of algebra.


You already seem to know how to calculate \$c\$ and \$h\$, at least for normal rolls, but just for completeness: if \$H\$ is the number of possible results on a d20 roll that will hit, then \$h = \frac{H}{20}\$. For example, if you hit on a 8 or higher, then there are \$20 - 8 + 1 = 13\$ possible rolls that hit, and thus \$h = \frac{13}{20} = 0.65\$. Similarly, if \$C\$ is the number of possible results on a d20 roll that will crit, then \$c = \frac{C}{20}\$. For example, if your crit range with Superior Critical is 18–20, then \$C = 3\$ and thus \$c = \frac{3}{20} = 0.15\$.

When rolling with (dis)advantage, the formulas become a bit more complicated. The easiest way to do it is to first calculate \$h\$ and \$c\$ for a normal roll as above, and then adjust them as follows:

  • A roll with disadvantage succeeds only if both individual rolls succeed, so \$h_{\rm dis} = h^2\$ (and similarly \$c_{\rm dis} = c^2\$).
  • A roll with advantage succeeds if either of the two individual rolls succeeds, so \$h_{\rm adv} = 1 - (1 - h)^2 = 2h - h^2\$ (and similarly \$c_{\rm adv} = 1 - (1 - c)^2 = 2c - c^2\$).

For example, if you're (again) hitting on an 8–20 and critting on 18–20, then \$h = 0.65\$ and \$c = 0.15\$. If you have disadvantage, these probabilities become \$h_{\rm dis} = h^2 = 0.4225\$ and \$c_{\rm dis} = c^2 = 0.0225\$ respectively. If you have advantage instead, they become \$h_{\rm adv} = 2h - h^2 = 0.8775\$ and \$c_{\rm adv} = 2c - c^2 = 0.2775\$ instead.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you for also providing a formula for disadvantage \$\endgroup\$ Aug 3 at 17:32
3
\$\begingroup\$

Let's start with an example where you hit 65% of the time with a damage roll of 1d6+3, that means that 13 of your 20 possible dice rolls result in a successful hit.

12 of those 13 hits are normal damage.

1 of those 13 hits are critical damage.

We can take a weighted average across misses, normal hits, and critical hits now.

$$ (7/20) \times 0 + \\ (12/20) \times (1\text d6+3) + \\ (1/20) \times (1\text d6+3+1\text d6) $$

However, we can factor some things out at this point:

$$ (12/20) \times (1\text d6+3) + \\ (1/20) \times (1\text d6+3) + \\ (1/20) \times (1\text d6) $$

As you can see, the normal damage part of the critical hit combines nicely with the normal hits.

$$ (13/20) \times (1\text d6+3) + \\ (1/20) \times (1\text d6) $$

Further, you see that this is independent of our actual accuracy. So, instead of assuming 65% accuracy, we can use a variable.

$$ (\text{accuracy}) \times (1\text d6+3) + \\ (1/20) \times (1\text d6) $$

In the case of any extended crit range (such as the 19-20 from Champion Fighter), the math ends up being similar:

$$ (\text{accuracy}) \times (1\text d6+3) + \\ \left(\text{chance to crit}\right) \times (1\text d6) $$

So, you can compute the critical hit contribution as just that latter term. Isolated from the above:

$$ \left(\text{chance to crit}\right) \times (\text{damage}_\text{dice only}) $$

\$\endgroup\$
3
  • \$\begingroup\$ I like the easy to follow explanation of hwo this formla is derived. I've not upvoted, as it is only answering the first part of the question right now. \$\endgroup\$ Aug 3 at 13:22
  • \$\begingroup\$ @GroodytheHobgoblin I don't mind. I felt it important to contribute a thorough derivation. Though I didn't mention it in the post, the crit contribution term is given in a way that can account for advantage (chance to crit = 9.75%) and disadvantage (chance to crit = 0.25%). There are much more in-depth answers above. \$\endgroup\$
    – Axoren
    Aug 3 at 21:17
  • \$\begingroup\$ thanks for outlining the interaction with A/D. I think you are right, the other answers already cover the question about the formula factor quite thoroughly, so maybe this one adds value by doing a detailed step-by-step. +1, and thank you for your help \$\endgroup\$ Aug 3 at 21:37
1
\$\begingroup\$

There are several factors to consider:

  • Your hit bonus
  • The number you crit on
  • Your damage dice
  • Your damage bonus
  • The enemy's AC

First calculate your crit chance. You can calculate your crit chance by (21 - the number you crit on) / 20. So if you crit on a 20 that's a 5% chance to crit.

Crit Chance = (21 - Number To Crit) / 20

I like to calculate chance to miss first as I find it intuitive. Our chance to miss is (AC - hit bonus - 1) / 20. You need the -1 because if you meet the roll you actually hit, so if they have AC 10 and you have no bonus and you roll a 10, then you hit. The important thing to note is that you always miss on a 1, and you always hit on a crit, so the miss chance must be between them.

Miss Chance = (AC - Hit Bonus - 1) / 20
Between 5% and 100% minus your Crit Chance

Next use this to calculate your hit chance by 1 - miss chance. If you miss 35% of the time, that means you must hit 65% of the time.

Hit Chance = 100% - Miss Chance
Between your Crit Chance and 95%

Now knowing those numbers you can calculate your chance to make a normal hit. To do that you subtract our crit chance from your hit chance. Remember that the result can't be less than 0%.

Normal Hit Chance = Hit Chance - Crit Chance
Between 0% and 100%

With this information we can start to calculate your damage for a normal attack, and for a critical hit. First calculate the average damage of your dice, you do this by (number of sides on the dice + 1) / 2, so for a 6 sided dice the average value is 3.5. If you're rolling multiple damage dice per attack, add together all those dice values to get the average of your damage dice.

Average Dice Damage = (Number of Sides + 1) / 2

You can then calculate the damage of your normal attack by adding together the average of your damage dice to your damage bonus. Then you can multiply this by your chance to make a normal hit to find your average normal attack damage.

Normal Attack Damage = Average Dice Damage + Attack Bonus
Average Normal Attack Damage = Normal Hit Chance * Normal Attack Damage

Finally we can calculate the critical damage by taking the damage of your normal attack, and adding the average of your damage dice to that - since you get to roll your damage dice again. We can multiply this by your chance to make a critical attack to find your average critical attack damage.

Crit Hit Damage = Normal Attack Damage + Average Dice Damage
Average Crit Hit Damage = Crit Chance * Crit Hit Damage

You can then add together your average normal attack damage and your average critical attack damage to find your average attack damage.

Average Attack Damage = Average Normal Attack Damage + Average Crit Hit Damage

Putting it all together in an example:

Level 1 Fighter
Hit Bonus = +5
Crit on a 20
Damage dice 1d10
Damage bonus +3

Goblin
AC 15

Crit Chance = (21 - 20) / 20 = 5%
Miss Chance = (15 - 5 - 1) / 20 = 45%
Hit Chance = 100% - 45% = 55%
Normal Hit Chance = 55% - 5% = 50%

Average Dice Damage = (10 + 1) / 2 = 5.5
Normal Attack Damage = 5.5 + 3 = 8.5
Average Normal Attack Damage = 50% * 8.5 = 4.25

Crit Hit Damage = 8.5 + 5.5 = 14
Average Crit Hit Damage = 5% * 14 = 0.7

Average Attack Damage = 4.25 + 0.7 = 4.95

Here is a quick spreadsheet https://docs.google.com/spreadsheets/d/1rjWBehLNKkxjABIVUEoXe2Bb6kgm1eWOh1F-bS1yCRI/copy

On the sheet is a damage calculator, and a tab that lets you compare a character to a certain CR - including average, min, and max AC for that CR, and a tab for comparing a character to the average for each CR.

\$\endgroup\$
1
\$\begingroup\$

By far the easiest, mathematically, way to deal with this is to think about damage per swing first.

Then split that damage into "dice damage" and "static damage".

If you have a 65% hit rate and 5% crit rate, you'll deal 70% * dice and 65% * static.

70% here is the hit rate plus the crit rate, while the static damage is just the hit rate.

What this lets you do is calculate hit/crit rates seperately (which can be tricky with advantage etc), then fold it into the damage per round calculation in an easy to verify step.

So 1d6+3 with 65% hit and 5% crit is:

Hit rate = 0.65
Crit rate = 0.05
Damage dice = 3.5
Static damage = 3

Expected Dice = Hit+Crit = 0.7
DPSwing = DiceDamage * ExpectedDice + StaticDamage * HitRate
DPSwing = 3.5 * .7 + 3 * .65 
        = 4.4

If we have a more complex situation, like 55% hit rate 10% crit rate, using a flametongue short sword while wearing a belt of 23 strength and dueling style, but have advantage, we first do the work to calculate hit and crit rates.

HitRate = 1 - MissRate
MissRate = .45^2 =~ .20
HitRate = 0.8
CritRate = 1 - .95^2 =~ 0.1

There is some tricky math there. But we can do it before we mess around with the damage.

DiceDamage = 3d6 = 10.5
StaticDamage = 6 + 2 = 8

ExpectedDice = HitRate+CritRate = 1.0
DPSwing = 10.5 * 1 + 0.8 * 7 = 16.1

This technique can be extended to even more complex situations. We have 0.1 crit rate, 65% hit rate, and are making 3 attacks. The first two are for 1d6+5, the last for 1d6. We have 4d6 sneak attack dice, and are going to save the sneak attack for crits, unless the last attack hits, in which case we give up and use it there.

Ok.

First, we'll work out the per-swing hit and crit rates:

HitRate = 1-.35^2 =~ 0.88
CritRate =~ 0.1

now, we want to work out how many damage dice and how much static damage. Well, 2 swings have static damage of 5, and 1 doesn't. And 3 have weapon damage.

StaticTotal = 5 * 2 * .88 = 8.8
WeaponTotal = 3.5 * 3 * (.88+.1) =~ 10.3

sneak attack becomes fun. What are our odds of landing a crit?

Well, .1 the first swing crits, then (1-.1)*.1 the second swing crits, for a total of .19. The odds the 3rd swing crits is then .81 * .1, totalling to 0.271.

What are the odds of any sneak attack at all? Well, it is the chance of a crit on 1 or 2, plus the chance of a hit on 3 times no-crit on 1 or 2. That is .19 + (1-.19)*.88, or .90

TotalSneak = (.27 + .9) * 4d6 =~ 16.4

then we add it up

TotalDPR = 16.4 + 8.8 + 10.3 = 35.5

The trick to this technique is I divide split kinds of damage (dice, sneak, static), then for each kind of event work out how much of that damage it delivers.

The you can add that up.

With "crit" usually being "a hit, times two", you can add (hit% + crit%) to work out the amount of "damage dice" that your attack delivers on average, without having to consider the crit and hit cases separately.

\$\endgroup\$
1
\$\begingroup\$

For funsies, I took a stab at an exploration calculator/interface using dyce¹ and anydyce². You can play around with it in your browser: Try dyce [source]

The substantive code is in expected_damage.py. It imposes a minimum on normal damage of zero, and a separate, additional minimum on crit damage of zero. This is to accommodate oddball damage dice (e.g., 1d8-2, where there is a chance outcomes could go negative without limits). This means that, with negative modifiers, this calculator will arrive at different results than pure averages. The source could be easily modified to support alternatives (e.g., a house rule that said minimum normal damage is one and minimal additional crit damage is one). It is possible to express such limits using a formula, but things tend to get a bit verbose. (Spreadsheet implementers should also keep this in mind.)

Mechanic Burst Plot

The above screenshots are for a target of 13 using a Champion Fighter's Improved Critical mechanic with normal damage of 1d6+3 and crit damage of an additional 1d6.


¹ dyce is my Python dice probability library.

² anydyce is my visualization layer for dyce meant as a rough stand-in for AnyDice.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .