A game system is the data of one game: fields, sheet, formulas, pages and rules text. The engine knows no game; each campaign plays one system. Examples come from the 5e and from systems/free, the one system the engine ships. src/systems/read.ts reads a system.yaml against schema.ts.
1. The folder
systems/<name>/
system.yaml what the system declares (section 2)
LICENSE.md license and attribution
world/ its pages (section 4)
rules/*.md its rules, one chapter a file
images/ pictures its pages link in `image`
instructions/*.md additions to the master's instructions (section 4)
words/<code>.yaml its words in other languages (section 4)
translations/<code>/ its pages and rules in another language (section 4)
versions/<name>/ a version of its rules (section 2)
theme/ its dashboard theme (section 2)
package.json npm name, version, API, code (section 6)
build/, test/ not shipped
package install 5e installs from npm, package install ./my-system from a folder; package new "<title>" --kind system makes a TypeScript package with passing tests.
A campaign names its system in campaign.yaml (system: 5e).
An unknown key, an unreadable formula, or a key naming a missing or wrong-kind field, group, condition, table or occasion refuses the system.
The schema is part of the package API: a new key comes with a new API number, which a system using it declares. A folder without package.json is data alone.
2. system.yaml
Only title and language are required. Field names ignore case.
Key
Does
title
the system’s name
language
the language its pages are named in, as en
attribution
the credit its source requires; the dashboard shows it
Theme
theme: theme names the folder holding theme.yaml, data the engine checks and turns into CSS custom properties. dashboard-style.md says what each value changes.
Key
Shape
name
text
version, engine
its version; the lowest rpg-engine that reads it, quoted ("0.22")
fonts
[{family, file, weight, license}]: woff2, woff, ttf or otf, each with its license file
text-font, title-font, story-font
a family of fonts
story-size
0.85 to 1.4 of the page’s letters
number-font
text or title
corners
px, 0 to 16
titles
{case: as-written, capitals or small-capitals, spacing}
cards
{inner-line, ornament, corner, texture}
buttons, tabs, bars, pips
{shape}: rounded, square, pill, cut, underline, slanted, round as each allows
shadows
soft, sharp, none or glow
papers
{documents, maps} colours
portraits
{shape, frame}
style
a CSS file, added in layer theme-style over the page’s rules
icons
SVGs for party, scene, combat, journal, world, saves, help, settings, about, packages, menu
light, dark
each mode’s colours, both required
variants
[{name, light, dark}]: colour variants offered in Settings
Mode pictures: page-texture, bar-texture, head-picture as {picture, fit: tile or cover}; page-ink, bar-ink, head-ink, head-ink-2 colour an SVG picture’s currentColor.
Maps: maps: {paper, ink, floor, things, water, land, roads} in a mode; paper and ink required, the rest derived.
Variants change colours only, never pictures, faces, shapes or papers.
Files stay in the theme folder, at most 1000 KB each, named with their case on disk; icons are SVG paths on a 24 grid. The cards’ texture SVG paints only in currentColor, with no style, picture, filter or animation. The style sheet’s url() names only theme files, with no @import or font faces.
Checks: the engine measures contrast (text 4.5:1, focus ring 3:1) in each mode and variant; a failing theme is not used and validate names the colour to change.
A theme is also a package of its own, for any system: a repo with the topic rpg-engine-theme, a .zip or a folder with theme.yaml at its top; see the theme guide.
fields
fields: {hp: counter, str: number, str-mod: modifier}. An undeclared field written as a number or current/max counts as a counter.
Kind
Meaning
counter
12 or current/max, changed with change
number
a number, never counted
at-least
raised by pages of bonus-lists, never lowered
modifier
shown with its sign
bonus
effects add it up; missing reads 0
factor
effects multiply it (2, 1/2); missing reads 1
length, weight
worked out, shown in the game’s unit and in metric for a metric player
duration
minutes, shown as 1h 30m
text
text, or true/false
list
a list
rolls
dice kept for later
Measures, money and travel
Key
Does
coins
gp 100, pp 1000 rare, sp 10, cp 1: each coin’s value in the smallest; rare never given as change
coin-metals
{gp: gold}, as the dashboard draws coins
round
6 seconds
dawn
"06:00"; passing it, the output lists counters to restore
imperial
{mile, foot, pound} in metric, for imperial campaigns
length-unit
the unit of computed lengths, as ft
load
{field, limit, coins, weightless, bundle, stages}: carried weight against a limit; formulas read load and load-limit
travel
{paces, pace, hours, rule, beyond, terrain, vehicles, kinds}: paces per hour, day length, terrain factors, vehicles and kinds of route
grid
{square, diagonal, difficult, speed, walking, size, footprints, leaving}: how a place’s map counts movement
settings, engine-settings, versions
settings:outcomes:about:how what happens is decidedrolled:{means:"forthemaster",player:"fortheplayer",asks:[die],suggested:true}engine-settings:{rigor:[smooth]}
settings: what the setup asks. Each value has means; optional player, without, asks, suggested and engine-settings.
engine-settings: the values offered of an engine setting such as rigor or lethality; one value alone is enforced, never asked.
versions: written as a setting, picked with the engine setting ruleset; the first listed is the default, so list the oldest first. Each has versions/<name>/ in the system’s shape, with a system.yaml of only the keys it changes; maps merge by name, lists and values replace, a same-named page, chapter or word replaces.
Names are ASCII letters, digits and single hyphens: write level - 1, not level-1.
A list item is a name with an optional number: "[[Fighter]] 3".
Formulas also read effects, rigor, load and load-limit.
A missing field, division by zero or missing row gives no value; the page’s own is read.
A page is read in layers: its bases, the page, its effects, then the system’s computations.
4. Pages, rules, words and instructions
Pages: world/<folder>/<Name>.md, the folder giving the type: characters, places, factions, quests, items, events, topics, creatures. Names are unique; quote signed numbers and links. A system’s pages hold no secrets. An item is a kind, counted in stacks, unless it has a counter.
Rules: rules/*.md, each chapter opening with a heading; sections are headings, bold titles and table captions. Titles hold no ›, > or /.
Words: words/<code>.yaml with groups, fields, words, names (full names of short fields) and headline.
Translations: translations/<code>/world/... (frontmatter only name) and translations/<code>/rules/..., by English file name; read in place of English, while the sheet is worked out from English.
Instructions: instructions/<part>.md adds to a core part, or replaces it with replace: true. Parts: setup, session-zero, session, play, combat or any scene type, new-day, quest-ends, level-up, adventure, dashboard-guide, mentor-hints, mentor-tutorial, import, and <setting>-<value>, which follows play while that value plays.
5. What a campaign adds
A campaign’s pages work as a system’s; a campaign page cannot take a system page’s name.
A layer changes a system page for the whole campaign: write Goblin, layer, set hp=12/12 writes layers/<system>/world/creatures/Goblin.md with only what differs; reset removes it.
campaign.yaml adds fields, tables, computed, counters, recipes, status-line, travel, values and condition-icons with config. Same names replace, but recipes and travel merge, and values and status-line join.
An extension adds the same keys but status-line and travel: see extensions.md.
6. Code
Where data is not enough, a system brings code, with the contract of an extension, PackageEntry (extensions.md): commands, timePassed, widget hooks and a page module. Its package.json declares it:
before ask shows its buttons; may change how the roll is asked
Hooks return lines for the output; the system’s run before the extensions’.
Commands are named as the system or start with its name and a hyphen: 5e-spells.
The page module may give groups: components that draw a sheet group’s card.
Code reaches the game only through game: never Math.random, Date, process, globalThis, import() or Node’s modules.
Code loads once at start; a failing hook becomes a line for the master and the command’s change stands.
7. Checks
The test kit’s systemChecks(folder) checks a system’s pages, names, fields, rules, dice, coins, pictures and theme, and returns its attribution. A system keeps its own tests on the kit (extensions.md).