10
\$\begingroup\$

I'm trying to determine the average damage per round for a homebrew fighting style, so that I can compare it to other types of combat choices, and see if thing will remain balanced, when we introduce this (or not).

Apart from the concrete scenario that triggered this question, I'm also interested in learning how to actually calculate the probabilities involved in this scenario (is this indeed a recursive combined probability?)

The scenario:

  • The Player can make X attacks per round;
  • Before each attack, the Player can choose to attack with disadvantage. If such an attack hits, he can make an additional attack, as bonus action1.

Let's say the player want to trigger the bonus attack, so he is always going to choose to attack with disadvantage, until he gets the bonus attack. Once the bonus attack is triggered, he will not impose disadvantage on any subsequent attacks this round.


So my question is, how can I:

  1. calculate the combined probability of main attack(s) hitting, such that: \$averageDamageFromAttacks = combinedHitProbability \times averageDamagePerHit\$
  2. calculate the probability of the bonus attack being triggered?

Note:
For this question, I would like to focus on the probabilities involved in the mechanics described. So let's say that the probability to hit (and miss) a single attack, both with and without disadvantage, as well as the average damage per hit, are all known values.

Note 2:
enter image description here Figure 1: a schematic view of when to player will attack with disadvantage, and when without disadvantage.


1. As per the rules, the Player can of course only ever take a single bonus action.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ I would suggest balancing this against someone without disadvantage, because nobody is going to use it unless they have a source of advantage to balance it out or are almost guaranteed to hit anyway. I am looking at reckless attack, optional flanking rules etc \$\endgroup\$
    – SeriousBri
    Commented Oct 31, 2023 at 12:20
  • 1
    \$\begingroup\$ @SeriousBri there are various other options we might choose in practice, but it still leaves me with the question: how do I calculate the probabilities. \$\endgroup\$
    – Jacco
    Commented Oct 31, 2023 at 17:11
  • \$\begingroup\$ Eventually, the answers to this question lead to: Is this verstatile fighting style and feat combination well balanced?. \$\endgroup\$
    – Jacco
    Commented Nov 15, 2023 at 19:02

4 Answers 4

4
+100
\$\begingroup\$

Chance of Triggering the Bonus Attack

The chance of triggering a bonus attack is quite a bit simpler, assuming you follow the strategy of always attacking with disadvantage if you haven't triggered it yet.

You will only fail to trigger the bonus action if all of your regular attacks miss, and the probability of each attack missing is \$(1-p^2)\$. So the final probability is

$$1 - \left(1-p^2\right)^n$$

And the corresponding probabilities are:

\$p\$ 1 attack 2 attacks 3 attacks 4 attacks
0.4 0.1600 0.2944 0.4073 0.5021
0.45 0.2025 0.3640 0.4928 0.5955
0.5 0.2500 0.4375 0.5781 0.6836
0.55 0.3025 0.5135 0.6607 0.7633
0.6 0.3600 0.5904 0.7379 0.8322
0.65 0.4225 0.6665 0.8074 0.8888
0.7 0.4900 0.7399 0.8673 0.9323
0.75 0.5625 0.8086 0.9163 0.9634
0.8 0.6400 0.8704 0.9533 0.9832
0.85 0.7225 0.9230 0.9786 0.9941
0.9 0.8100 0.9639 0.9931 0.9987
0.95 0.9025 0.9905 0.9991 0.9999

Expected Damage (without crits)

Let \$p\$ be your chance to hit, \$n\$ be your number of regular attacks, \$d\$ be your average damage on a hit.

Then the expected damage of an attack without disadvantage is \$pd\$.

Then we can break it into cases based on which is your first regular attack that hits.

  • If your first attack hits, you deal its damage, and the expected damage of the rest of your attacks is \$npd\$ since you have \$n-1\$ regular attacks and the bonus attack left. So the total is \$d+npd\$. The odds of this happening are \$p^2\$
  • If your second attack is the first hit, you deal its damage and \$n-1\$ more attacks, so the expected damage is \$d + (n-1)pd\$. The chance of this happening is \$(1-p^2)p^2\$ since you would first have to miss your first attack and then hit your 2nd.
  • If your first hit is your third attack, the expected damage is \$d+(n-2)pd\$ and the odds are \$(1-p^2)^2p^2\$.
  • If your first hit is your fourth attack, the expected damage is \$d+(n-3)pd\$ and the odds are \$(1-p^2)^3p^2\$.
  • And of course, if all your attacks miss, your damage is \$0\$.

So to get the total expected damage, we need to add these all up. Doing so gives us the following formula: $$\sum_{i=1}^n p^2(1-p^2)^{i-1}\left(d + (n+1-i)pd\right)$$ This can be simplified a bit by starting labelling the first attack 0 instead of 1:

$$\sum_{i=0}^{n-1} p^2(1-p^2)^{i}\left(d + (n-i)pd\right)$$

And a bit more by factoring out \$d\$:

$$d\sum_{i=0}^{n-1} p^2(1-p^2)^{i}\left(1 + (n-i)p\right)$$

Now the summation represents the expected number of successful hits. Unfortunately, the expected number of hits is still too complex (for me) to work out by hand, so I worked it out in Python for some common values of \$n\$ and \$p\$. All of these values need to be multiplied by \$d\$ to get the final expected damage.

\$p\$ 1 attack 2 attacks 3 attacks 4 attacks
0.4 0.2240 0.4762 0.7520 1.0477
0.45 0.2936 0.6189 0.9695 1.3401
0.5 0.3750 0.7812 1.2109 1.6582
0.55 0.4689 0.9623 1.4728 1.9953
0.6 0.5760 1.1606 1.7508 2.3445
0.65 0.6971 1.3743 2.0401 2.6991
0.7 0.8330 1.6008 2.3354 3.0531
0.75 0.9844 1.8369 2.6318 3.4014
0.8 1.1520 2.0787 2.9243 3.7408
0.85 1.3366 2.3217 3.2091 4.0695
0.9 1.5390 2.5604 3.4835 4.3879
0.95 1.7599 2.7888 3.7465 4.6973

Something we can see from the table is that if your hit chance is \$0.6\$ or lower, this feature doesn't add damage compared to attacking \$n\$ times without disadvantage (the expected damage of that is \$npd\$, so \$0.6, 1.2, 1.8, 2.4\$ for that row). Given that in normal play, hit chances tend to be around \$0.65\$, this feature will add some damage, but not a huge amount unless you combine it with other features that increase your accuracy.

Expected damage (with crits)

The formula gets more complicated if you want to factor in the damage with crits.

Let \$n\$ be the number of regular attacks, \$p\$ be your chance to hit, \$c\$ be your chance to crit, \$d_n\$ be your damage on a normal hit and \$d_c\$ be your extra damage on a crit.

Then the expected damage of a normal attack is \$pd_n + cd_c\$. But the expected damage of an attack with disadvantage is \$p^2d_n + c^2d_c\$.

Then your final expected damage is:

$$\sum_{i=0}^{n-1}(1-p^2)^{i} \left(c^2d_c + p^2d_n + p^2(n-i)(pd_n + cd_c) \right)$$

We are still calculating the probability of hitting on the \$i\$'th attack, then adding its damage with the expected damage of the rest of your normal attack + bonus action attack.

But now we add the term \$c^2d_c\$ to account for the possibility of a crit on the disadvantage attack, and the expected damage of the rest of your attacks is \$(n-i)(pd_n + cd_c)\$.

There are many more variables here, so I'll make a table with some variables fixed. I'll use a crit rate of \$c =1/20\$, and to make it easier to compare to the table without crits I'll use \$d_n = 1\$ and \$d_c = 0.7\$ (which is based on a greatsword user with +3 from strength, obviously the ratio between normal damage and crit damage chances based on a lot of factors).

\$p\$ 1 attack 2 attacks 3 attacks 4 attacks
0.4 0.2314 0.4953 0.7866 1.101
0.45 0.3025 0.6419 1.011 1.403
0.5 0.3855 0.8084 1.259 1.731
0.55 0.4812 0.9938 1.528 2.078
0.6 0.5903 1.197 1.813 2.437
0.65 0.7137 1.415 2.11 2.8
0.7 0.8519 1.647 2.412 3.162
0.75 1.006 1.887 2.715 3.518
0.8 1.176 2.134 3.013 3.864
0.85 1.364 2.381 3.303 4.199
0.9 1.569 2.625 3.582 4.522
0.95 1.793 2.857 3.85 4.835
\$\endgroup\$
16
  • 1
    \$\begingroup\$ Thank you for following up. I think it would be even better if the answer added the calculation of the bonus attack probability and expected damage (including critical damage), to get the overall expected damage, not just the base attack damage. \$\endgroup\$ Commented Nov 1, 2023 at 6:18
  • 1
    \$\begingroup\$ Given that \$d\$ includes the damage from critical hits, but \$d\$ does not differentiate between \$d_{disadvantage}\$ and \$d_{normal}\$, I guess an \$averageDamageFromAttacks\$ that takes the lower critical probability of \$d_{disadvantage}\$ into account needs additional calculations? \$\endgroup\$
    – Jacco
    Commented Nov 1, 2023 at 23:07
  • 1
    \$\begingroup\$ @Jacco I think that the term you are searching for is "conditional probability". \$\endgroup\$
    – Eddymage
    Commented Nov 2, 2023 at 8:17
  • 1
    \$\begingroup\$ @Jacco in your simulation, the only comparable thing is the chance to trigger bonus attack? I agree with the calculation here, though. For 1 attack, to hit +0, AC 13 (so p=0.4), your simulation says bonusAttackTriggerProbability is 0.2572, that can't be right. Both of your attack rolls need to be 13 or above to hit. The chance of that happening is 0.4*0.4 = 0.16, which is what the first cell in this table shows. In your code, you have a typo in "if (attackRoll === 1) {return 'mis';}" which causes the number of misses to be undercounted. \$\endgroup\$
    – justhalf
    Commented Nov 3, 2023 at 3:23
  • 1
    \$\begingroup\$ @MannerPots, while my (bugfixed) simulation now comes to the same results for the 'Probability of Triggering the Bonus Attack', it still gives a different 'Probability for Hitting the Target'... Given that one simulation collects both probabilities, and it gets the 'Probability of Triggering the Bonus Attack' right, I'm tempted to think that the numbers in your first table are not yet correct? \$\endgroup\$
    – Jacco
    Commented Nov 3, 2023 at 18:20
5
\$\begingroup\$

Full Answer

Answering these questions:

  1. What is the expected number of hits using the strategy outlined in the question:
    • without including the expected number of hits from the BA attack
    • with including the expected number of hits from the BA attack
  2. What is the expected damage using the strategy outlined in the question:
    • without including the expected damage from the BA attack
    • with including the expected damage from the BA attack
  3. What is the probability to trigger the bonus attack?

Q1 and Q2 are split, unlike the intent in OP question since, due to how critical damage and disadvantage interact, we can't simply get the expected damage from the expected number of hits.

Assumptions

  1. Let the average damage from a single non-critical attack on a hit be in the form: \$D + d\$, where \$D\$ is the damage components which are from dice damage (e.g., 1d4 for a dagger \$\rightarrow D=\frac{4+1}{2}=2.5\$, and 2d6 for a greatsword \$\rightarrow D=2\frac{6+1}{2}=7\$), while \$d\$ is the fixed damage (e.g., +3 from your Str or Dex). Note that on a critical hit, the damage will be \$2D+d\$ as only the dice is doubled.
  2. Let \$p\$ be the probability of an attack to hit on a flat roll. Note that due to a nat 20 always hitting and nat 1 always missing, we have \$0.05 \leq p \leq 0.95\$. For example with a +10 to hit against a 18 AC target, we will hit on a roll of 8-20, so \$p=0.65\$ in this case.
  3. Let \$p'\$ be the probability of an attack to crit. This is normally 0.05 as crit is only on nat 20, but some class features (e.g., Champion) may modify this (i.e., 0.1 for crit on 19-20).

We will start with explaining the basics for probability to hit, expected number of hits, and expected damage, including critical hits. These will be used later in the final calculation.

Basics of Expected Number of Hits

If we have 1 attack with probability \$p\$ to hit, what is the expected number of hits? This is simply: $$1\cdot p = p$$

If that attack is with disadvantage, the expected number of hits is simply: $$1\cdot p^2 = p^2$$

If there are \$N^\circ\$ attacks with flat roll and \$N^-\$ attacks at disadvantage, the expected number of hits: $$N^\circ\cdot p + N^-\cdot p^2$$

Basics of Expected Damage

For the purpose of explanation, we start from the simplest case and then progressively go closer to our goal.

What is the expected damage from a single attack with probability \$p\$ to hit?

There are two components here:

  • Expected damage without accounting for critical hit. This is simply \$p(D+d)\$
  • Expected extra damage on a crit. This is simply \$p'\cdot D\$

The total expected damage, accounting for critical hits, \$E_1(p,p')\$:

$$\fbox{$E_1(p,p') = p(D+d) + p'D$}$$

Example for a dagger with 1d4+3 damage, and 0.65 to hit, 0.05 to crit (only on nat 20):

$$E_1(0.65,0.05) = 0.65\cdot(2.5+3) + 0.05\cdot 2.5 = 3.575 + 0.125 = 3.7$$

Another way to calculate this, if you're unconvinced by the formula above, is to separate the non-crit hits and crit hits:

$$\begin{array}{rl} E_1(p,p') &= \underbrace{(p-p')(D+d)}_{\text{non-crit avg dmg}} + \underbrace{p'(2D+d)}_{\text{crit avg dmg}}\\ &= p(D+d) - p'(D+d) + p'(D+d) + p'D\\ &= p(D+d) + p'D\end{array}$$

So, the same as the previous one, so we're good.

What is the expected damage from a single attack with Disadvantage?

To hit, we need both rolls to hit, and to crit we need both rolls to crit, so:

$$\fbox{$E_1^-(p,p') = p^2(D+d) + p'^2\cdot D$}$$

Example with the same 1d4+3 dagger:

$$E_1^-(0.65,0.05) = 0.65^2(2.5+3) + 0.05^2\cdot2.5 = 2.32375 + 0.00625 = 2.33$$

What is the expected damage from an attack with disadvantage given it hits?

This is slightly different from the previous one, since this one assumes the attack hits, and then we ask "What's the expected damage from this attack that we know it hits?"

This is \$\displaystyle \underbrace{(D+d)}_{\text{base damage, since we know it hits}}+\underbrace{\frac{p'^2}{p^2}}_{\text{p to crit given it hits}}D = \fbox{$\frac{E_1^-(p,p')}{p^2}$}\$.

What is the expected damage from \$N\$ attacks?

Due to linearity of expectation, simply add them together!

$$E_N(p,p') = N\cdot E_1(p,p')$$

$$E_N^-(p,p') = N\cdot E_1^-(p,p')$$

The Real Question

Now we're ready to answer the real question.

This is basically the same proof as MannerPots' answer, but with critical damage included.

What is the expected damage of the strategy outlined in the question?

For clarity, we outline the strategy here:

  • We have \$N\$ main attacks, each with probability \$p\$ to hit, and \$p'\$ to crit.
  • If we choose to hit with disadvantage with one of our main attacks and hit, we gain a single bonus attack (BA), with the same probability \$p\$ to hit, and \$p'\$ to crit.
  • Keep attacking at disadvantage until we get a hit, then roll normally for all subsequent attacks
  • When we gain the BA from hitting with one of our main attacks, we take it.

We consider each of the following cases separately:

  1. First attack with disadvantage hits, then we roll normally for the rest \$N-1\$ attacks, plus one BA. So we have \$N\$ attacks with flat roll. These attacks have an expected damage of \$E_N(p,p')\$. Together with the first hit, the total expected damage from this case is \$\displaystyle\frac{E_1^-(p,p')}{p^2}+E_N(p,p')\$. This case happens \$p^2\$ of the time, when the first attack hits.
  2. First attack misses, second attack hits. We have 1 miss at disadvantage (probability \$1-p^2\$), 1 hit at disadvantage (probability \$p^2\$; expected damage \$\displaystyle\frac{E_1^-(p,p')}{p^2}\$), and \$N-1\$ attacks including BA (expected damage \$E_{N-1}(p,p')\$). Total expected damage \$\displaystyle\frac{E_1^-(p,p')}{p^2}+E_{N-1}(p,p')\$. This case happens with probability \$(1-p^2)\cdot p^2\$
  3. First two attack miss, third attack hits. Similarly, we have expected damage from this case \$\displaystyle\frac{E_1^-(p,p')}{p^2}+E_{N-2}(p,p')\$ with probability \$(1-p^2)^2\cdot p^2\$.
  4. ...
  5. The first \$N-1\$ attack miss, last attack hit. Expected damage \$\displaystyle\frac{E_1^-(p,p')}{p^2}+E_1(p,p')\$, probability \$(1-p^2)^{N-1}\cdot p^2\$.
  6. All attacks miss, and we don't get BA. 0 damage, probability \$(1-p^2)^N\$.

Total expected damage is sum of (probability x expected damage of each case):

$$\begin{array}{rl} E &= \displaystyle\sum_{i=0}^{N-1}(1-p^2)^i\cdot p^2 \cdot \left(\frac{E_1^-(p,p')}{p^2}+E_{N-i}(p,p')\right) \\ &= \displaystyle \left[E_1^-(p,p')\sum_{i=0}^{N-1} (1-p^2)^i\right] + \left[p^2E_1(p,p')\sum_{i=0}^{N-1}(1-p^2)^i(N-i)\right] \\ &= \displaystyle \left[\left(E_1^-(p,p')+Np^2E_1(p,p')\right)\sum_{i=0}^{N-1}(1-p^2)^i\right] - \left[p^2E_1(p,p')\sum_{i=0}^{N-1}i(1-p^2)^i\right] \end{array}$$

Note that this is the same form as the original MannerPots' answer, but we have \$E_1^-(p,p')\$ in place of \$p^2d\$, and \$E_1(p,p')\$ in place of \$pd\$.

Now, substituting the expectation and separating \$p\$ from \$p'\$ we have:

$$\begin{array}{rcl} E &=& \displaystyle \left[\left(E_1^-(p,p')+Np^2E_1(p,p')\right)\sum_{i=0}^{N-1}(1-p^2)^i\right] - \left[p^2E_1(p,p')\sum_{i=0}^{N-1}i(1-p^2)^i\right] \\ &=& \displaystyle (D+d)\left(Np+\frac{(p^2+p-1)(1-(1-p^2)^N)}{p}\right) \\ &&\displaystyle + D\left(Np' + \frac{p'(p^2+p'-1)(1-(1-p^2)^N)}{p^2}\right) \end{array}$$

The first term is the same as the MannerPots' non-crit version, and the second term gives the additional term from the crit damage. After writing all these, I note that we can replace \$D+d\$ in the first term with "damage when not critting" and \$D\$ in the second term with "extra damage when crit".

Table for D=0, d=1 (equivalent to Number of Hits)

p 1 attack 2 attacks 3 attacks 4 attacks 5 attacks
0.05 0.0026 0.0054 0.0082 0.0112 0.0143
0.10 0.0110 0.0229 0.0357 0.0493 0.0638
0.15 0.0259 0.0545 0.0859 0.1200 0.1567
0.20 0.0480 0.1021 0.1620 0.2275 0.2984
0.25 0.0781 0.1670 0.2659 0.3743 0.4915
0.30 0.1170 0.2505 0.3989 0.5610 0.7355
0.35 0.1654 0.3534 0.5612 0.7865 1.0270
0.40 0.2240 0.4762 0.7520 1.0477 1.3600
0.45 0.2936 0.6189 0.9695 1.3401 1.7269
0.50 0.3750 0.7813 1.2109 1.6582 2.1187
0.55 0.4689 0.9623 1.4728 1.9953 2.5261
0.60 0.5760 1.1606 1.7508 2.3445 2.9405
0.65 0.6971 1.3743 2.0401 2.6991 3.3544
0.70 0.8330 1.6008 2.3354 3.0531 3.7621
0.75 0.9844 1.8369 2.6318 3.4014 4.1600
0.80 1.1520 2.0787 2.9243 3.7408 4.5467
0.85 1.3366 2.3217 3.2091 4.0695 4.9224
0.90 1.5390 2.5604 3.4835 4.3879 5.2887
0.95 1.7599 2.7888 3.7465 4.6973 5.6474
1.00 2.0000 3.0000 4.0000 5.0000 6.0000

For the expected number of hits excluding the BA attack, simply subtract the expected number of hits from BA, which is just probability to trigger BA times expected number of hits from a BA (flat roll).

$$\begin{array}{rcl} E_{\text{Main}} &=& E - E_{\text{BA}} \\ &=& \displaystyle (D+d)\left(\left(N-1+(1-p^2)^N\right)p+\frac{(p^2+p-1)(1-(1-p^2)^N)}{p}\right) \\ &&\displaystyle + D\left(\left(N-1+(1-p^2)^N\right)p' + \frac{p'(p^2+p'-1)(1-(1-p^2)^N)}{p^2}\right) \end{array}$$

Table for D=2.5 d=3 (Dagger 1d4+3)

p 1 attack 2 attacks 3 attacks 4 attacks 5 attacks
0.05 0.0210 0.0429 0.0658 0.0897 0.1145
0.10 0.0680 0.1421 0.2221 0.3082 0.4001
0.15 0.1514 0.3207 0.5076 0.7117 0.9326
0.20 0.2752 0.5885 0.9382 1.3299 1.7413
0.25 0.4438 0.9535 1.5252 2.1548 2.8389
0.30 0.6610 1.4223 2.2748 3.2103 4.2214
0.35 0.9311 1.9993 3.1878 4.4818 5.8684
0.40 1.2583 2.6872 4.2595 5.9522 7.7461
0.45 1.6465 3.4861 5.4797 7.5960 9.8103
0.50 2.1000 4.3938 6.8328 9.3809 12.0106
0.55 2.6229 5.4052 8.2988 11.2699 14.2951
0.60 3.2193 6.5123 9.8533 13.2244 16.6148
0.65 3.8933 7.7049 11.4693 15.2065 18.9280
0.70 4.6490 8.9677 13.1180 17.1825 21.2031
0.75 5.4906 10.2834 14.7709 19.1248 23.4202
0.80 6.4223 11.6303 16.4011 21.0147 25.5715
0.85 7.4480 12.9828 17.9867 22.8433 27.6590
0.90 8.5720 14.3114 19.5127 24.6117 29.6912
0.95 9.7984 15.5821 20.9744 26.3285 31.6789
1.00 11.1313 16.7563 22.3813 28.0063 33.6313

For reference, expected damage with just 1 attack flat roll (including crit) is 3.7. So \$p=0.65\$ improves the expected damage, similar conclusion as before.

Probability to trigger bonus attack

For completeness, the probability to trigger the bonus attack is \$1-(1-p^2)^N\$, the full reasoning can be read in MannerPots' answer. Basically we find the probability of not triggering it, then take the opposite.


Old Answer

Continuing MannerPots excellent answer to get a closed form, the average damage is:

$$ \begin{array}{rcl} \bar{d} &=&\displaystyle \sum_{i=0}^{n-1} p^2(1-p^2)^{i}\left(d + (n-i)pd\right) \\ &=&\displaystyle p^2d\left((1+np)\sum_{i=0}^{n-1}(1-p^2)^i - p\sum_{i=0}^{n-1}i(1-p^2)^i\right)\\ &=&\displaystyle p^2d\left((1+np)\frac{1-(1-p^2)^n}{p^2} - p(1-p^2)\frac{1-(1-p^2)^n-np^2(1-p^2)^{n-1}}{p^4}\right)\\ &=&\displaystyle d\left(np+\frac{(p^2+p-1)(1-(1-p^2)^n)}{p}\right) \end{array} $$

Compared to the base case \$dnp\$, there is the extra probability at the end. And it's positive or negative depends on whether \$p^2+p-1\$ is positive or negative. It's positive when \$p > 0.618\$, similar to MannerPots's conclusion, that you need 0.65 chance to hit in order to benefit using this strategy. Note that this doesn't depend on \$n\$, the number of attacks you can make.

Against an 18 AC enemy, this means you need +10 to hit in order to benefit. +9 against 17 AC, +8 against 16 AC, etc. This seems not too different from sharpshooter, where you need a certain chance to hit in order to benefit from it. So I'd also say that this feature is ok.

\$\endgroup\$
9
  • \$\begingroup\$ wow, now that's an answer! \$\endgroup\$
    – Jacco
    Commented Nov 4, 2023 at 15:51
  • 1
    \$\begingroup\$ @Jacco I added the tables as well. For D=0, d=1, it's equivalent to the number of hits, and is the same as MannerPots' table. \$\endgroup\$
    – justhalf
    Commented Nov 4, 2023 at 16:15
  • 1
    \$\begingroup\$ Yes. You can see on the first table with D=0, d=1, p=1.0. Expected damage is 2 with N=1 since the main attack always hits, so we always get BA, and the BA always hits too. \$\endgroup\$
    – justhalf
    Commented Nov 4, 2023 at 23:01
  • 3
    \$\begingroup\$ @DaleM of course. But that's out of scope of this question. \$\endgroup\$
    – justhalf
    Commented Nov 5, 2023 at 11:41
  • 2
    \$\begingroup\$ @DaleM I have to agree with justhalf here. The questions you pose are definitely interesting, but outside the scope of this question. \$\endgroup\$
    – Jacco
    Commented Nov 5, 2023 at 13:52
4
\$\begingroup\$

Average damage per round.

Suppose that the probability to hit is p and the expected damage output is d + b, where d is the damage from dice and b is the static bonus: hence the expected damage per round (DPR) for a single attack is $$ {\rm E}[DPR \text{ for 1 att}] = pd+d\frac{1}{20}+b = d\left(p+\frac{1}{20}\right) +b $$ where the term \$d/20\$ accounts for critical hits. The expected DPR for X attacks is simply $$ {\rm E}[DPR \text{ for } X \text{ atts}] = X\cdot{\rm E}[DPR \text{ for 1 att}]=X\cdot d\left(p+\frac{1}{20}\right) +X\,b, $$ for the linearity of the expected value.

When attacking with disadvantage, the probability to hit reduces to \$p^2\$, hence the DPR for 1 attack reduces to $$ {\rm E}_{disadv}[DPR \text{ for 1 att}] = d\left(p^2+\frac{1}{400}\right)+b, $$ where the probability to critically hit is modified to 1/400. Consequently, $$ {\rm E}_{disadv}[DPR \text{ for } X \text{ atts}] = X\cdot{\rm E}_{disadv}[DPR \text{ for 1 att}]=X\cdot d\left(p^2+\frac{1}{400}\right) +X\,b. $$

The proposed mechanics does not obey to the above laws, since the probability to hit is not the same for all the attacks. The expected damage when one has X attacks available is $$ {\rm E}[\text{damage on X attacks}] = (d+b)\sum_{n=1}^X nP_X(n) + {\rm E}[\# \text{ crits}]\,d $$ where

  • P(n) is the probability to land n attacks
  • E[# crits] is the expected number of critical hits.

One has $$ P(n) = p^2 \sum_{k=1}^{X-n}(1-p^2)^i \mathcal{B}(n-1,X-i,p) $$ and $$ {\rm E}[\# \text{ crits}] = (1-(1-p^2)^X)\left(1/400 + 1/20(X-p^2\sum_{k=0}^{X-1}i(1-p^2)^i)\right). $$

In the above formula, \$\mathcal{B}(x,n,p)\$ is the binomial distribution which provide the probability of x success on n trials given the probability of success p. The mathematical derivation is given below.

For a comparison, an experiments has been carried on with p=0.5, d=2.5, b=3 (as in this answer) and the results are plotted in the figure below. The results match with the ones of the other answers.

Comparison between simulation and theory

Number of expected hits.

Due to the particular mechanics, the number of expected hits depends if and when the disadvantage attack lands. Let's consider the case of having X attacks available and compute the probability to hit 3 times: there are several ways in which this can happen.

  • the first attack hits with probability \$p^2\$ and we have X remaining attempt to hit other 2 times with probability p, i.e., we have to compute the probability of 2 successes on X attempts.

  • the first attack with disadvantage misses and the second hit (with disadvantage), and we have to to compute the probability of 2 successes on X-1 attempts.

  • the first and second attacks with disadvantage miss and the 3rd hit (with disadvantage), and we have to to compute the probability of 2 successes on X-2 attempts.

  • ...

There is a pattern here: hence the probability of landing 3 attacks on X attempts is given by $$ P_X(3) = \sum_{i=0}^{X-3}p^2(1-p^2)^i \mathcal{B}(2,X-i,p) $$ where \$p^2(1-p^2)^i\$ accounts for the probability to miss the first i attacks and hit on the i+1-nth and \$\mathcal{B}(2,X-i,p)\$ accounts for the probability of 2 successes on X-i attempts. The generalization for n successes is $$ P_X(n) = \sum_{i=0}^{X-n}p^2(1-p^2)^i \mathcal{B}(n-1,X-i,p). $$

Expected number of critical hits.

This depends on the probability to land at least one disadvantage attack, which is given by \$1-(1-p^2)^X\$. The number of expected crits is given hence by 1/400 (probability to crit with the disadvantage attack) plus the expected number of crits on the remaining attacks with a straight roll, that can range from 1 to X (the bonus one and the others). This is given by $$ {\rm E}[\# \text{ crits}] = (1-(1-p^2)^X)\left(1/400 + 1/20(X-p^2\sum_{k=0}^{X-1}i(1-p^2)^i)\right). $$
where the first factor accounts for the probability to land at least one disadvantage attack, 1/400 the pro to crit with the disadvantage attack and the other term stands for the expected number of critical hits on the remaining attacks. The latter is given by X minus the missed attacks with disadvantage.

Probability of triggering the bonus attack.

The bonus attack (BAt) is available when at least one of the main attacks hit: its probability is equal to one minus the probability that no attack hits. The latter is given by the binomial distribution.

A more simple explanation is given by the fact that the probability to not hit with one attack is one minus the probability to hit: $$ 1-p^2.$$ This must occur for each attack: $$ P(\text{each attack fails}) = P(\text{1st attack fails})P(\text{2nd attack fails})\dots P(\text{Xth attack fails}) $$ All these probabilities are multiplied because the attacks are independent. Then $$ P(\text{each attack fails}) = (1-p^2)^X. $$ The probability of having at least one successful attack is $$ P(\text{at least one attack hits})=1-P(\text{each attack fails}) = 1-(1-p^2)^X. $$

The above computation takes into account that all the attacks are done with disadvantage. If the attacker stops attacking with disadvantage after triggering the bonus attack, the computation looks different, but the result is the same.

The probability of getting the BAt after the 1st attack corresponds to the probability of the first attack hitting: $$ P(\text{BAt at 1st attack}) = p^2. $$ The probability of getting the BAt at the 2nd attack is given by the first attack missing and the 2nd hitting: $$ P(\text{BAt at 2nd attack}) = (1-p^2)p^2. $$ Then, the probability of getting the BAt at the _n_th attack is $$ P(\text{BAt at nth attack}) = (1-p^2)^{n-1}p^2. $$

The probability hence to get at least one BAt is given by the sum of all of these: $$ p^2 + (1-p^2)p^2 + (1-p^2)^2p^2 + \dots + (1-p^2)^{X-1}p^2 = p^2\sum_{i=0}^{X-1} (1-p^2)^i $$ which sums up to $$ \begin{eqnarray*} p^2\sum_{i=0}^{X-1} (1-p^2)^i &=& p^2\frac{1-(1-p^2)^X}{1-(1-p^2)}\\ &=& p^2\frac{1-(1-p^2)^X}{1-1+p^2}\\&=&1-(1-p^2)^X. \end{eqnarray*} $$

Approximated models.

Instead of using the exact formulas for the expected numbers of landed crits and hits, one can employ approximation to have a simpler model. For the expected number of hits, this is given by $$ {\rm E}[\text{number of hits}] \sim 0.4852 X -0.2703 $$ while for the expected number of critical hits this could be given by $$ {\rm E}[\# \text{ crits}] \sim 0.0004608X^2 + 0.03546X -0.03341. $$

These approximations have been computed on the theoretical results obtained for X=1,...,20.

\$\endgroup\$
7
  • \$\begingroup\$ This answer seems to go with the assumption that all attacks are made at a disadvantage, which is not necessarily the case? \$\endgroup\$
    – Jacco
    Commented Oct 31, 2023 at 17:48
  • \$\begingroup\$ @Jacco that's what you wrote in your question, you want the probability to trigger the bonus attack. A different question is "what's the prob to get the bonus attack after the 1st, 2nd, 3rd, ...., xth attack?" But I think that it may lead to the same answer. \$\endgroup\$
    – Eddymage
    Commented Oct 31, 2023 at 17:52
  • \$\begingroup\$ @Jacco I expanded the answer to account your request. Tell me if it is clear enough. \$\endgroup\$
    – Eddymage
    Commented Oct 31, 2023 at 18:37
  • \$\begingroup\$ I think you really nicely answered part 2 of the question (the probability of triggering the bonus attack). But, as far a I understand your answer on the first part of the question (the average damage per round), it still assumes disadvantage is imposed on all attacks? \$\endgroup\$
    – Jacco
    Commented Oct 31, 2023 at 18:51
  • 1
    \$\begingroup\$ Ok, this is probably my lack of Math skills... but, given that some attacks would be made with disadvantage, I would expect the combined probability to hit, in the scenario as described, to fall somewhere between the 'combined probability to hit when all attacks have disadvantage' and the 'combined probability to hit, when none of the attacks have disadvantage'? \$\endgroup\$
    – Jacco
    Commented Oct 31, 2023 at 19:50
2
\$\begingroup\$

TL;DR

There is a closed-form non-recursive formula for computing expected DPR accounting for the possibility of critical hits with an arbitrary number of attacks. Find it below.

Using this is not something you'd want to do very often unless your target is easy to hit or your bonus attack does a lot of damage relative to your main attack. For example, suppose you get 2 attacks per round and do on average 10 damage per hit or 17 on a crit (both regular and bonus attacks). Then your expected DPR as a function of the roll needed to hit are:

Roll Needed To Hit Probability of hit Damage Using Normal Attack Damage Using Disadvantage
2 0.95 19.35 28.57
3 0.90 18.35 26.25
4 0.85 17.35 23.81
5 0.80 16.35 21.34
6 0.75 15.35 18.87
7 0.70 14.35 16.47
8 0.65 13.35 14.15
9 0.60 12.35 11.97
10 0.55 11.35 9.94
11 0.50 10.35 8.08
12 0.45 9.35 6.42
13 0.40 8.35 4.95
14 0.35 7.35 3.69
15 0.30 6.35 2.63
16 0.25 5.35 1.77
17 0.20 4.35 1.1
18 0.15 3.35 0.6
19 0.10 2.35 0.27
20 0.05 1.35 0.09

The combination of disadvantage plus bonus attack has higher expected DPR until you need a roll of 9 to hit, then taking the standard attack dominates. This pattern will be consistent regardless of the number of attacks and would generally hold across damage levels, although the precise crossover point might change.

Computing Expected Damage

This problem is best broken down into a few parts that you've identified here. I'll define a couple of things for simplicity:

  • \$R\$ is the attack roll required on a d20 to hit
  • \$R^*\$ is the attack roll required on a d20 to score a critical hit. Note \$R\$ is always less than or equal to \$R^*\$ since criticals always hit
  • \$D\$ is expected damage from the main attack
  • \$D^*\$ is expected damage from the main attack on a critical hit
  • \$B\$ is the bonus attack expected damage
  • \$B^*\$ is the bonus attack expected damage on a critical hit
  • \$X\$ is the number of attacks per round (not counting the bonus attack)

Define some hit and critical probabilities

Knowing what rolls we need to hit, for simplicity, let's define the probability of succeeding on the following rolls:

  • \$p = (1-\frac{R-1}{20})\$ as the probability of hitting with an attack
  • \$p^* = (1-\frac{R^*-1}{20})\$ as the probability of a critical hit

The expected damage from making a main attack with disadvantage.

\$Disadvantage = p^2 D + {p^*}^2 (D^*-D)\$

The expected damage from making the bonus action attack

\$Bonus = p B + {p^*} (B^*-B)\$

The expected damage from making the main attack without disadvantage.

\$Attack = p * D + {p^*} (D^*-D)\$

Is taking the disadvantage for the possibility of a bonus attack worth it?

Before we compute total expected damage, you should decide whether taking the bonus attack maximizes total expected damage. So first you should check whether

\$Attack < Disadvantage + p \times Bonus\$

If it isn't then you should always forgo the option to take disadvantage. You might also be worried that this is some kind of optimal stopping problem, where you try \$x\$ disadvantage attacks before giving up. Bellman's Principle of Optimality tells us if the disadvantage option is optimal for one attack, it will be optimal on future attacks.

Computing overall expected DPR

Using these terms you can compute overall expected damage per round assuming you take the disadvantage option each attack until you hit and try the bonus attack, then the standard attack thereafter. This is actually a Negative Binomial process. It will require you to add up expected damage over several possible outcomes of your \$X\$ possible attacks.

The probability you will miss on your initial \$x\$ attacks with disadvantage is \$(1-p^2)^{x}\$. You then hit with probability \$p^2\$, do additional critical hit damage with probability \${p^*}^2\$, and hit with your bonus attack with probability \$p\$. You'll then get to make \$X-x-1\$ regular attacks, hitting with probability \$p\$, and critting with probability \$p^*\$. Omitting the case where you miss every time (which does zero damage), the sum over all these possibilities is

\$ E[DPR] = \sum_{x=0}^{X-1} \left[ (1-p^2)^x \left[ p^2 D + {p^*}^2 (D^*-D) + p^2(p B + p^* (B^*-B)) + p^2(X-x-1)(p D + {p^*} (D^*-D)) \right] \right] \$

You can add this up over the \$X+1\$ possibilities, or you can "simplify" the summation to \$E[DPR] = \left[p^2 D + {p^*}^2 (D^*-D) + p^2(p B + p^* (B^*-B))\right] \times \left[\frac{1-(1-p^2)^X}{p^2}\right] + \left[p D + {p^*} (D^*-D)\right] \times \frac{(1-p^2)^{X}+p^2 X - 1}{p^2} \$

I've implemented this is Python below, comparing a simulation to the formula.

import numpy as np

#Define parameters
R = 4     #R  (roll needed to hit)
Rs = 20    #R* (roll needed to crit)
D = 10     #D  (expected damage on a hit)
Ds = 17    #D* (expected damage on a crit)
B = 5      #B  (expected damage bonus attack)
Bs = 7     #B* (expected damage on bonus attack crit)
X = 3      #X  (number of attacks)

#Compute probabilities
p = 1-(R-1)/20     #p Probability of a hit
ps = 1-(Rs-1)/20   #p* probability of a crit


#Check if taking the disadvantage is optimal
if p * D + ps * (Ds - D) > p**2 * D + ps**2 * (Ds - D) + p**2*(p * B + ps * (Bs - B)) :
    print("Don't take disadvantage.")
    print("Expected Damage:", X*p * D + ps * (Ds - D))
else :
    #Simulate the outcome
    N_sims = 10000
    damage = np.empty((N_sims,))
    #Run simulations
    for i in range(0,N_sims) :
        #Simulate each attack
        take_disadvantage = True
        total_damage = 0
        for x in range(0,X) :
            #Are we taking disadvantage?
            if take_disadvantage :
                do_bonus = False
                #Make an attack roll with disadvantage
                attack_roll = min([np.random.randint(low=1,high=21),np.random.randint(low=1,high=21)])
                #Did we crit?
                if attack_roll >= Rs :
                    total_damage += Ds
                    do_bonus = True
                elif attack_roll >= R :
                    total_damage += D
                    do_bonus = True

                if do_bonus :
                    #Stop taking disadvantage after this go
                    take_disadvantage = False
                    attack_roll = np.random.randint(low=1,high=21)
                    if attack_roll >= Rs :
                        total_damage += Bs
                    elif attack_roll >= R :
                        total_damage += B
            else :
                attack_roll = np.random.randint(low=1,high=21)
                if attack_roll >= Rs :
                    total_damage += Ds
                elif attack_roll >= R :
                    total_damage += D
        
        damage[i] = total_damage
    print("Expected Damage (simulation):", np.mean(damage))
    #Compute expected damage using the formula

    Dmg = (p**2*D + ps**2*(Ds-D) + p**2*(p*B + ps*(Bs-B))) * (1-(1-p**2)**X)/(p**2) + \
          (p*D + ps*(Ds-D)) * ((1-p**2)**X + p**2*X - 1 )/(p**2)
    print("Expected Damage (formula):", Dmg)
```
\$\endgroup\$
6
  • \$\begingroup\$ Would be useful to also have a table of what the expected damage is and what the best strategy is based on how hard it is to hit, as a read out of what this comes to. \$\endgroup\$ Commented Nov 8, 2023 at 7:43
  • \$\begingroup\$ @NobodytheHobgoblin - Good thought. The formula is a bit complicated since there are a lot of moving parts to this problem. Once the stack supports 5-dimenional tables I'll put in a complete summary. Until then, I put in a table with an illustrative example. \$\endgroup\$
    – CompEcon
    Commented Nov 8, 2023 at 13:02
  • \$\begingroup\$ Thanks for your answer! It looks like the Python simulation script computes the same thing as the script linked in the question? (general note: with simulations like this, 10,000 samples is not nearly enough to get a value that is a good approximation of the expected value. Even with 500,000,000 samples, your margin of error is still > 0.0005). \$\endgroup\$
    – Jacco
    Commented Nov 8, 2023 at 14:56
  • 1
    \$\begingroup\$ In your example output table, could you replace your column 'Roll Needed To Hit' with a 'hit probability' table. This would facilitate easier comparison with the other answers. \$\endgroup\$
    – Jacco
    Commented Nov 8, 2023 at 14:58
  • \$\begingroup\$ Thanks for adding the table and +1. Looks like your overall conclusion matches the others, that at about 65% hit chance, this is starting to get better than just plain attacks, the more the higher your hit chances are above that level. \$\endgroup\$ Commented Nov 8, 2023 at 15:53

You must log in to answer this question.

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