Skip to content
RANDSUMgames

RANDSUM games

Tabletop games, ready to roll

Typed rolls for D&D 5e, Blades in the Dark, Daggerheart, Fate and more, generated from open .randsum.json specs.

import { roll } from '@randsum/games/fifth'
const { result } = roll({ modifier: 5, rollingWith: 'Advantage' })

Roll dice for D&D 5e, Blades in the Dark, Daggerheart, Fate Core, PbtA, Root RPG and Salvage Union with typed, game-specific functions. Each game validates input, rolls using the core engine, and interprets the result according to that system’s rules.

Every game runs on @randsum/roller, which implements the full RANDSUM Dice Notation (RDN) Specification.

Salvage Union

@randsum/games/salvageunion: d20 table rolls for mech combat and salvage operations.

View documentation

D&D 5th Edition

@randsum/games/fifth: ability checks, saving throws and attack rolls with advantage and disadvantage.

View documentation

Blades in the Dark

@randsum/games/blades: dice pool action rolls with critical, success, partial and failure outcomes.

View documentation

Powered by the Apocalypse

@randsum/games/pbta: 2d6+stat rolls for Dungeon World, Monster of the Week, Apocalypse World and more.

View documentation

Daggerheart

@randsum/games/daggerheart: Hope and Fear dice with amplification, advantage and disadvantage.

View documentation

Fate Core

@randsum/games/fate: 4dF plus a skill rating, read off the Fate ladder from Terrible to Legendary.

View documentation

Root RPG

@randsum/games/root-rpg: 2d6+bonus with Strong Hit, Weak Hit and Miss outcomes.

View documentation

Every game follows a three-step pipeline: validate input, roll dice, interpret the result.

import { roll } from '@randsum/games/salvageunion'
// 1. Validate: checks that the table name matches a known table
// 2. Roll: rolls the d20 with @randsum/roller
// 3. Interpret: looks up the result in that table by range
const result = roll('Core Mechanic')
console.log(result.result.label) // 'Nailed it' | 'Success' | 'Tough Choice' | ...
console.log(result.result.description) // full outcome text
console.log(result.total) // d20 roll
console.log(result.rolls) // raw RollRecord[] from the roller

Every game shares these characteristics:

  • One roll() function: each subpath exports roll() as its main API, plus its inputs schema and SchemaError
  • Game-specific input types: typed input, not raw notation strings
  • GameRollResult return type: includes result (the game outcome), total, rolls, and optional details
  • Input validation: throws ValidationError (from roller) for out-of-range numeric input and SchemaError for game-specific issues like invalid enum values or unmatched outcome tables
  • No cross-dependencies: games depend only on @randsum/roller, never on each other
  • Small subpath imports: each game bundles only its own rules, with a size budget checked in CI
Game Dice Input Outcomes
salvageunion 1d20 tableName (string) Table result with label + description
fifth 1d20 or 2d20 modifier, rollingWith, crit Numeric total
fate 4dF modifier (skill rating, -2 to 5) A Fate ladder rung, terrible to legendary
blades Nd6 pool rating (number, 0-10) critical, success, partial, failure
pbta 2d6 stat, forward, ongoing, rollingWith strong_hit, weak_hit, miss
daggerheart Hope/Fear dice modifier, amplifyHope, amplifyFear, rollingWith critical_hope, hope, fear
root-rpg 2d6 bonus, rollingWith strong_hit, weak_hit, miss

Install @randsum/games once, then import the game you need via subpath exports. This also installs @randsum/roller as a dependency.

Terminal window
bun add @randsum/games
import { roll } from '@randsum/games/salvageunion'
import { roll } from '@randsum/games/fifth'
import { roll } from '@randsum/games/blades'
import { roll } from '@randsum/games/pbta'
import { roll } from '@randsum/games/daggerheart'
import { roll } from '@randsum/games/fate'
import { roll } from '@randsum/games/root-rpg'
  • Getting Started: install, roll your first game-specific dice, read the result
  • Schema Overview: how .randsum.json specs power the codegen pipeline
  • Individual game pages: detailed docs for each supported system (linked in the cards above)