Sunday, 21 May 2017

Next article

I am currently working on a piece explaining the distributions of subtracting 2 dice, and why D6 - D6 is equivalent to 2D6 - 7. In other words, a gentle introduction to adding and subtracting dice distributions, and some tips and tricks on how to handle them.

Any suggestions welcome.

Sunday, 14 May 2017

Range bands or random ranges?

Many wargaming rulesets contain a so-called "to-hit table", listing various modifiers one has to apply to a die roll when you want to shoot at a target.

Such modifiers often lists things such as "shooter has moved" or "target in hard cover". Usually, there is also some modifier for taking into account the range to the target. Very often, a distinction is made between shooting at half range or full range, with the full range defined by weapon type.

But sometimes, rules go further than the half range / full range distinction, and introduce additional range bands. Shown below is such a table I encountered in a ruleset published in a commercial magazine not too long ago:


As you can see, 5 different range bands for each type of weapon are listed. What makes this table objectionable to me, is that the range bands are not multiples of a basic range - as would be the case when you use half range / full range (or 1/3 range, 2/3 range, full range). The bands are uniquely defined for each weapon type. This triggers the question whether such a mechanic is playable. After all, very few players will memorize this table, and thus, one needs to check this table for every single firing action. This specific ruleset then applies a modifier based on the range band, the equivalent of a +1/+2/+3/+4 on the die roll.

It might make sense to have such a detailed mechanic, but it strongly depends on the type of game. A skirmish game with only a handful of figures per player mandates more detail per action for each figure. Roleplaying games takes this to the extreme, where each player typically controls a single figure, and hence a lot of detail is provided for each individual action.

But whenever I encounter such range tables in miniature wargaming rules, I wonder: "Is this really necessary?" If you want to have a fine granular range modifier for a firing action, perhaps there are better ways to achieve that goal rather than providing a detailed table that results in an unplayable game. Such tables seem to add a complex mechanic just for the sake of adding a complex mechanic ...Whether such complex tables do have any resemblance to historical data - a possible rationale for justifying them - is also very questionable.

Continuous range modifiers

Let's look at the overall idea: the further away a target is, the harder it should be to hit the target, and we want to use something more fine-grained than simply half range / full range, but not resort to a complex table such as the one shown above.

A couple of years ago, I started a skirmish science fiction campaign (see posts labeled Antares on my other wargaming blog), and was looking for a mechanic to resolve firing. Whenever I write my own rules, I try to focus them around one or two mechanics that form the core of the system. For these rules, we use a hexgrid (we use Kallistra hexes), which makes it very easy to count any distance in hexes. When a figure wishes to shoot his personal fire-arm, he has to match or exceed the distance in hexes on a die roll. E.g. if the target is 5 hexes away, you need a 5+. If the target is only 3 hexes away, a 3+ is needed. The type of die is determined by weapon type. Some weapons use a D6, others a D8 or a D10 or even a D4.

The result is that we have a distance modifier at the granularity of the hex-grid, and the probability of hitting something goes down linearly in function of distance. Each additional hex implies the equivalent of -1 on your shooting roll. Players now have an incentive to get as close as possible to the target as is tactically sound to maximize their chance of hitting something. Since a distance of  1 hex implies a 100% hit probability, we usually designate a roll of a "natural 1" as a miss, a weapon malfunction.

This is not an original mechanic. I have seen it used in different variations in various rulesets that use a gridded playing surface, but it is a nice way to do away with all sorts of range-dependent charts. The only thing you have to remember is what die to roll. There might still be some modifiers. E.g. a target in cover counts as being at "1 or 2 additional hexes". The equivalent of this is a -1 or -2 die modifier. And instead of using only a single die (thereby implying a linear decrease in hitting probability), you could also use something like a 2D6 or 2D4, resulting in a very high probability of hitting something close-by, and a very low probability of hitting something that is far away.

The obvious drawback is that your die rolling procedure is tied to the distance in hexes and is tied to the granularity of the hexgrid. But then, that is also the case if you express distances in inches or centimeters. And often, range bands are expressed in multiples of 3 or 4 inches anyway.

Random hit vs Random distance

Let's look at our die roll >= distance mechanic from a different viewpoint:
Suppose I roll a D8 to fire. The maximum range at which I could hit something is therefore 8 hexes, and the probability of hitting a target at a specific distance varies with that distance.

But, I could also look at this differently. Let's say we will always hit the target, but we are not sure yet what the maximum range for our weapon is this turn, and this maximum range is determined by rolling a D8. So, we do not think as the die roll trying to beat the probability to hit within the maximum range of 8 hexes, but as the die roll giving the variable maximal range within which we will certainly hit the target.

Let's clarify with an example. Suppose a target is at 6 hexes. The first interpretation says I need a 6+ to hit that specific target. The 2nd interpretation says I need to roll the die first to determine distance (might be a 6 or more), and I will certainly hit within that given distance.

The difference is subtle, and one might say it doesn't matter. And that's correct. Mathematically, it doesn't matter for this specific mechanic. But it does allow us to make  the mental jump to a different firing mechanism, in which we do not think about our  firing mechanic by setting a probability to hit something, but rather to set the distance within which we will hit something with 100% accuracy.

How to make random distances work?

Let's therefore propose a new firing procedure. When you shoot, you will hit with a 100% accuracy, but we will randomize the maximum firing distance for the shot. So, we have traded variability of hitting something within a fixed distance for the certainty of hitting something within a variable distance.

How can we make this work as a procedure within a wargame? Let's list some possibilities:
  1. The obvious solution could be to roll dice for distance, just as we explained above. Rolling a single D8 or D10 gives you a uniform distribution of distances, but as hinted at before, you could easily modify this by altering the combination of dice to roll. Rolling 2D6 results in average distance of 7 hexes, 7 inches, 7 whatevers, ... with the probability being very low for reaching out a full 12 hexes. Of course, these numbers have to make sense within the framework of other distance-dependent rules, but this is equally valid for a more traditional firing procedure. Other alternatives could be to add fixed offsets, such as rolling D6+5 etc.
  2. Since we need a randomizer to specify a distance, any type of randomzier can do. A pack of cards, giving results between 1 and 13, can serve as well. The suit of the card could signify secondary effects, such as friendly fire, a misfire, an exceptional lucky shot, etc. Alternatively, custom cards with desired distributions of ranges can be used. Or replace the cards with chits, to be drawn from an opaque cup ...
  3. More tactile gaming mechanism can be considered as well. One idea I have never tried myself (but sounds wildly attractive) could be to use a set of skewers and paint them in different range bands, each at slightly different lengths on each skewer. By randomly drawing skewers, one has an immediate randomized measuring stick indicating the true extent of the range for a specific shot.
  4. Guessing distances might be another mechanic. I know many wargamers are hostile towards such an idea, but it has a strong pedigree in wargaming (e.g. the famous Fletcher Pratt naval wargaming rules during the 1940s). Guess the distance, and if you're within a certain threshold, it's a hit, otherwise there could be some lessened effect if within a secondary threshold etc.
Conclusion

What I wanted to show with this post is that overly complex range bands are probably not a good idea to use as a procedure in miniature wargaming. Rather, use a different mechanic if you want to use a fine distance granularity for your firing. And secondly, when putting your mechanic in a different perspective, you could end up with doing something totally different, like drawing skewers.

But, as I have emphasized before - a mechanic is not a goal in itself. It is always embedded in a larger set of rules, and any given mechanic has to make sense within that larger framework. But it doesn't hurt to think about some alternatives now and then ...

Tuesday, 4 April 2017

Scoring at least one success ...

The "Buckets of Dice" blogpost dealt with analyzing the outcomes of the “buckets of dice” procedure, and explained the binomial distribution for computing the probabilities of scoring a specific number of successes.

This blogpost will focus on scoring at least 1 success. It is a question that pops up often on game design boards, and is actually quite easy to compute once you know the base probability for a single success on a single die.

We will explain 2 methods for computing these probabilities, both mathematically equivalent. The first will use some basic rules from probability theory, the second will use the binomial distribution we explained before. We will explain everything in the context of rolling a number of D6. We could also provide a more general explanation of probability theory, but since this is a game design blog, we will use gaming terminology that is familiar to everyone. Hence, we will limit all examples to rolling D6’s, but it should be fairly straightforward to extrapolate to other types of dice or randomizers.

But first, let's introduce some notations, which we will use as shorthands:
  • prob(D6 = 4): the probability of rolling a 4 on a single die. As everyone probably knows, the probability of rolling exactly a pre-determined on a D6 equals 1/6
  • prob(D6 = 4+): the probability a single die will produce a result of 4 or more. Similarly, we will write prob(D6 = 2+) or prob(D6 = 3-) and so on …
  • We will also discuss rolling two dice together. To avoid confusion by numbering dice, we will identify dice by colour. So, when we roll 2 dice, one die is red, the other is blue. prob(red D6 = 6, blue D6 = 4+) is then the probability of rolling a 6 on the red die, and a 4+ on the blue die. We might even write prob(red D6 = 6, blue D6 = 4, green D6 = 3-) etc.
  • Probabilities can be expressed as numbers ranging from 0 to 1, or as a percentage.

 

Basic rules for working with probabilities


To compute the probability for “scoring at least 1 success”, one needs to know two basic rules about how to manipulate probabilities.

Rule 1: The probability of a die coming up with a range of results, equals the sum of the probabilities of the individual results.

E.g. if you want to compute prob(D6 = 4+), you simply add prob(D6 = 4) + prob(D6 = 5) + prob(D6 = 6) = 1/6 + 1/6 + 1/6 = ½ = 50%.

This rule provides us with something that is very useful: The sum of the individual probabilities of an event happening and an event not happening must be equal to 1. Or, to give a few examples in the context of a single D6:
  • prob(D6 = 4+) + prob(D6 = 3-) = 1
  • prob(D6 = 6) + prob (D6 = 5-) = 1
This makes it easy to compute probabilities by expressing them as the negative result on a die roll. E.g. if you know the probability for rolling a 4 is 1/6, then the probability for NOT rolling a 4 equals 1-1/6 = 5/6. This might seem rather trivial, but you can also use this reasoning for computing the probability for more complex outcomes, as we shall see later. There is one pitfall though, and that is that you have to be sure that the event happening and the event NOT happening cover all possible outcomes, and do not overlap with each other. Luckily, this is the case when rolling dice. Either the die produces a 4, or it does not produce a 4. There is no third option, and there is also not the possibility that the die produces both a 4 and “not a 4”.

Rule 2: The combined probability of a red die rolling some result, AND a blue die rolling  some other result, equals the product of both individual probabilities.

A few examples:
  • prob(red D6 = 6, blue D6 = 4+) = 1/6*1/2 = 1/12 = 8.33%.
  • prob (red D6 =3, blue D6 = 4) = 1/6*1/6 = 1/36 = 2.78%.
Or even:
  • prob(red D6 = 6, blue D6 = 2+, green D6 = 5+) = 1/6*5/6*1/3 = 5/108 = 4.63%
Now, there is one caveat: the results on the dice should be rolled independently from each other. But not to worry, this is the case when rolling multiple dice together, and the roll of the red die does not influence the result of the blue die and vice versa. Actually, whether you roll the dice simultaneously, or one after the other, doesn’t matter. Each die rolls its own result independently, without being aware of the outcome of the other dice.

A common mistake when using this rules is that the total number of outcomes is misjudged when trying to compute probabilities in this manner. E.g. suppose I want to know the probability of rolling a 3 and a 4 on two dice – but it does not matter what die rolls a 3 and what die rolls a 4. One might think this equals prob(red D6 = 3, blue D6= 4), but this merely expresses the probability of rolling a 3 on the red die, and 4 on the blue die. It excludes the possibility of rolling a 4 on the red die, and a 3 on the blue die, which would also be a valid outcome. Hence, the chances for rolling a 3 and a 4 on two dice (in any order), equals prob(red D6 = 3, blue D6 = 4) + prob(red D6 = 4, blue D6 = 3) = 1/6*1/6 + 1/6*1/6 = 5.56%.

Scoring at least 1 success, method 1


Let’s now take a look at the question of scoring at least 1 success on a number of dice. For the sake of clarity, let’s assume a success is rolling a 6, and let us assume we roll 4 dice. First, we use rule 1 as follows: the probability of rolling no 6’s, plus the probability of scoring at least one 6, equals 1. We can write this down as: prob(no 6’s) + prob (at least one 6) = 1. Either we score no 6’s at all, or we score at least 1. There is no other option. Hence, we can say that:

prob(at least one 6) = 1 – prob (no 6’s).

The only thing left to do is to compute the probability of scoring no 6’s, on 4 dice. The probability of rolling no 6 on a single dice is 1 – prob(D6 = 6) = 5/6 (rule 1). So, the probability of rolling no 6’s, on 4 dice, equals 5/6*5/6*5/6*5/6 = 0.48 (rule 2).

Completing the computation, we get: prob (at least one 6) = 1 – 0.48 = 0.52 = 52%.

That’s great, but what’s the general formula? If we roll n number of dice, and each die scores a success with probability s, then the probability for scoring at least 1 success equals:

prob (at least 1 success) = 1 – (1-s)^n 


with the ^ sign indicating taking (1-s) to the power n.

Scoring at least 1 success, method 2


Some readers might have noticed there must be some connection to the binomial function. After all, in the "Buckets of Dice" blogpost, we expressed Bin(k, n, s) as a function of 3 variables: k is the number of successful events out of a total of n events, and s is the probability of a single event (in our case a die roll) being successful.

So, Bin(0, n, s) is the probability of 0 successful events. The probability for at  least 1 successful event can then be computed as 1- Bin(0, n, s). And lo and behold, when you do the math, this works out exactly the same as the formula above.

Alternatively, you can add up the chances for 1 success, 2 success, up to n successes: Bin(1,n,s) + Bin(2,n,s) + … + Bin(n,n,s), since all these together are all possible outcomes for scoring at least one success. This is a little bit more difficult to work out mathematically, but the result is the same.

Results


Now that we know how to compute the probability, let’s look at some results.
The table below lists the probability for scoring at least 1 success, when rolling 1-12 dice, and for various target numbers that signify success.

6
5+
4+
3+
2+
1
0.17
0.33
0.50
0.67
0.83
2
0.31
0.56
0.75
0.89
0.97
3
0.42
0.70
0.88
0.96
1.00
4
0.52
0.80
0.94
0.99
1.00
5
0.60
0.87
0.97
1.00
1.00
6
0.67
0.91
0.98
1.00
1.00
7
0.72
0.94
0.99
1.00
1.00
8
0.77
0.96
1.00
1.00
1.00
9
0.81
0.97
1.00
1.00
1.00
10
0.84
0.98
1.00
1.00
1.00
11
0.87
0.99
1.00
1.00
1.00
12
0.89
0.99
1.00
1.00
1.00

You can easily read results from this table. E.g. when rolling 5 dice, with a 4+ needed for success, there is a 97% chance of scoring at least 1 success. Note that the results are rounded to 2 significant digits, so a result of 1.00 (100%) is not a 100%, but it is at least 99.5%.

Just to illustrate things, below is the table for rolling 12 dice, with probability for success on a single die expressed in 10% increments. Think about this as rolling a number of D10’s, in an analogue manner as we derived the results for a number of D6’s. So, when rolling 4 D10’s, each with a target number of 7+ (40% chance for success), there is a 87% chance of scoring at least 1 success.

0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0.10
0.20
0.30
0.40
0.50
0.60
0.70
0.80
0.90
2
0.19
0.36
0.51
0.64
0.75
0.84
0.91
0.96
0.99
3
0.27
0.49
0.66
0.78
0.88
0.94
0.97
0.99
1.00
4
0.34
0.59
0.76
0.87
0.94
0.97
0.99
1.00
1.00
5
0.41
0.67
0.83
0.92
0.97
0.99
1.00
1.00
1.00
6
0.47
0.74
0.88
0.95
0.98
1.00
1.00
1.00
1.00
7
0.52
0.79
0.92
0.97
0.99
1.00
1.00
1.00
1.00
8
0.57
0.83
0.94
0.98
1.00
1.00
1.00
1.00
1.00
9
0.61
0.87
0.96
0.99
1.00
1.00
1.00
1.00
1.00
10
0.65
0.89
0.97
0.99
1.00
1.00
1.00
1.00
1.00
11
0.69
0.91
0.98
1.00
1.00
1.00
1.00
1.00
1.00
12
0.72
0.93
0.99
1.00
1.00
1.00
1.00
1.00
1.00

 

How to use as a gaming procedure?


A dice rolling procedure is meaningless by itself. It always needs to be embedded in a bigger framework of rules, and it should be given meaning within the context of a game.

Nevertheless, there are some interesting observations one can make from the tables above. If a specific mechanic only distinguishes between scoring no successes, and at least one success (in other words, no distinction is made whether you score multiple successes), it is obvious you should keep the number of dice, as well as the chance for success on a single die roll, both low. It makes no sense to design a mechanic in which you roll 6 D6’s, and have to score at least one success as a 4+. That gives you a probability of 98%, so why bother? On the other hand, rolling 3 D6’s, and requiring a 5+, gives a probability of 70%. That is still high, but at least it might make sense within a specific gaming engine.

Due to the limited “working range” of the “at least one success” mechanic, it is also a bit difficult to analyze possible modifiers. Either you could alter the target number (shifting a column left or right), or alter the number of dice (shifting a row up or down). There is no easy equivalency to be detected. This is partly caused by the power-dependency of the probability (mathematically, we would want to compute the derivative function, which is non-linear in this case). But if you want to introduce modifiers, use only one of them. It’s always a bad idea to modify target numbers and numbers of dice within the same die roll, since that simply confuses players and makes it harder to remember the rules

Personally, I am not a big fan of the "score at least one success" procedure, because it is a very binary decision to use as a resolution mechanic. But it is always nice to be able to compute the various probabilities, even if you would differentiate between 1, 2, 3, ... successes after the roll. And as a games designer, it's always useful to have a variety of tools in your toolbox, even though you rarely use some of them ...