Calculating attack damage in DnD 5e (2024)

2021/03/29

Calculating damage is a common — perhaps the most common — task inanalyzing builds and theorycrafting in Dungeons and Dragons. It is notan easy one, however. Like many other concepts in DnD, damage comesat the whims of dice. For this reason, damage cannot be effective describedas a single number, but rather as a distribution of possible values. On topof that, there are a number of rules and spell-specific effects that must beaccounted for when determining the range of outcomes.

In this post we’ll lay out the general framework of the damage distribution andcalculate it for a basic attack roll.

Describing damage as a probability distribution

When a character attacks or casts a spell there are typically two steps thatoccur: 1) a roll by either the player or the DM to determine the degree towhich the target is affected and 2) a subsequent damage roll that determineshow much damage is taken by the target. There is randomness at every step ofthis process so we can best represent its outcome as a probabilitydistribution p(d)p(d)p(d), which is the probability that an attack does ddd damage.

Let’s think about how we can compute this for a standard attack roll. We startby recognizing that a target can be affected by an attack in three ways: amiss, a normal hit, or a critical hit. A miss deals no damage, a normal hitwill deal damage as written in the ability block, and a critical hit dealsdamage but with double the number of dice rolled. These three possibilitiescan be represented by breaking down our damage into conditional components:

p(d)=hHp(dh)p(h)p(d) = \sum_{h\in H} p(d \,|\, h) \,p(h)p(d)=hHp(dh)p(h)

Where H={Miss,Normal,Crit}H = \lbrace \textrm{Miss}, \textrm{Normal}, \textrm{Crit} \rbraceH={Miss,Normal,Crit}. Theabove expression states that the probability that ddd damage is done is theweighted sum of doing that damage under each of our three hit types. Bybreaking it down like this, we can directly compute p(d)p(d)p(d) by first lookingat the hit probabilities, p(h)p(h)p(h), and conditional damage distributions,p(dh)p(d|h)p(dh).

It’s not too hard to see that this general formula can represent other damageprocesses. For a spell with a saving throw we could have H={Success,Fail}H = \lbrace\textrm{Success}, \textrm{Fail} \rbraceH={Success,Fail}. From there, it comes down todefining the conditional damage distributions.

The hit probabilities of an attack roll

The first step of computing our attack damage distribution is calculating thehit probabilities p(h)p(h)p(h). We will only concern ourselves with a standardroll, no advantage or disadvantage. Their effects could be explored with theappropriatesubstitution of probabilities given by advantage or disadvantage rules, andfollowing the structure of the rest of this post.

We’ll start with a critical hit. The rules state a critical hitoccurs when rolling a 20 on an attack roll. For a standard attack roll,this is simply:

p(crit)=120p(\textrm{crit}) = \frac{1}{20}p(crit)=201

Next, we examine the probability of a normal hit, i.e. a rollthat meets or exceeds a target’s AC after bonuses but is neither a criticalhit or a critical fail (which guarantees a miss).To do this, we must reach back to our previous post on dice rolls probabilities.

We introduce two new parameters: a target roll, ttt, and a bonus to add tothe roll, bbb. In an attack roll, ttt is typically the target’sarmor class. The parameter bbb is usually a combination of a proficiencybonus and a stat modifier.

As an example, suppose a fighter with a +5 to hit attempts to strike aGoblin with AC 15, then t=15t = 15t=15 and b=5b = 5b=5.

If XXX is the outcome of our attack roll, then we can write:

p(normal)={P(tbX19)tb2P(2X19)otherwisep(\textrm{normal}) = \begin{cases}P(t-b \leq X \leq 19)& t-b \geq 2\\P(2 \leq X \leq 19)& \mathrm{otherwise}\end{cases}p(normal)={P(tbX19)P(2X19)tb2otherwise

Using our dice roll probabilities, we can write this as:

p(normal)={19t+b+120tb21820otherwisep(\textrm{normal}) = \begin{cases}\frac{19 - t + b + 1}{20}& t-b \geq 2\\\frac{18}{20}& \mathrm{otherwise}\end{cases}p(normal)={2019t+b+12018tb2otherwise

The above expression describes the probability that a rollmeets or exceeds the target after bonuses, while excludingcritical hits and failures.

The last category to look at is the probability of a miss. Wecould calculate it directly as before, but it’s easier to justderive the result using the complement:

p(miss)=1p(crit)p(normal)p(\textrm{miss}) = 1 - p(\textrm{crit}) - p(\textrm{normal})p(miss)=1p(crit)p(normal)

Then we can write:

p(miss)={tb120tb2120otherwisep(\textrm{miss}) = \begin{cases}\frac{t - b - 1}{20}& t-b \geq 2\\\frac{1}{20}& \mathrm{otherwise}\end{cases}p(miss)={20tb1201tb2otherwise

With this, we fully describe the probability of an attack hittingwhen accounting for the target’s AC and the attacker’s bonuses. Fromhere, we turn our attention to the conditional damage distributions.

Damage conditional on the attack roll

The damage distributions themselves are determined by the specific attacktype or spell being used, but most follow a pattern — the total damageis determined by the sum of rolling one or more dice and adding a bonus. Wewill write mDn{}_{m}D_nmDn to represent the random variable of a sum of mmmnnn-sided dice and d0d_0d0 will be the damage bonus added, then:

p(dh)=P(mDn+d0=dh)=P(mDn=dd0h)p(d|h) = P({}_{m}D_n + d_0 = d | h) = P({}_{m}D_n = d - d_0| h)p(dh)=P(mDn+d0=dh)=P(mDn=dd0h)

With the way we’ve written the above, we can see that our damagedistribution can be written directly in terms of mDn{}_{m}D_nmDn, which weconveniently defined in a prior post.

For our normal damage distribution, we write it out directly:

p(dnormal)=1nml=0dd0mn(1)l(ml)(dd0nl1m1)p(d|\textrm{normal}) = \frac{1}{n^m}\sum_{l=0}^{\left\lfloor\frac{d - d_0 - m}{n}\right\rfloor} (-1)^l {m \choose l} {d - d_0 - nl - 1 \choose m - 1}p(dnormal)=nm1l=0ndd0m(1)l(lm)(m1dd0nl1)

Which is the full expression of our dice roll sum distribution equal to dd0d -d_0dd0 as above.

Critical hits are a simple modification of the above, substituting m2mm \to 2mm2m,which represents doubling the number of damage dice that one rolls. Thisgives:

p(dcrit)=1n2ml=0dd02mn(1)l(2ml)(dd0nl12m1)p(d|\textrm{crit}) = \frac{1}{n^{2m}}\sum_{l=0}^{\left\lfloor\frac{d - d_0 - 2m}{n}\right\rfloor} (-1)^l {2m \choose l} {d - d_0 - nl - 1 \choose 2m - 1}p(dcrit)=n2m1l=0ndd02m(1)l(l2m)(2m1dd0nl1)

Our last distribution — damage when the attack roll is missed — is thesimplest:

p(dmiss)={1d=00otherwisep(d|\textrm{miss}) = \begin{cases}1& d = 0\\0& \textrm{otherwise}\end{cases}p(dmiss)={10d=0otherwise

When an attack is missed, damage done is 0 with probability 1. Simple enough.

Complete damage distributions

We now have all the necessary components to compute p(d)p(d)p(d) in its entirety.As a reminder, for an attack roll we have:

p(d)=p(dmiss)p(miss)+p(dnormal)p(normal)+p(dcrit)p(crit)p(d) = p(d|\textrm{miss})p(\textrm{miss}) + p(d|\textrm{normal})p(\textrm{normal}) + p(d|\textrm{crit})p(\textrm{crit})p(d)=p(dmiss)p(miss)+p(dnormal)p(normal)+p(dcrit)p(crit)

It would be too verbose to substitute all of our values directly into thisexpression, but easy enough to describe the output by looking at graphs ofdifferent damage distributions. Let’s consider some examples:

Suppose Ria, a fighter, is facing down a zombie. Her attack bonuswith her longsword is +5 and the zombie’s AC is 8. Ria’s longsword deals1d8 + 3 slashing damage. What is the damage distribution of her strike?

From the prompt, we know that t=8t = 8t=8, b=5b=5b=5, m=1m=1m=1, n=8n=8n=8, and d0=3d_0 = 3d0=3.All there is to do now is plug these values into our previously describedexpressions. The below graph shows the probable outcomes of her strike.

It’s not exactly a bell curve to say the least. The complex behavior isthe mixture of our three possible damage conditions — the single bar at0 is the probability of missing, the mostly uniform damage from 4 to 11is the damage from a normal hit, and the triangular distribution that lieson top of that is the critical hit damage.

The shapes and relative magnitudes depend on all the parameters present.To see just how different they can be, let’s consider another situation.

An adventuring party is going toe to toe with a large Ogre. Yar, a cleric,calls on the power of his deity to cast Inflict Wounds at 1st level. Hisspellcasting ability modifier is +5 and the AC of the Ogre is 11. Damagedealt on a hit is 3d10 necrotic damage. What is the damage distribution?

We approach this in a similar way to before, noting that t=11t = 11t=11, b=5b=5b=5,m=3m=3m=3, n=10n=10n=10, and d0=0d_0 = 0d0=0.

Now we see an entirely different distribution. The 0 damage possibility hasrisen to 25% and the bulk of the non-zero damage forms a familiar bell curvefrom the 3-dice sum with a long tail that represents possible crit damage.

In both of these examples, the mixture of different attack roll outcomesgives rise to non-trivial damage outcomes. Even so, thedamage from an attack roll that we explored here is one of the simplestdamage mechanics in 5e. Varying spell effects, different damage types, andother features all paint a rich mechanical picture. It suffices to say thatwe still have much to explore in this realm, but that will be for future posts.

Calculating attack damage in DnD 5e (2024)

References

Top Articles
Latest Posts
Article information

Author: Annamae Dooley

Last Updated:

Views: 6088

Rating: 4.4 / 5 (45 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Annamae Dooley

Birthday: 2001-07-26

Address: 9687 Tambra Meadow, Bradleyhaven, TN 53219

Phone: +9316045904039

Job: Future Coordinator

Hobby: Archery, Couponing, Poi, Kite flying, Knitting, Rappelling, Baseball

Introduction: My name is Annamae Dooley, I am a witty, quaint, lovely, clever, rich, sparkling, powerful person who loves writing and wants to share my knowledge and understanding with you.