Thursday, November 23, 2017

Difficult Rolls

Here are the dice I keep behind the screen:

Making Do With a d20 and a d6

In a pinch I could get by with the two d20s and three d6s with pips. The d20s can be used for a percentile roll with the convention that pink is tens and white is ones.

The d20 can simulate a d4 by taking the result modulo 4, treating 0 as 4.

The d20 can simulate a d8 or a d12 with the help of a d6. Take the result of the d20 modulo 4, treating 0 as 4. Roll a d6 and add 4 if the result is 4, 5, or 6. Or add 4 if the result is 3, 4 and add 8 if the result is 5, 6.

This DM is a minimalist and only uses a single d6 and a d20 when running a game. Perhaps he uses the techniques above. Maybe he runs an old version of the game where everyone has d6 hit dice and does d6 damage. The DM could ask a player to make a roll.

Discrete Uniform Distributions

How many discrete uniform distribution are needed?

If we are using the above dice, it is sensible to stick to dice rolls in the ranges 1–4, 1–6, 1–8, 1–10, 1–12, 1–20, and 1–100. But if we could generate an integer randomly from any range, then any list could be used as a random generation table.

The Holmes rulebook lists 14 1st level magic-user spells, 18 2nd level magic-user spells, and 18 3rd level magic-user spells. What if we need to determine a spell randomly, say because a scroll is found or an NPC spell caster is encountered? Small wonder the spell lists were truncated to 12 per level in the Moldvay rulebook.

Integer Division and Round Up or Modular Arithmetic

Two techniques for getting a smaller roll from a larger roll

To get a d2 or a d3 we can use the d6 and apply integer division and rounding up. When rolling a d6 with pips I like to use ⌈d6/3⌉ or ⌈d6/2⌉.

For a d5, I use d20 % 5, replacing 0 with 5.

As discussed previously one could use modular arithmetic to get the d2 and d3 rolls. Why the inconsistency? I prefer modular arithmetic nowadays, but the group has a tradition going back to childhood for how a d2 or d3 is rolled.

d6 Helper

Getting a larger roll from two smaller rolls

Back when icosahedral dice were numbered 0 to 9 twice, grognards would roll them with a helper d6 to determine whether the result was in the range 1–10 or 11–20. Specifically the formula d10 × (d2 – 1) × 10 was used. The technique generalizes:

    d15: d5 + (d3 – 1) × 5
    d16: d8 + (d2 – 1) × 8
    d18: d6 × (d3 – 1) × 6
    d24: d12 × (d2 – 1) × 12
    d30: d10 × (d3 – 1) × 10
    d36: d12 × (d3 – 1) × 12
    d40: d20 × (d2 – 1) × 20
    d60: d20 × (d3 – 1) × 20

I use a d6 with pips as the helper. When rolling a d18 I combine it with the d6 with digits.

If High Then Low

Interpolating a roll in between a smaller and a larger roll

A truly uniform result for most of the other ranges is not possible, at least not with a single roll. We use the "if high, then low" technique to get a near uniform approximation. To get a d7, one rolls a d8 and a d6. If the d8 is too high the result on the d6 is used. In general we find the next higher and next lower ranges that we can roll exactly and use those.

To get a d17 a d16 and a d20 are rolled. I don't use a d16 and a d18 because both need a helper d6; there would be ambiguity if the dice are rolled at the same time.

Falling Distributions

Motiving the falling distribution

Gaming has gotten by with uniform (e.g. d20) and normal (e.g. 3d6) distributions. Both of these are symmetric distributions with expected values at the center of the distribution.

When world-building, an asymmetric distribution in which small values are more likely than large values is desirable. We should use a distribution whose probabilities fall in this way to determine the level of an NPC if we want low-level characters to be common and high-level characters to be rare. It could also be used to determine the number of humans in a settlement or the number of orcs in a war party, since populations tend to follow a Pareto distribution.

I know about exploding rolls and penetrating rolls,  but they are close to uniform in practice.

One gets a geometric distribution by rolling repeatedly until a certain value is obtained and counting the number of rolls that is needed. Although strictly decreasing, it is a slow method which requires a lot of re-rolling.

Update: I've found a better way.

Absolute Value of the Difference of Two Rolls

A linear falling distribution with a single roll of two dice—almost

This interview mentions a promising technique, which is to roll the same dice twice and apply the absolute value function to the difference:
Because of the zero value, this isn't a perfect falling distribution, but if one is willing to re-roll until the result is not zero a falling distribution is achieved.


Falling distributions and in general any distribution using percentiles

Here is code for generating a d100 table which approximates an arbitrary distribution. It was used to make this table:

d100      level

An exponential distribution was used with the parameter chosen so 12 is the highest possible value. The distribution looks like this: