Dice Specifiers

Dice Specification

Dice can be a simple as “roll a single six sided die” or as complicated as “roll four six side dice and keep the three highest (and add the rest together)” or “roll a six sided die and an eight sided die, reroll any ones that show up, total them and also note the highest die”. theDicenomicon support all of these an so much more

Overview

Dice Specification is a critical part of theDicenomicon - from the dice bar to InnCant and InnScript scripting and beyond. It can be broken down into the following components:

  • How many dice to roll
  • The “material” appearance of the dice (size, color, etc…)
  • What shape the dice are and what are on the faces
  • Any sort of behaviour specific to rolling the dice (such as “reroll ones”)
  • Converting what the dice show into a value.

Many of these specification include support for passing parameters, allowing you to easily change the number of dice rolled, for example, or a “target number”. This specification is all done as a sequence of letters, numbers and (sometimes) punctuation with no spaces or new lines. They are specified in that order:

count [size] [color] shape [macro] [reducer]

(where macro is something that impacts the way the dice roll and reducer converts the faces shown on the dice to a value). Note that the reducer can actually be separated into filters that can, for example, ignore dice (which is how “keep the highest 3” works), and tabulators that “total” the results of the filters (usually by adding them together)

Count and shape are required, the rest are optional.

How many dice to roll

This is simple - specify an integer indicating how many dice to roll (if the number is 0 or less, the resulting value is “0”). With a few exceptions, the dice specification always starts with a number. This is required because otherwise the dice specfication would look just like variable name in InnCant/InnScript. For example:

1d8

Rolls a single d8 die

d8

is just a variable named d8. There is an exception for percentile dice, since d% isn’t a value variable name.

The number of dice can also be specified as a parameter - this is done by using the parameter syntax:

#(PARAMETER)

Enclose the parameter variable with parenthesis and prepend a # symbol. By convention, variable names are normally all in upper case. Also note that the value of the parameter should be an integer, or the result will be undefined. Only a single parameter variable can be specified, not a full expression (so it is not currently possible to say #(COUNT+1)d6)

What size dice to roll

By default, every die is roughly the same size when rolled. You can, however, specify a different size - either smaller or larger than the die. This is done by adding a . and a single character code:

  • F: Fine (50%)
  • D: Diminutive (66%)
  • T: Tiny (80%)
  • S: Small (90%)
  • M: Medium (100%)
  • L: Large (110%)
  • H: Huge (125%)
  • G: Gargantuan (150%)
  • C: Colossal (200%)

The values are all relative to medium “normal” dice. So:

3.Td6

will roll three “tiny” six sided dice.

What material the dice are

By default, there is a preset color for dice (based on the original “low impact” plastic dice). This is termed the “standard” color for a give die shape:

  • d4: Yellow
  • d6: Red
  • d8: Green
  • d12: Blue
  • d20: White

Besides being able to override the default color, you can explicitly specify the color of the material by adding a single letter after the count:

  • r: Red
  • g: Green
  • b: Blue
  • c: Cyan
  • m: Magenta
  • y: Yellow
  • k: Black
  • w: White
  • a: Gray
  • o: Orange
  • n: Brown

These codes are case insensitive (so “3Rd6” and “3rd6” are the same).

Furthermore, these colors can also be tweaked by specifying a color modifier:

  • +: Lighter
  • -: Darker
  • *: Alternate form

Not all colors perfectly support these modifiers. For example, “lighter white” or “darker black” don’t make sense. The “alternate” form normally means a version with a slightly different saturation or hue of the color.

Some dice sets support an accent color. If you are using those dice sets, the accent can be specified by adding a & and then the color code for the accent, including possible color modifier.

Finally, the color used to draw the numbers can be specified as well by adding a / and color code and optional modifier. Note that custom dice can also specify the color of the ink used on the symbols on dice, which override the specified ink color.

Putting all these together, we can have:

3r-&b+/o*d6

which is “three dark red and light blue dice inked with an alternate version of orange six sided dice”.

Shape

This is perhaps the most important part of the dice specification - the actual shape of the dice (and what their faces shows). In the simplest case, you just use d followed by the number of faces. This number can also be a parameter (so 3d#(SIDES) is valid). This will result in rolling a die with faces that go from one to that number. If you specify something that doesn’t have an obvious shape with that many sides, it will follow several different strategies to simulate that value. For example, if you roll a 1d19 it will roll a d20 with the 20 sided blanked out, and reroll the die if it rolls that blank. Rolling a 1d36 would roll two six sided dice and multiply one of the values by 6, add the two of them and subtrace one (which perfectly models a uniform 1…36).

Besides the a number, there are a few special values that can also be used:

  • %: percentile, with two ten sided dice, one for “units” digit, one for “tens” digit, resulting in 1…100
  • or %%: permille, like a percentile, but with three digits, resulting in 1…1000
  • or %%%: per ten thousand, as above but four digits, resulsting in 1..10000

Percentage dice can include an “advantage” and “disadvantage” style system by adding a + or - before the percentage. In these cases, single digit dice are rolled for all the dice and the result is sorted (so a roll of 3 and 7 would be 73 if rolled with advantage, or 37 if rolled with disadvantage).

Similarly, a d0 is a single digit, from 0..9 (which is what most “d10” show making them easier to be used in rolling percentile dice, but sometimes confusing to newcomers that “0” is “10”). d00 will roll a tens digit (i.e., 00, 10, 20, etc…), d000 rolls hundreds (i.e., 000, 100, etc…) and d0000 rolls thousands digits (i.e, 0000, 1000, etc…)

Custom dice can be specified by dNAME (where NAME is the name of the custom die). dF is built in to support Fudge/FATE dice (a d6 with two “-“, two “+”, and two blank sides, evaluating as -1, 1, and 0 respectively). Custom dice can also be specified by adding a parameter to their name (dSTEP#(X)), which is indented to support “step” dice systems (where the number of sides or even multiple dice are rolled based on “step” value - see Custom Dice for more details).

There is explicit support for custom dice to generate d66% style number - rolling two six sided dice and treating them as digits like a d%. This includes d66%, d88%, d666%, and d888%.

As one additional tweak, instead of using d you can use a z to indicate that the dice go from 0 to the value - 1. For percentile dice family, this results in a value of 0…99 (instead of 1…100).

For simple cases of custom dice (that just show different values on the dice), you can specify a series of values to be displayed on the dice by putting them inside square brackets (separated by commas). For example:

3d[2,3,3,4,4,5]

Will roll 3 “averaging” dice (sometimes used in tabletop war gaming). For these cases, for best results you should specify a number of values that correspond to common dice that have large easy to see faces (ideally d6, d8, d12 or d10 in some cases)

Not just numbers

Note that dice support more than just integer values - dice can also produce textual values (for example, a weather custom die can have values like “Rain” or “Windy”). So you can roll vowels by doing 1d["A","E","I","O","U","Y"]

Roll Macros

It is common for rolls to be modified based on what the face shows. An extremely common case of this is an “exploding” or “open ended” die - if you roll a 6, you reroll that die and add that new roll (repeated so long as you roll a six). This can be specified with a roll macro - in the case of open ended dice:

3d6+

There are several built in roll macros:

  • +: If the face shows the high value of the die, reroll and add the new result. Also known as “exploding” or “open ended (high)” rolls.
  • -: Similar to open ended high rolls, but if you roll the low value (usually 1) you roll another die and subtract that from the result. These rolls get more complicated (if you roll a second 1, do you subtract 1 and roll again or what?), but theDicenomicon provides a standard interpretation (that effectively will mirror the distribution of open ended high rolls)
  • ± or +-: Both high and low ended rolls at the same time
  • .+: With regular open ended dice there is a slight problem - a 1d6+ will never roll exactly 6 (since the first 6 will roll a second die that will be at least 1, resulting in 6+1 = 7). To fix this, there is a variant of open ended rolls where one is subtracted from the next roll (so 6 followed by 1 will be 6+1-1=6).
  • .-: Same as - but with that uniform bias
  • , .+-: Same as ± but with uniform bias
  • *: Just roll another die and treat that as an additiona die. This is often used for die pool systems (which can allow for extra “successes”)

Roll macros can optionally have a target number, which can be an integer or a parameter. The following roll macros are built in (using this parameter):

  • eq#: If the die face is equal to this value, treat it as a 1, otherwise 0
  • ne#: If the die face is not equal to this value, treat it as a 1, otherwise 0
  • gt#: If the die face is greater than this value, treat it as a 1, otherwise 0
  • ge#: If the die face is greater than or equal to this value, treat it as a 1, otherwise 0
  • lt#: If the die face is less than this value, treat it as a 1, otherwise 0
  • le#: If the die face is less than or equal to this value, treat it as a 1, otherwise 0

Finally, the following non-parametric roll macros are built in:

  • reo: Reroll the die if it shows a 1
  • uniluck: Unisystem luck roll
  • unihigh: Unisystem Luck “Rule of 10 Only” open ended high die
  • unilow: Unisystem Luck “Rule of 1 Only” open ended low die

Note that if the die size is a custom name and the roll macro is also an alphabetic value (for example 3dCustom with a roll macro of eq10), there two values are separated by an underscore 3dCustom_eq10 (instead of the ambiguous 3dCustomeq10)

Custom roll macros can also be created in InnScript.

Reducers

Once the dice finish rolling (and possibly rerolling), we need to convert those results in a single value. By default, if you don’t specify anything, it will add the results together. But sometimes you want to do things like only adding the three highest dice (the class 4d6h3 - roll 4 dice and keep the highest three). This is done by specifying a reducer.

A reducer is composed of two parts:

  • Filter, which takes the dice values, and potentially maps to another value (and optionally also applies some sort of effect to the die, like marking it as dimmed to indicate it isn’t used). Filters normally all include a parameter
  • Reducer, which takes that list of values and produces a single value.

Filters

There are several built in filters:

  • h#/hi#: Keep the parameter count of the highest value
  • l#/lo#: Keep the parameter count of the lowest value
  • =#: Keep any values equal to the given parameter
  • ≠#, !=#: Keep any values not equal to the given parameter
  • >#: Keep any values greater than the given parameter
  • ≥#, >=#: Keep any values greater than or equal to the given parameter
  • <#: Keep any values less than the given parameter
  • ≤#, <=#: Keep any values less than or equal to the given parameter

Tabulators

There are five tabulators:

  • nothing or @+: Add the values together
  • X, ×, @*: Multiply the values together
  • # or @#: count of the number of value (with the idea that filters will remove unwanted values)
  • @= : Make a tally - a list of how many of what values are shown, as an object (where numeric values are turned into strings)
  • @: Do nothing, and return a list of the values as is

Tabulators can also be explicitly named by using @.:

  • @.sum: Add the values together
  • @.product: Multiply the values together
  • @.count: count of the number of value (with the idea that filters will remove unwanted values)
  • @.tally : Make a tally - a list of how many of what values are shown, as an object (where numeric values are turned into strings)
  • @.each: Do nothing, and return a list of the values as is

Multiple Reducers

There are times when you need to perform multiple “reduction” from a roll. For example, we may need to both total the values as well as keep track of the highest value (for a “degree of success”, for example). Multiple reducers can be be applied, creating an object with named fields by specifying them like an object being specified:

3d6{total:@+, high:h1}

If the dice rolled (3,6,2) then the result would be the object {total:11, high: 6}

(This is one of the reasons that @+ exists as a tabulator)

Heterogenous Dice/Dice Pools

Normally you roll a bunch of dice that are all the same. However, there are times when you may want to roll multiple dice of different kinds (yet still do things like keep the 3 highest of them). This is often referred to as a “dice pool”. Some board games take this a step further and allow you to have a “bag” of dice that you put together and then draw some dice (blindly) from the back and roll those, discarding them to a separate area or putting them back in the bag afterwards (the dice are normally all identical size and shape, but with different custom faces).

To support these cases, you can use a special form of the dice specifier using p instead of d. In the simplest form, we provide a list of dice inside a bracketed list. Note that the colors and sizes of the dice are specified in that list, since they will often want individual specification.

count `p` `[` list `]` [macro][reducers]

Where list is a list of comma separate dice size color and shape.

For example 3p[bd6, d8, gd6]h2 will roll a blue d6, a d8, and a green d6 and keep (and total) the two highest. If the count is less than the number of dice specified, then it will randomly select that many (so if it was 2p instead of 3p, only two of the dice would be rolled, not all three, and it would randomly picked). If the count is greater, it will select as many “complete sets”, and then randomly select to reach the total (so 4p will roll all three plus one more randomly selected)

If you wish to have all the dice randomly individually selected from the pool, use a p* instead of p. In the above example, using 4p* would still result in four dice being rolled, but there is a chance they may all four be the blue six sided die.

Note that roll macros applie to all the dice equally.