23/10/2020

Opposed Checks

I've just recently realised that opposed checks, also known as contests in 5e, are weird in terms of probability. Two characters roll an ability check against each other, and the highest roll wins. In normal ability checks you roll equal or higher a DC, but here you roll higher, equal or lower. Higher you win, equal its a draw, and lower you lose. 

Sometimes there is no way of narrating a draw. If a PC is trying to keep a door closed as a monster is trying to open it. What would a draw be? The door gets neither open or closed? Let's then rule that the active person (the attacker) always has the prerogative of winning a draw in the contest, as it is for an attack action, or normal ability check. The monster trying to open the door succeeds if it rolls equal or higher the PC.

In opposite rolls, the dice have much more weight than the ability modifiers. If a player with strength modifier -3 rolls 20 to hold the door, the contesting monster has low chance of beating it, even if it has strength modifier +4. The super strong monster has 12-in-20 chance (60%) of being barred by the apparently helpless PC. 

\[ \text{[attack d20]} + \text{[attack mod]}   \geq \text{[defence d20]} + \text{[defence mod]} \]
\[ \text{[attack d20]} - \text{[defence d20]} \geq  \text{[attack mod]} - \text{[defence mod]}  \]

Difference of dice rolls in opposed checks.

We can count how many times a higher difference between 2 d20 occurs higher or equal the modifier differ in the matrix above. The colour scale may help us to differentiate the values. Then we can use this count to obtain the probability \(\frac{count}{20\times 20}\), and compare it with the probability of a simple ability check, where \(DC = 10 + \text{[defence modifier]} \), like an attack roll.

\[ \text{[attack d20]} + \text{[attack mod]} \geq 10 + \text{[defence mod]} \]

Comparing the probabilities of contests and ability checks.


The probability ability check is a linear curve, whereas the probability of the opposed check is a sigmoid. In both cases, the attacker (opening the door) has advantage over the defender (holding the door), when they are equally strong, i.e., [attack mod] - [defence mod] = 0. However, this advantage is of 5% for ability check against 2.5% for opposed check. The sigmoid is also quite linear around [attack mod] - [defence mod] = 0. Up to [attack mod] - [defence mod] ± 3, both curves are almost parallel. Yet, further away, the curve of the opposed check softens, decreasing the weight of the modifiers in the contest roll. Instead of being almost impossible to hold the door against a storm giant, it is just a little bit more difficult than holding it against an ogre.

Conclusion

Ability check, like an attack roll, represents better a contest situation than opposed check. It is also the standard classical roll of D&D combat.

17/09/2020

Alternative Advantage and Disadvantage Rule

Dungeon Crawl Classic (DCC) has uses the dice chain to roll advantage and disadvantage ability checks. Advantage and disadvantage rolls use a higher (+1d) and lower die (-1d) in the dice chain chain, respectively. Ability checks with advantage may use a d24, and ability checks with disadvantage may use a d16. Advantageous and disadvantageous situations may also stack going twice or multiple times up and down in the dice chain (e.g., d20 +2d = d30). This is interesting comparing with the D&D 5e method, of rolling 2d20 and using either the highest or the lowest value. As compared before, the DCC method allow higher values to be rolled in advantage, or the maximum possible roll to be capped down in disadvantage. However, the DCC method requires the use of the Zochi dice (a.k.a. funky dice). 

I've heard of a couple of DMs using an alternative system using the normal, more available D&D dice. In this system, the d20 is summed or subtracted with another die from the standard D&D dice chain: [d4, d6, d8, d10, d12, d20]. It works exactly like the bardic aid from D&D 5e, 

\[ d20 \pm [d4, d6, ..., d20] + \textit{mod} \quad \textbf{vs} \quad \textit{DC} \]

Let's now look to the probabilities of this kind of dice roll to see if we like it.

Probabilities

I will use same kind of matrix representation to show the dice result as before. Because it is easy to scrip this in Python, I will show all matrices in a row.

\[d20 \pm d4\].
\[d20 \pm d6\].
\[d20 \pm d8\]

\[d20 \pm d10\]
\[d20 \pm d12\]

\[d20 \pm d20\]

Most values repeat on diagonals, but the values near the top and the bottom don't. In general terms, the probability distribution function is the same uniform 5% in the middle, and a wedge is cut from one side to be added to the other. The size of this wedge is the size of the advantage/disadvantage die. When both die are of the same type (d20 + d20) the roll probability distribution is a triangle.

Advantage

This is very clear in the advantage case. The average value rolled increases by the average of the advantage die (i.e., 2.5 for d4, and 3.5 for d6). In the case of probability of success (taking all values equal or higher the DC), this results in an increase of almost 5% per extra modifier. We can see below that d20 + d4 increases the success probability in about \( 2.5 \times 5\%  = 12.5\% \) as compared to rolling d20 alone. It also has significant chances of rolling 20, 21, 22 and 23, and no chance of rolling 1.

Alternative advantage rule summing an extra die. The reference is the d20.

Disadvantage

Same thing, but the wedge is not taken from the right side (high values) and passed to the left side (low values). 

Alternative disadvantage rule subtracting an extra die. The reference is the d20.

We may not care about negative DCs...

Alternative disadvantage rule subtracting an extra die. The reference is the d20. In fact, there is no negative DC in D&D...

Critical Success and Fumbles

Do we keep the 5% chance of critical success or fail? It doesn't make much sense, since those change with both the DCC and 5e rules. It is a bit more complicated to define a fair critical rule with this adv-dis rule. What is fair?

  • In advantage, a fumble is a 1d20 + d = 2? That is about 1% chance.
  • In advantage, a critical success is \( 1d20 + d \geq 20 \)? That is about 15% chance for d4, and 20% for d6 etc. In D&D5 it is about 10%.
  • In disadvantage, a fumble is \( 1d20 - d \leq 1 \)? About 15%, 20% etc...
  • In disadvantage, a critical success is \( 1d20 - d = 20 \)? About 1%...

Conclusions

  • In terms of probability, this system is not too off from older versions of D&D (<5e), where +/- 1, 2, ..., 5 were given.
  • The advantage-disadvantage system of D&D 5e changes the probability of DC 11 by +/-5 -- more than any other DC. For DC 1 and 20, the change is less than +/-1.
  • The DCC system is always uniform.
  • This system require less weird dice. * yey!
  • This alternative system shown here is mostly uniform, but it works almost like D&D <5e. * yey!
  • Rolling the extra die may be more fun than adding a +2. * yey!
  • A fair critical success and failure rule can be used but it is a bit complicated to roll. Too much thinking. ! boo!
    • This is the main drawback of the system.

31/08/2020

Advantage and Disadvantage Probability Calculations in D&D 5e

Previously, I have shown the curve of success probability of ability checks in D&D 5e. The idea there was to use the complementary event of rolling failing twice for advantage in order to show the success of at least one of the rolled d20

\[ P_\text{adv}(x \geq  DC) = 1 - P_\text{1d20}(x < DC)^2 = 1 - [1 - P_\text{1d20}(x \geq  DC)]^2  \] On the other hand, a success in a disadvantage roll occurs when both d20 succeed the ability check

\[ P_\text{dis}(x \geq  DC) = P_\text{1d20}(x\geq  DC)^2 \]


Though these probability functions are correct, there is a more graphical way of representing them, which I am showing next. We can build matrices showing which values prevail according to the result of 2d20. 

Matrix of probabilities showing the best result of 2d20. Same results are marked with the same colours.
Matrix of probabilities showing the worst result of 2d20. Same results are marked with the same colours.

In the matrices of showing the result of the best and worst of 2d20, we can count how many times each result appears in the \( 20 \times 20 = 20^2 = 400 \) possible combinations. For instance, the chance of the best in 2d20 being a 2 is \( P(\text{best of 2d20} = 2) = \frac{3}{20^2} \). We can also see a pattern in the matrices above. Both the best and the worst result in 2d20 form a half frame of a square, which we can use to deduce the probability formulas

\[ P_\text{best of 2d20}(x) = \frac{x^2 - (x - 1)^2}{20^2} \]

and

\[ P_\text{worst of 2d20}(x) = \frac{(21 - x)^2 - (20 - x)^2}{20^2} \]


Let's now plot and compare those equations above. The probability of rolling each value is shown below. Interestingly, the \(P_\text{best of 2d20}\) and \(P_\text{worst of 2d20}\) are increasing and decreasing linear curves, respectively. They both intercept at the middle of the uniform probability distribution function rolling the single 1d20. 

Nevertheless, the ability check is the roll of rolling the difficulty class (DC) or over. We can sum all those values to get the probability of success.

\[ P_\text{adv}(DC) = \sum_{x=DC}^{20} P_\text{best of 2d20}(x) = \frac{20^2 - (DC - 1)^2}{20^2}\] 

and

\[ P_\text{dis}(DC) = \sum_{x=DC}^{20} P_\text{worst of 2d20}(x) = \frac{(21 - DC)^2}{20^2}\] 

which are both second-order functions, as illustrated in the graphs below. 

Probability of rolling specific value (upper), and probability of rolling specific value or over it (under).

Yey, we have now analytical formulas for the advantage and disadvantage rolls in D&D 5e! 😃

House Rule: Higher Advantage & Disadvantage Rolls

We can also generalise this process for seeing what happens to the probability roll, if the DM applies a house rule where advantage and disadvantage conditions can stack up allowing a bigger pool do d20. These super advantage or disadvantage rolls could let the player roll 3 or more d20s, and use the best or worst results, accordingly. Hence,

\[ P_\text{best of Nd20}(x) = \frac{x^N - (x - 1)^N}{20^N} \]

and

\[ P_\text{worst of Nd20}(x) = \frac{(21 - x)^N - (20 - x)^N}{20^N} \]

Thus, the probability of success becomes

\[ P_\text{N adv}(DC) = \sum_{x=DC}^{20} P_\text{best of Nd20}(x) = \frac{20^N - (DC - 1)^N}{20^N}\] 

and

\[ P_\text{N dis}(DC) = \sum_{x=DC}^{20} P_\text{worst of Nd20}(x) = \frac{(21 - DC)^N}{20^N}\] 

which are both plotted below.
Probability of rolling specific value (upper), and probability of rolling specific value or over it (under), in the case of ability checks with super advantage.

We see a pattern, where the change of rolling low values become almost impossible for the super advantage, and very likely for super disadvantage.

19/06/2020

Understanding Roll Probability in D&D

In D&D games, players often roll 1d20 + modifiers vs a difficulty check (DC) given by the DM. When not specified, the DM chooses a challenge level guided by the table below.

 DC Challenge LevelSuccess Probability of Unmodified Roll 
5 Easy80 %
10 Normal 55 %
15 Hard 30 %
20 Very Hard  5 %
25 A Hero's Work 0 %
30 Nearly Impossible  0 %


Rolling a single die produces an uniform probability distribution function, where each face has the same probability to show up. Since it is a d20 being rolled, each side has 1/20 = 0.05 = 5 % chance of showing up. Since we are interested in the probability of all success values, we sum the probability of each value on the side of success. In mathematical terms, this is the cumulative distribution of the die probability integrated from right to left, instead of the traditional left to right, because we are integrating the higher or equal than the DC, instead of lower than the DC. Graphically, this inversely integrated cumulative distribution function is seen below.

Probability of success when rolling a plain 1d20 vs a DC.
Figure 1: Probability of success when rolling a plain 1d20 vs a DC.


Adding Modifiers

When modified, the probability of success goes up 5% by each modifier (i.e., +5% for +1, and -5% for -1).


Probability of success when rolling 1d20 + mod vs a DC.
Figure 2: Probability of success when rolling 1d20 + mod vs a DC.


Advantage and Disadvantage in 5e

D&D 5e introduced the advantage and disadvantage mechanics, where 2d20 are rolled and the highest or the lowest value are used, respectively. This is a neat way of expressing advantage and disadvantage, because it increases the chances of success or failure, and the DM doesn't have to decide how much is the advantage and disadvantage in terms of +/- modifier. Besides, more dice, more fun! However, the probability of success is not linear anymore.

In case of the advantage roll, success is obtained when you don't fail in any of the two dice: 
\[ P_\text{adv} = 1 - P(d20 < DC)^2 = 1 - [1 - P(d20 \geq  DC)]^2  \]
In case of the disadvantage roll, success is obtained when you succeed in both rolls:
\[ P_\text{dis} = P(d20 \geq  DC)^2 \]

Interestingly, this coincides with modifying the roll by +/-5 for DC = 11. However, for all other cases, it is worse than giving a bonus of +5 for advantage, and it is better than giving a penalty of -5. Advantage highly increases the chance of success of DC < 11, but doesn't increase the chance of success of DC > 11 as much. Disadvantage does the opposite, it increases the chances of failure of higher DCs a lot, but decreases less the chance of failure of lower DCs. Moreover, 5e's advantage and disadvantage rule keeps the roll result bound to the 1-to-20 range, whereas modifying the roll shifts the roll result to values outside that range.

Probability of success when rolling with the 5e's advantage and disadvantage rule.
Figure 3: Probability of success when rolling with the 5e's advantage and disadvantage rule. The greyed zone is only highlighting probability difference from normal rolls to rolls with advantage or disadvantage.

Advantage and Disadvantage in DCC

Dungeon Crawl Classics (DCC) is D&D system forked from D&D 3.5e. DCC uses non-conventional dice called Zocchi dice, or funky dice, alongside with the traditional D&D dice. 

Zochi dice
Figure 4: Zochi dice: d3, d5, d7, d14, d16, d24 and d30.

DCC uses the dice chain

d3 > d4 > d5 > d6 > d7 > d8 > d10 > d12 > d14 > d16 > d20 > d24 > d30 > d100

to express advantage and disadvantage. Normal checks are rolled with the 1d20, whilst advantage and disadvantage climb or descend the dice chain by a number of steps depending of how advantageous or disadvantageous the roll is. For instance, a normal advantage is designed as a step up in the dice chain (1d16 vs DC), and a normal disadvantage is designed as a step down in the dice chain (1d24 vs DC). Advantageous and disadvantageous modifiers can be summed together, moving on the dice chain up (+1d) and down (-1d). For instance, a roll with two advantages (+2d) and one disadvantage (-1d) would be rolled with a 1d30 instead of the traditional 1d20.

Probability of success when rolling with the DCC's advantage and disadvantage rule.
Figure 5: Probability of success when rolling with the DCC's advantage and disadvantage rule.



With DCC's dice chain rule for checks, the probability of success barely changes for low DCs, but it changes widely for higher DCs, as the maximum value of the die check changes above and below 20. It means that a character in advantage has the chance of succeeding for DCs that were normally impossible, whereas it makes it impossible to succeed vs some high DCs. Strategically, this makes advantage and disadvantage much more important in game. The players gain a lot, if they are creative for gaining advantage in combat and skill checks. If they are smart, they will try to figure out strategies to convince the DM to give them more advantage.

In combat, going up the dice chain decreases the chance of rolling critical failure, and increases the chance of getting critical success. Values of critical success are the top numbers of each die 20, 24, 30 and 100. Lower dice don't grant critical successes.

Unfortunately, the Zochi dice don't move with constant steps in the dice chain. There are steps of d(+1), d(+2), d(+4), and d(+6). The steps are also not very symmetric around the d20. Nevertheless, if you roll digital dice on the computer, you can always make your own dice chain. However, I always find rolling physical dice more fun.

Advantage and Disadvantage Rule Alternative

I've been thinking another way of doing advantage and disadvantage without the. Instead of moving on the dice chain, the roll is made by

1d20 +/- (1d4 or 1d8 or 1d12)

I am not showing the graph here, but the range becomes 2-to-24 (1d20 + 1d4) for a simple advantage, and -3-to-19 (1d20 - 1d4) for a simple disadvantage. The success probability chance is linear in the middle with +/-2.5, and decreasing at the ends. For example, in 1d20 + 1d4, there is 1-in-80 chance of rolling 2, but there is 1-in-20 of rolling a 7 or 15. This system produces a probability of success like the modifier graph (Fig. 2), but with rounded ends. It would be more symmetrical than the 5e's system.

Summary

Summary of the probability of success to DC
Figure 6: Summary of the probability of success to DC.