Visualizing probabilities in player defense rolls

Many crunchy, combat-focused roleplaying games (including various editions of Dungeons & Dragons) run combat by having the attacker roll some dice to attack, add some sort of modifiers and compare the result to a defense number (usually calculated by some formula, but typically a fixed in value for the duration of a combat). This is part of the fun for players, rolling dice and seeing how you do. It can be a bit of a chore for the game moderator, though. If, for example, four protagonists (one for each player) are fighting, say, eight antagonists (all controlled by the GM), that’s a lot of rolling for the GM when the antagonists follow the same system as the protagonists.

To alleviate this you can find suggestions for a lot of these games for breaking this symmetry and putting the players in charge of seeing if the antagonists damage their characters. The idea is usually that, instead of the antagonists rolling an attack, the protagonists roll a defense. This involves a bit of shifting some numbers around in most cases but, ideally, when you invert the control like this, you want to make the probability of the protagonist getting hit remain the same. This is especially true if you have a complex combat system with a lot of interlocking parts, as small probability changes can accidentally mess the system up.

A typical example of a house rule to give the players defense rolls comes from the Players Roll All the Dice variation suggested in the d20 SRD. I say “typical” because this example contains two large flaws that seem to be present in every other variation that does this that I have seen.

The first problem is adding needless complication. Let’s look at the d20 suggestion to illustrate. In normal rules in this game, an attacker hits when:

1d20 + attack bonus ≥ target AC

The two main traits used in this formula turn out to be derived in a somewhat complicated way. The target AC, for example, is calculated like this:

target AC = 10 + various armor modifiers

…which complicates even further to something like this:

target AC = 10 + armor bonus + dex bonus + size bonus + natural bonus + etc.

This turns out not to be that big of a problem in play, however, because the AC is pre-calculated and written on the character sheet. (Some sheets might also list some or all of the bonus individually, too, but all of them will list AC.)

The variation in the SRD, however, undermines this, attempting to invert the math and ending up with a defense roll where the protagonist avoids getting hit if:

1d20 + various armor modifiers ≥ 11 + attack bonus

What happened to the nice, pre-calculated AC number, that every player already knows how to use? Fortunately, this is easy to fix, given the definition of AC above, by adding 10 to both sides of the equation:

1d20 + 10 + various armor modifiers ≥ 11 + 10 + attack bonus

1d20 + AC ≥ 21 + attack bonus

This may seem like picking nits, but this actually makes a huge difference at the table, because it allows players to use numbers they already know, without modification. (If you use software character sheets and such, it also means that you don’t have to customize the software to display some new number, but can just use what is already there.)

The second problem, however, is a lot worse: the formula suggested doesn’t preserve the probability of being hit. It’s off by five percent.

Now, while the probabilities involved are not that complicated, this is sort of hard to see. The point of this post is provide a visual way to illustrate what is happening. The key, as is often the case in probability, is to focus on the number of outcomes that result in a hit. That is, of the numbers on the die being rolled, how many cause a hit?

Let’s look at an example of what we are trying to model, the probability of the original rules. Lets say an antagonist with an attack bonus of +5 is attempting to hit a protagonist with an AC of 15. This would mean the attacker adds 5 and has to get a 15 or higher to hit. It would look something like this, with the outcomes shown in bold text with a red background indicating a hit:

d20 roll 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
attack result 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
outcome miss hit
9/20=45% 11/20=55%

Now, lets create a mirror to the table showing the suggested house rule. Remember that succeeding on this defense roll means that attack misses, so the defender adds 15 to a roll and needs to get 26 or more to defend (21+attack bonus 5). Let’s still color the results such that bold, red background numbers show cases where the protagonist is hit (meaning a roll of 25 or less). To line up the results, lets display the numbers running the opposite direction:

d20 roll 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
attack result 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
outcome miss hit
9/20=45% 11/20=55%
10/20=50% 10/20=50% outcome
miss hit
35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 defense result
20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 d20 roll

By laying out the numbers like this, it is immediately obvious that the defense formula has a problem. Granted, that problem is in favor of the players, so it could be worse. To match the probability of the original rules, however, you need an adjustment of +1 to the target, so:

1d20 + AC ≥ 22 + attack bonus

This kind of “off by one” mistake is easy to make in systems that use “equal to or greater than” resolution. When inverting an “equal to or greater than” rule, the result must be “greater than” or you have to adjust the numbers. For example, instead of adding +1 to the target, we could have adjusted the comparison operator:

1d20 + AC > 21 + attack bonus

In this particular game, this would be a bad idea, though, because all the rest of the mechanics use “equal to or greater than” style checks. Better to have one slightly odd constant than to have a divergent comparison.

Some additional scenarios comparing the original probability to the “players roll defense” variation can be found in this spreadsheet.

Analyzing a roll and keep system

A “roll and keep” system can be tweaked by simple rules to provide some interesting probability distributions. This post will explain what a “roll and keep” system is, take a look at how one such system can be manipulated and provide some source code to experiment.

Introduction

Since the late 1980’s, certain roleplaying games have made use of “dice pool success” mechanics. Such systems roll a handful of similar dice (usually d6 or d10), with the number of dice usually determined by the traits of the character for whom the roll is being made. That is, typically someone with more skill in something will roll more dice, also referred to as having a “larger pool”. Usually, each die rolled is compared individually to some sort of target, and if the die meets or exceeds that number, the die is considered a “success”. The quality of the roll is determined by how many successes are generated (i.e. how many dice meet or exceed the target).

One appeal of this type of mechanic is that it allows many variables to affect the roll, using a number of different mechanisms. A system might allow the situation to alter to number of dice, the target number, the number of successes needed to reach a goal and so on. As a result, many variations on this the basic idea can be found in different games.

One type of variation is known as a “roll and keep” system. The idea here is that you roll your pool, but only get to keep some subset of the dice. For example, you might roll seven dice but only be able to keep three, selected after the roll is made. Obviously, players will typically pick the best three results.

While not many games use roll and keep systems, the appeal of them is twofold. First, it adds yet another variable into how the roll can be manipulated (i.e. changes to how many dice you keep). Second, and more importantly, it allows a game designer to exert some control over the maximum number of successes generated by a roll. That is, some pool-based systems can get intro trouble with “runaway successes”, where various imbalances between characters can get magnified, with some characters scoring ungodly numbers of successes. Using a roll and keep system allows a designer to focus on a “sweet spot” for the number of generate successes. This post aims to investigate what various rules variations do to a roll and keep system.

One caveat: this analysis starts with a very “crunchy” (rules-heavy) system, and mutates it into an even more crunchy system in some ways. The point is really to see what happens within the roll and keep system, rather than try to convince you that the result is somehow “good”. The system does what it does; it’s up to you to decide if that is useful to you.

Start with an existing system

To keep things slightly more focused, the starting point for this investigation will be a popular pool-based system from a game called Exalted. As written, this game does not use a roll and keep system, but it has a number of features that might be usefully implemented by changing it to a roll and keep system. Some of what follows might make a bit more sense if you know a bit about the world of Exalted, but you don’t really need to know the game to follow along. Some important ideas of the system, as written:

  • It uses pools of d10s.
  • It uses a large number of “traits” rated (mostly) one through five. Some of these are called “Attributes”, some “Abilities”, but there are other kinds as well.
  • Pool size for any given test is based on one Attribute, one Ability and, optionally, one “specialty” (rated zero through three).
  • Dice that roll a seven or higher generate a “success”.
  • Dice that roll a ten count as two successes.
  • One important trait is called Essence and is a very rough measure of “power level” in the game. Mortals have an Essence of one. Very powerful gods have an Essence of ten.
  • Player characters in the game are superhuman, typically with an Essence of two to five.
  • Players have access to magic that allows them to (among other things) manipulate dice in various ways. For example, they might spend “points” of this magic (called motes) to buy extra dice for a roll, etc.
  • Player characters can be different kinds of superhuman, each kind having their own “style” of magic. These different kinds are explicitly not equal in the game, with some being “more powerful” than others.
  • Everything in the game that can use dice pools can gain a few additional dice for a roll just by giving a cool description of what they are doing. This is called “stunting”, and can provide from one to three dice.
  • Everything in the game that can use dice pools also has a set a traits called Virtues. If they are really desperate, anyone can “channel” a Virtue to gain dice for a roll. This is costly, and can only be done a limited number of times.

Mutating into the roll and keep

Changing this system to a roll and keep system requires answering two questions. First, what determines the basic limit on how many dice are kept? Second, how is this limit manipulated? The way the world of Exalted works suggests some choices here. After some experimentation, the key really comes back to the notion of the different “kinds” of character mentioned above and how these are intentionally not equal. Also important is that most rolling will be using magic, so what happens to the rolls when they are augmented matters more often than how rolls without magic work. While there are number of possibilities here, the following accentuates the differences of the kinds of characters. What seems to work is:

  • As with the standard system, characters roll Attribute + Ability + Specialty.
  • Characters keep a number of dice equal to their Essence + 1. Note that this limit is intentionally on the low side, compared to the size of the pool. This has several ramifications but generally means that adjustments to the keep limit are more formidable than adjustments to pool size.
  • Stunting works as in the standard system, adding dice to the roll.
  • Virtue channeling adds to the number of dice you keep. (Also, for those who really know Exalted, in this system it does not cost Willpower.)
  • The different kinds of characters each have their own basic mechanism for manipulating a roll. (In Exalted terms, the following replace excellencies.) The names for the different types don’t matter so much, but are arranged by “power level”, from strongest to weakest:
    • Solars (and their offshoots) can spend 2m to buy one success, with a maximum of Ability successes added to a given roll.
    • Lunars, prior to rolling, can spend 1m to convert a pool die into a single success instead of rolling it, with a maximum of Attribute die so altered for a given roll.
    • Sidereals can pay a flat 3m to add one to the number of dice they roll, but count two successes for rolling 8 or 9 as well as 10.
    • Alchemicals can pay a flat 1m to raise the number of dice they keep by two. This can only be done once per test.
    • Terrestrials can pay 1m to add two dice to their pool. They may add up to Ability + Specialty dice to a given test.
    • Spirits, Fair Folk, Ghosts and other essence users can pay 1m to add one die to their pool, adding a maximum of Ability dice to a given test

Example

For a particular test, a character uses an Attribute rated at 2, an Ability rated at 4 and a specialty rated at 1. This provides a dice pool of seven dice. The character has an essence of 3, which means, after the roll, she will keep four of those dice.

Her roll is an extremely good one: 2, 5, 8, 9, 9, 10, 10. She obviously elects to keep the best four dice, which are 9, 9, 10, 10. Each 9 gives one success. The 10s give two successes each. Her total is six success.

Later she needs to make a very similar test (based on the same traits). This time, though, she describes her action in a really neat way, and is awarded two stunt die. While this makes the pool larger, it doesn’t change how many dice she can keep. This roll happens to turn out worse: 1, 2, 4, 5, 5, 5, 6, 8, 10. She still keeps four (5, 6, 8, 10), gaining three successes (one for the 8, two for the 10).

Even later, she has to make the same kind of test again. This time she is in real trouble. She describes well again, gaining two stunt dice. She also channels one of her virtues (rated 3), which allows her to keep three additional dice. She rolls well again: 3, 5, 6, 7, 7, 7, 8, 9, 10. Thanks to the channel, she keeps seven dice (6, 7, 7, 7, 8, 9, 10) giving seven successes.

Running the numbers

The various choices were analyzed using software simulation, written in Python (source). The simulation makes a million rolls using 30 dice each. For each roll, the stream of dice is used by a bunch of different “strategies”. Each strategy represents a type of character, adjusting its traits and, importantly, kind. The strategies are set up such that they cover all relevant combinations. Each of these is fed the 30 dice results, but how many they actually use depends on the strategy. If a strategy is supposed to have a pool size of 12 dice, it only takes the first 12 dice for its pool and ignores the rest. By working in this way, all of the strategies use roughly the “same” results for their million rolls. This is not exact, of course, as some strategies use more dice than others, but it provides a more “fair” comparison of the strategies (and is much faster than rolling pools independently for each strategy a million times each).

What turns out to be interesting here are graphs where the traits are kept constant, but the various magical effects are used to the full extent allowed (that is, solars always buy Ability successes, etc.). You can see from these how the magic works at each sort of “skill level”. (It is also illustrative to show how the “canon” system works. That is, the system that doesn’t use a roll and keep mechanism, but rather always keeps all dice.)

Consider characters at Essence 3, but with minimal traits. At this level, the results are fairly homogeneous, and the magic doesn’t change much:

Essence 3, Att 1, Abl 1, Spec 0, Stunt 0, Virt 0

One thing to notice, though it doesn’t show on the graph very well, is that with their additional dice, terrestrials and spirits can occasionally get lucky enough to exceed the maximum achievable by a solar (about an 0.1% chance of getting six successes, while solars can only hit five), even though they do worse on average. This result will hold in any situation where the keep cap exceeds the standard pool size, which doesn’t happen that often. With traits this low, however, it still happens with virtue channeling/stunts:

Essence 3, Att 1, Abl 1, Spec 0, Stunt 2, Virt 3

One oddity you see emerge here is that the because of the way sidereal magic works, they are more likely to get even numbers of successes than odd.

When traits move to 3 dots each, you can see another emergent behavior: when the base pool and the cap become close, without magic the basic “roll and keep” behaves very similarly to canon, but magic causes the various types of exalts to have much different expectations of success:

Essence 3, Att 3, Abl 3, Spec 0, Stunt 0, Virt 0

Essence 3, Att 3, Abl 3, Spec 0, Stunt 2, Virt 3

Also note the “canon” line in the graphs above. Bear in mind this is just a standard roll in the original system, without any magical augmentation. Since each die can possibly generate two successes (by rolling a 10), Exalted has a bigger issue with “runaway successes” than most other pool based games do. The “roll and keep” tends to keep runaway successes under the original system more constrained, with magic use having a bigger impact than luck.

Things get more interesting when you ignore the virtue channeling and add only some additional dice, say from a stunt or specialty. Since these two cases are mostly the same (the only difference being that three dice from a specialty help terrestrials more than three dice from a stunt would), we’ll look at the specialty case:

Essence 3, Att 3, Abl 3, Spec 3, Stunt 0, Virt 0

Here, you can really see how the excellency differences play out:

  • Solars are simply “more excellent” than the others, but since they are limited in how many successes they can buy, not overwhelmingly so. This is a departure from the canon rules, were the gap between solars and others can be severe.
  • Lunars have the same minimum and maximum successes as solars, but average one fewer success. Still they outshine other types.
  • Sidereals leave much more up to luck, but still regularly hit celestial levels of success. Their minimum is much lower than solar and lunars (they can still actually get zero successes), and their max is slightly lower, but they have a much flatter curve, that favors the high end.
  • Terrestrials, unlike celestials, can’t gain more with magic than without, but are much more likely to hit the high end of their range.
  • Alchemicals most closely match the canonical curve. They can do better than even solars, but not very often.
  • Spirits are similar to, but outmatched by, terrestrials.

As the traits climb to five, all of these trends become more accentuated, and the higher powered exalts make better use of their increased skill:

Essence 3, Att 5, Abl 5, Spec 3, Stunt 0, Virt 0

When you add stunts and channeling to mix, however, the odds tend to even out a bit, particularly for those in the mid power range:

Essence 3, Att 5, Abl 5, Spec 3, Stunt 2, Virt 3

Higher Essence

As Essence increase to five (the realistic upper limit for PCs in most games), the keep limit becomes less relevant, particularly at average skill levels, because you are keeping nearly all of the dice you roll. You start to see a more canonical behavior of the magic:

Essence 5, Att 3, Abl 3, Spec 0, Stunt 0, Virt 0

Once traits are maximized, however, the disparity between pool size and limit cap returns, and the difference between the types of characters become more pronounced:

Essence 5, Att 5, Abl 5, Spec 3, Stunt 0, Virt 0

The low end

One thing that turns out to matter a lot in this analysis (and the reason Exalted is being used as a base) is the notion that rolling a 10 generates two successes. This mixes in interesting ways with the keep limit. Obviously, 10s are much more worth keeping but, more importantly, they allow the success count to exceed the keep limit. That is, even if you can only keep two dice, it’s possible to get four successes. Further, the more dice you roll, the more likely that outcome is.

For example, if you roll only two dice and keep both, the chance of getting four successes is only 1% (with a 34% chance of failure). If, however, you roll 12 dice and keep two, the chances of four successes is closer to 35% (with the chance of failure dropping to around 0.2%). So, the limit and the 10s rule combine to reign in the number of total possible successes, but yet still let skill matter.

This is easier to see when looking at the results for the low end of the power scale: Essence 1 characters. Since mortals can’t use magic (and everyone that can use magic has Essence 2 or more), graphs at this level are more simple. At this level, it is a bit more useful to look at how the roll and keep results change the dynamics of the game compared to the canonical system.

One twist here is that Exalted divides mortals into two groups: standard mortals and heroic mortals. The difference is that, for standard mortals, rolling a 10 only generates one success. This changes things a lot for them. (If you suspect that mortals are a bit screwed in the world of Exalted, you’d be totally right.)

Let’s look at a minimal mortal, with all traits at one. Since the keep limit equals the number of dice, this works just like canon, so is not particularly interesting, but consider when this character stunts:

Essence 1, Att 1, Abl 1, Spec 0, Stunt 2, Virt 0

Heroic mortals cannot do better than four successes here, even with the stunt, because stunting doesn’t change the cap. The standard mortal can only get two successes in this situation. Compared to not stunting, the difference for the standard mortal is a drastic increases the likelihood of getting two successes (from around 16% to 53%), and decrease the chance of failure (from 36% to 13%).

You can also see how, compared to canon, the 2+ success results are “compressed” into a lower range.

But what if, instead of stunting, they channel a virtue (rating 3)? Looks like this:

Essence 1, Att 1, Abl 1, Spec 0, Stunt 0, Virt 3

Under r&k, the mortals still can’t crack four and two successes, respectively. In this case, the culprit is the size of their dice pool. Their keep limit is over twice the size of how many dice they actually can roll. The canon case has much different behavior here, as it is rolling five dice instead of just two.

Channeling a virtue in this situation is much worse for the mortal than a stunt. This turns out to be more of a fringe case, but it has an interesting effect: mortals simply cannot do “legendary” things, unless they both stunt and channel. Or, put another way, it is possible for even the weakest mortals to do awesome things if they stunt like hell and pour their heart into it:

Essence 1, Att 1, Abl 1, Spec 0, Stunt 2, Virt 3

You can really see the divergence from canon here. Compare standard mortals in canon to heroes in r&k, for example. In this case, canon mortals gain 7 successes 3 times out of every two thousand rolls. Heroes in r&k don’t do this as often, though they can get 8 successes while standard canon mortals can’t (meanwhile, canonical heroes can get as many as 14). Note that standard r&k mortals still cannot achieve “legendary” successes, though they could with a higher virtue.

As mortal traits increase, the result of raising their attributes doesn’t affect their success caps, but moves their results more reliably to the higher end of that cap:

Essence 1, Att 3, Abl 3, Spec 0, Stunt 0, Virt 0

Essence 1, Att 3, Abl 3, Spec 0, Stunt 2, Virt 3

Essence 1, Att 5, Abl 5, Spec 0, Stunt 0, Virt 0

Essence 1, Att 5, Abl 5, Spec 0, Stunt 2, Virt 3

So, on the low end, this system seems to at least function, and does a fairly good job of “keeping the man down”. Can’t have mortals get too uppity. With enough stunting and heart, they can still do “legendary” things.

Conclusions

While initially intended to be a somewhat generic look at how you might manipulate a roll and keep system, the results actually turn out to depend heavily on the specifics of the original system used, particularly the rule that awards two successes on a 10.

On the other hand, if you consider the specific flavor of the game in question, you actually can use roll and keep to make the game work a bit more like it is described. That is, with some minor mechanical changes, the success rate of the various kinds of exalted can be tinkered with until they match the relative power levels implied by the game’s descriptions, all in a way that minimizes the huge success disparity of the original system.

3d6 probability graphic

On the newly formed Praxis forum, user Keven Allen Jr asked:

I want a chart of every possible three die outcome of rolling 3d6 (order doesn’t matter)…. My mind doesn’t really love looking at numbers and percentages, but is very good at processing visual information….

As the notion of presenting probability information for role-playing games in a visual way dovetails with a possible future DivNull project, we dusted off the (rusty) graphic design tools and went to work (click for a larger version):

3d6 distribution

Direct download links: