User Tools

Site Tools


elderscript_dice

Dice

Finally, we get to the dice rolling part, the whole reason ELDARScript and The Dicenomicon even exist (historic note: the original version of The Dicenomicon had a sort of flow chart based UI to specify how many dice to roll, what kind, and things like addition and constants, but was otherwise very limited). Specifying what dice to roll includes not only what specific kind of die to roll, but also how many, what color, special “open ended” roll, other special rolling instructions (“roll macros”) and how to convert a bunch of dice to a single value (“reducer”). In a simplified form, it looks like this:

There are two kinds of dice - numeric dice and textual dice. The former results a number, the latter some sort of text. Given the flexibility of EDARScript, you wouldn’t think it would matter, but while it makes sense to take the sum of rolling 5 six sided dice, it doesn’t make as much sense to take the sum of five dice that pick a random character alignment. Numeric dice are broken into standard dice that show 1 through N, a variant that go from 0 to N-1 (“zero based dice”), and a handful of special dice (such as percentile dice). There are also custom numeric dice (with whatever values you want). All textual dice are effectively custom dice - some are built in, but there is no real standard otherwise to follow. Finally, there are composite dice (percentage dice are conceptually a composite die - it doesn’t really roll a d100, it rolls two d10s and combines the results), as well as step dice (which change based on the number of dice roll, used for games like Earthdawn). All dice include the ability to specify a color (from 11 possible colors - custom dice can be tinted into just about any color).

Code Color
R Red
G Green
B Blue
C Cyan
M Magenta
Y Yellow
K Black
W White
A Gray (as in “gr_A_y”)
O Orange
N Brown (as in “brow_N_”)

ELDARScript also includes support for specifying the size of dice which appears before the color (but after the count), but current The Dicenomicon only support a single size (and the syntax is subject to change).

Code Color
~F Fine
~D Diminutive
~T Tiny
~S Small
~M Medium (usually omitted)
~L Large
~H Huge
~G Gargantuan
~C Colossal

Most numeric dice then support three extra features that textual dice do not - open rolls, roll macros and reducers. These features are what allow The Dicenomicon to support such a wide range of games.

Sides

Most dice are simple dices that go from 1 to a given value (4, 6, 8, 10, 12, 20 are the most common). These then correspond to specific geometric shapes with that many sides. Besides these values, The Dicenomicon has geometric shapes for 14, 16, 18, 24, 30, 48 and 60 sides. It can further more, by using multiple sides for the same value, create dice with 2, 3, 5, 7, and 9 sides, and knows how to combine multiple dice for 40, 60, 80, 100, 400, 600, 800, 1000, and 10000 sides. It can even handle other needed sides by treating certain sides as “blank” and rolling that die again (so it can roll a d11 by rolling a d12 and then treating the 12 as a blank and re-rolling if it shows up). This will create any value between 2 and 10000 that you may need. These are specified as “d#” (where # is the number, e.g. “d6”, “d10”)

Zero based Dice

Besides dice going from 1 through a given value N, dice that show values from 0 through N-1. These are useful in some places because it allows you to add a bunch of dice and not actually increase the minimum value that they will show. So rolling 10 six sided dice will result in a minimum of 10 (all ones), but 10 zero based six sided dice will still have a possible value of zero - it is just unlikely. A zero based die is specified by using a “z” instead of a “d” (e.g. “z6”, “z10”).

Special Dice

There are a handful of special dice that are used commonly enough to warrant having built in support. Note that not all have zero based forms:

Code Color
d6a “Averaging” dice sometimes used in war-games. The values for 1 and 6 are re-labeled as another 3 and 4 to increase the chance to get average rolls
d%, z% Percentile dice, generating 1..100/0..99
d‰, z‰ Permille dice, generating 1..1000/0..999
d‱, z‱ Per-ten thousand dice, generating 1..10000/0..9999
d0 Single units digit (identical to z10)
d00 Tens digit (00, 10, 20 .. 90)
d000 Hundreds digit (000, 100, 200 .. 900)
d0000 Thousands digit (0000, 1000, 2000, .. 9000)
dF FUDGE/Fate:Core specific dice - generates -1, 0, or 1 uniformly (with a minus, plus, or blank face)

Custom Numeric Dice

Additional dice can be created with arbitrary values shown on the faces (or even images or icons). These are referred to via their name. For example, there is a built in set of dice that show roman numerals instead of digits, so “dRom6” is a six sided die showing I .. VI. Note that these don’t support a zero based version.

Composite Dice

For some game systems (e.g., In Nominae), six sided dice are treated as individual digits in a value (so you can roll from 11 to 66). Percentage dice are similarly - multiple dice are treated as a single value. These are called composite dice and The Dicenomicon supports custom composite dice. Up to four dice can be specified, and then a formula exists to combine the results of those four dice into a final value. For the first example, that formula would be “#1 x 10 + #2”. Composite dice are otherwise treated like custom numeric dice.

Step Dice

There are a handful of games that, rather than rolling more dice, one increases the size of the dice (going from a d4 to a d6 to a d8, etc… eventually adding additional dice). To support this The Dicenomicon has support for step dice. Built in support includes EarthDawn (3rd edition), EarthDawn “old” (1st-2nd), and Margaret Weis Productions (i.e., Cortex based games). The number of dice to roll actually indicates the step to use. So, with EarthDawn, “4dED” will roll a d6, while “5dED” rolls a d8 and “14dED” rolls a d10 and d12 and adds them together. Step dice are otherwise treated like custom numeric dice.

Textual Dice

Finally, there are textual dice. These are dice that have labels on their faces, for example, or other images that don’t create a specific numeric value. One can easily image a die that generates the twelve signs in the zodiac (and such a thing is built in), or various dice that can generate hit locations - all based on a textual result. Because the result is textual, open rolls, roll macros, and reducers are not supported (if more than one die is rolled, the result is a list of all the values).

Open Rolls (a.k.a. “Exploding”)

Many games have rules that say “roll a d6, and if the result is 6, roll an extra die” - these dice “explode” into another die. This allows a fairly linear result, but leaves the extreme “open” to generate even higher values in rare cases. What is interesting about open ended rolls like this is that theoretically any value can be roll, it is just highly unlikely that you’ll roll enough 6s to get there. This is expressed by adding special characters after the “d” (or “z”) but before the number of faces on the die, e.g. 3d+6 will roll three six sided dice that are open on the high end. Besides exploding on the high end, it is not uncommon for dice to explode on the low end as well - get a one, and you start subtracting additional rolls (the actual math gets confusing), or open on both ends. There is a quirk in most open ended dice, however. For example, with an open ended d6, there is no way to get a value of exactly a 6 - if you roll a 6 you will roll another die and get at least a 1, and 6 + 1 = 7. To deal with this, some games include the ability to make this uniform by subtracting 1 for every extra die, so that roll of 6 and 1 becomes 6 + 1 - 1 = 6. The “high” and “low” threshold are defined as being 1 and N (for a dN dice) for all dice up to a d20. Above that, the top/bottom 5% are used (it is extremely rare for a d% open ended system to use just 100% or 1% - normally it is 96-100 and 1-5). A roll macro can be made specifying alternate values.

Code Style
+ Open High
- Open Low
±, +- Open High And Low
* Roll another (independent) die if the high threshold is hit - usually used for “dice pool” based rolls
.+ Open High (uniform)
.- Open Low (uniform)
.±, .+- Open High And Low (uniform)
/+ Open High, but only add subsequent dice if more than half the highest value (Unisystem)
/- Unisystem Style Open Low
/±, /+- Unisystem Style Open High/Low

Roll Macros

Roll macros are a way to look at a single die’s value and act upon it. A roll macro is composed of two parts - the logic used while rolling the die, and the logic used while figuring out what the value is. The first part results in an action for the die - for example, the die can automatically re-roll, or play a sound, add a “badge” to the die, or tint/highlight it. The second half is used when figuring out the actual value of the result. Note that roll macros can simulate open dice rolls, plus do many other things. One extra thing that roll macros can do is support a “target number”. Suppose you want to count all dice over a certain values as “1” and those under as “0” (a fairly simple “target number dice pool” roll). Roll macros can take that target number as a constant - it is specified as part of the roll macro name (and this value can, like other constant values, be a parameter). A variety of roll macros are built in, and additional can be created via The Dicenomicon. In the table below, a # at the end of the code indicates that it takes a target number

Code Name
TN# Targeted
XX# Targeted, high = +2
MIN# Treats all rolls less than this as this value
MAX# Treats all rolls greater than this as this value
BOD Body damage for Champions
BRU# Brutal dice - roll again if less than target
REO# Re-roll once if less than the target
ARS Ars Magica Stress Roll
MEGS MEGS Open on doubles of a percentile die
HGR Heavy Gear “half as zero”
HERO Macro for DC Heroes dice
OPN# Extra Open
OPH# Extra High Open
CAP# Damage Cap (treat values above the cap as zero)

Roll macros are specified after the number of faces (or name of a custom die). In some cases, if the number of faces is the same as the default die size as for the macro, the number of faces can be omitted, and a target number can also be omitted if it matches the default target for the macro (the editor in The Dicenomicon will do this automatically for you). For example, TN is designed for d10 dice pools in WoD, so instead of 5d10TN7, you can write 5dTN instead.

Reducers

Once a bunch of dice have been rolled, how do we convert that collection to a single value? The most common way is to take the sum of all the dice (for numeric dice). We’ve also see the @ reducer which leaves the values as a list. There are a couple of other ways that we can combine dice values, again, most with a target number associated with them (unless otherwise specified, there is a target number):

Code Name
Default to sum of all dice value (no target)
H, HI The N highest dice are kept
L, LO The N lowest dice are kept
# The Nth dice is used (e.g., 3d6#2 is the middle die)
>, ≥, =, ≠, <, ≤ Count how many dice are greater than, greater than or equal to, equal to, not equal to, less than, less than or equal to the value of N
X Exalted specific success total
@ Keep results as a list (no target number)

Reducers are written at the end of the dice specification. It is important to remember that reducers act after roll macros, and based one the values that roll macros produce (which may not match what the dice show). Also note that roll definitions are all parsed as a single value, so it is not uncommon to run into problems using the comparison operator in an if expression with a roll. For example:

  1. if 3d6 > 10 then
  2. “Success”
  3. else
  4. “Failure”
  5. end

will always return “failure” because that if expression is actually testing “roll 3 six sided dice and count how many dice are showing a 10 or more” (which, of course, is impossible, so the result is always zero). Instead you need to do:

  1. if (3d6) > 10 then
  2. “Success”
  3. else
  4. “Failure”
  5. end

Putting it together

Not all dice support all options, but they all use the same order of components:

  • Number of dice (omitted for 1 die, can be a parameter)
  • Color of the die (omitted will use a default color based on user preference or built in default based on size of dice)
  • Size of Dice (omitted is normal, format subject to change)
  • Sides:
    • Text Dice: t name of dice
      • No further specifications possible
    • Numeric Dice: d or z
      • Open/Exploding specifier (optional)
      • Sides:
        • 1 .. N numeric: # (can be parameter, had a d)
        • 0 .. N-1 numeric: # (can be parameter, had a z)
        • Special dice (usually with a d, some support z)
        • Custom, composite, step dice (have a name instead of a number of the sides)
      • Roll Macro (optional name, with optional target number for some macros. Target number can be parameter)
      • Reducer (optional name, target number for some reducers. Target number can be parameter)

Mixed Dice Pools

One new feature in ELDARScript 2.0 is the ability to roll different sided dice together and treat them as if they were all the same. For example, some games have you roll a bunch of different dice and take the highest N dice, such as “roll d4, 2d6, d8 and take the two highest”. This can be done with a special “collection parenthesis”. Individual dice are grouped together inside a $(). For example: $(d4, d6, d6, d8)H2 will roll the roll described above. Only numeric dice are allowed in a mixed dice pool (though colors, open rolls and even roll macros can be specified for individual dice if desired). Mixed dice pools are defined as the pool specifier “$(dice…)” followed by optional reducer. Roll macros are specified in each individual element of the dice pool as desired.

elderscript_dice.txt · Last modified: 2019/07/12 15:23 by dicenomiwiki