Rules file
Every section and field a rules file may have, generated from the rules DSL's JSON Schema. The page is rebuilt from the platform's contracts each time the site is built, so it always matches what the checker accepts.
A field's path is written from its section: a.b is b inside a.<name> stands for a name you choose, such as a zone's, and [] for each item of a list. An expression is written as a YAML string, or as a plain number, Boolean or list.
Sections
dsl
Required. Type: one of 0.1, 0.2, 0.3, 0.4, 1.0, 1.1.
game
Required. Type: object.
| Field | Type | Description |
|---|---|---|
id required | string | Matches ^[a-z0-9-]+$. |
name required | string | |
players required | object | |
players.min required | integer | At least 1. |
players.max required | integer | At most 16. |
seats required | object | |
seats.topology required | one of ring, ordered | |
seats.names | list of string | |
seats.neutral | list of object | |
seats.neutral[].id required | string | |
seats.neutral[].when | expression | |
seats.neutral[].controller | expression | |
version | string | Ruleset version (semver). Expansions declare which base versions they accept. Matches ^\d+\.\d+\.\d+$. |
variants
Type: list of object.
| Field | Type | Description |
|---|---|---|
[].id required | string | |
[].name required | string | |
[].when | expression | |
[].required | boolean | |
[].options | list | |
[].default | any value | |
[].overrides | object | Replace whole actions or named flow phases when this variant is on. Use when guards for one-line differences. |
[].overrides.actions | map of names to action | |
[].overrides.phases | map of names to flowNode |
enums
Type: map of names to list of string. Enums. Named sets of values, such as piece kinds or card types.
| Field | Type | Description |
|---|---|---|
<name> | list of string | The enum's values, in order. At least 1 item. |
consts
Type: map of names to expression. Constants. Named values the rules use, each an expression.
boards
Type: map of names to board.
components
Type: map of names to object. Components. The types of component in the game and the properties each one has.
| Field | Type | Description |
|---|---|---|
<name> | object | Component. A component type and its properties. |
<name>.props required | propMap | Properties. Each property's name and type. |
<name>.publicProps | list of string | Public properties. Properties everyone sees even when the zone hides the component's face, such as clue marks. |
abilities
Type: map of names to object.
| Field | Type | Description |
|---|---|---|
<name> | object | |
<name>.params | propMap | |
<name>.kind required | one of passive, immediate, scoring, scoringChoice, endOfTurn, action | |
<name>.tradable | boolean | |
<name>.effect | effects | |
<name>.score | expression |
data
Type: map of names to object. Data tables. Tables of components: rows written in the rules, a file, or both.
| Field | Type | Description |
|---|---|---|
<name> | object | Data table. One table of components. |
<name>.of | string | Component. The component type each row is. |
<name>.file | string | File. A CSV or JSON file holding more rows. |
<name>.note | string | Note. A note for whoever reads the rules. |
<name>.versionWith | one of rules, components | Versioned with. Whether the table changes with the components (the default) or only with a new rules version. |
<name>.rows | list of object | Rows. The table's rows, one component each. |
zones
Type: map of names to object. Zones. Where components are, such as decks, hands and board cells, and who can see them.
| Field | Type | Description |
|---|---|---|
<name> | object | Zone. One place components can be. It may also hold keys the schema doesn't list, which the schema doesn't check. |
<name>.kind required | one of stack, set, cell, slots, track, list, bag, layout | Kind. How the zone holds its components, such as a stack, a set or a board cell. |
<name>.of | string | Component. The component type the zone holds. |
<name>.visibility | one of public, owner, hidden, countOnly, topPublic, faceDown, nobody, allButOwner | Visibility. Who can see the components in the zone. |
<name>.perSeat | boolean | Per seat. Whether each seat has its own copy of the zone. |
<name>.knowledge | one of none, retainedOnPass | Knowledge. Whether a seat keeps knowing a hidden component after passing it on, as when hands are passed. |
<name>.onEmptyDraw | object | On empty draw. What happens when a seat draws from the zone while it is empty. |
<name>.layout | string | Layout. The layout of a layout zone's spaces. |
<name>.capacity | expression | Capacity. The most components the zone can hold. |
<name>.note | string | Note. A note for whoever reads the rules. |
<name>.keys | string | Keys. What the zone is keyed by when there is one per key, such as an age. |
state
Type: object.
| Field | Type | Description |
|---|---|---|
global | propMap | |
seat | propMap | |
campaign | propMap | |
side | propMap | |
role | propMap |
functions
Type: map of names to object.
| Field | Type | Description |
|---|---|---|
<name> | object | |
<name>.params required | propMap | |
<name>.returns required | string | |
<name>.expr required | expression |
procedures
Type: map of names to object.
| Field | Type | Description |
|---|---|---|
<name> | object | |
<name>.params required | propMap | |
<name>.do required | effects |
setup
Type: effects.
history
Type: object.
| Field | Type | Description |
|---|---|---|
positionKey | list | |
derived | object |
flow
Required. Type: list of flowNode. At least 1 item.
actions
Type: map of names to action.
triggers
Type: list of object.
| Field | Type | Description |
|---|---|---|
[].event required | string, or list of string | |
[].when | expression | |
[].crosses | object | Fire only when a value crosses a threshold in one direction. up: before < threshold <= after. down: after < threshold <= before. before = value - delta. Combined with when by AND. |
[].crosses.value required | expression | The value after the event. |
[].crosses.delta | expression | How much the value changed. Defaults to event.delta. |
[].crosses.threshold required | expression | |
[].crosses.direction required | one of up, down | |
[].do required | effects | |
[].id | string | |
[].timing | one of replace, before, after, afterAction | |
[].orderBy | one of activeSeat, owner, fixed, decider | |
[].limit | string | |
[].optional | boolean | |
[].owner | expression | |
[].priority | integer | |
[].note | string |
heuristic
Type: object. DSL 1.1: game knowledge for bots, never part of the rules. 'evaluate' scores an unfinished position for the seat bound as s (an int, higher is better); 'scale' is the score lead that counts as a clear advantage; 'prefer' weights actions for move ordering, each an int expression with s bound.
| Field | Type | Description |
|---|---|---|
evaluate required | expression | |
scale | integer | At least 1. |
prefer | map of names to expression |
clock
Type: object.
| Field | Type | Description |
|---|---|---|
supported | list of one of suddenDeath, increment, delay, bronsteinDelay, perTurn | |
onTimeExpired | effects |
end
Type: object.
| Field | Type | Description |
|---|---|---|
when | expression | |
scoring | any value | |
scoringChoices | list | |
tiebreak | list of expression | |
shareTies | boolean | |
seats | expression | |
hooks | list of string | |
rating | one of elo, glicko2, openSkill, none | |
sides | boolean, or map of names to object | |
sides.<name> | object | |
sides.<name>.win | expression, or list of expression | |
sides.<name>.lose | expression, or list of expression | |
sides.<name>.score | expression | |
instantWins | boolean, or list | |
note | string | |
checkAfter | list of one of action, step, phase, turn, round, effect |
hooks
Type: map of names to object.
| Field | Type | Description |
|---|---|---|
<name> | object | |
<name>.kind required | one of scoring, choiceGenerator, condition, effect, notation | |
<name>.signature required | string | |
<name>.note | string |
sides
Type: list of object.
| Field | Type | Description |
|---|---|---|
[].id required | string | |
[].members | expression | |
[].outcome | one of shared, individual | |
[].shareKnowledge | boolean | |
[].note | string | |
[].hiddenMembership | boolean | Membership is projected only through the knownBy of the fields it is computed from. |
roles
Type: map of names to object.
| Field | Type | Description |
|---|---|---|
<name> | object | |
<name>.name | string | |
<name>.side | string | |
<name>.controls | list of string | |
<name>.when | expression | |
<name>.setup | effects | |
<name>.flow | list of flowNode | |
<name>.actions | list of string | |
<name>.state | propMap | |
<name>.scoring | expression | |
<name>.note | string |
automa
Type: map of names to object.
| Field | Type | Description |
|---|---|---|
<name> | object | |
<name>.when | expression | |
<name>.role | string | |
<name>.seat | expression | |
<name>.policy required | string | procedure that takes the automa's decisions |
<name>.decider | expression | |
<name>.deck | string | |
<name>.note | string |
modifiers
Type: list of modifier.
modules
Type: map of names to object.
| Field | Type | Description |
|---|---|---|
<name> | object | |
<name>.name | string | |
<name>.activatedBy | string | |
<name>.actions | map of names to action | |
<name>.triggers | the same as triggers | |
<name>.modifiers | list of modifier | |
<name>.setup | effects | |
<name>.scoring | any value | |
<name>.note | string |
communication
Type: object.
| Field | Type | Description |
|---|---|---|
default | one of free, none, limited | |
phases | map of names to one of free, none, limited | |
signals | list of string | |
note | string |
loadout
Type: object.
| Field | Type | Description |
|---|---|---|
props | propMap | |
from | string | |
validate | expression | |
default | any value | |
note | string |
campaign
Type: object.
| Field | Type | Description |
|---|---|---|
state | propMap | |
carryOver | list of string | |
reset | list of string | |
content | object | |
unlocks | list | |
note | string |
timers
Type: map of names to object.
| Field | Type | Description |
|---|---|---|
<name> | object | |
<name>.seconds | expression | |
<name>.segments | expression | |
<name>.onExpire | effects | |
<name>.note | string |
options
Type: map of names to object. Table options and house rules: each overrides one const. Rated play may allow only some.
| Field | Type | Description |
|---|---|---|
<name> | object | |
<name>.label | string | |
<name>.type required | one of int, bool, enum | |
<name>.default required | any value | |
<name>.min | integer | |
<name>.max | integer | |
<name>.values | list | |
<name>.const required | string | the const this option overrides |
<name>.rated | boolean | whether a non-default value is allowed in rated matches |
<name>.note | string |
ruleset
Type: object. Written by the composer, never by hand: the exact composition a match runs.
| Field | Type | Description |
|---|---|---|
base | string | |
expansions | list of string | |
options | object | |
hash | string | |
provenance | object | which expansion added, replaced or removed each item |
Definitions
Fields above link here for the shapes the schema shares between sections.
expr
Type: string or number or boolean or null or list.
propMap
Type: map of names to string or number or boolean, or object. Properties. Each property's name and type.
board
Type: object. It may also hold keys the schema doesn't list, which the schema doesn't check.
| Field | Type | Description |
|---|---|---|
kind required | one of grid, graph, slots, track, hexGrid, squareGrid, tiles, rings, regions | |
file | string |
effects
Type: list of effect.
effect
Type: object. Exactly 1 key. Keys match ^[a-z][A-Za-z]*$.
choiceStep
Type: map of names to object. Exactly 1 key.
| Field | Type | Description |
|---|---|---|
<name> | object | |
<name>.from | expression | |
<name>.options | expression | |
<name>.range | string | |
<name>.where | expression | |
<name>.when | expression | |
<name>.count | expression | |
<name>.optional | boolean | |
<name>.default | any value | |
<name>.suggest | one of cheapest, none | |
<name>.skipIfNone | boolean | |
<name>.fallback | string | |
<name>.minimalCover | expression | |
<name>.value | expression | |
<name>.sequential | boolean | |
<name>.label | string | |
<name>.decider | expression | |
<name>.secret | boolean | |
<name>.min | expression | |
<name>.max | expression | |
<name>.distinct | boolean | |
<name>.note | string |
combinator
Type: object. It may also hold keys the schema doesn't list, which the schema doesn't check.
| Field | Type | Description |
|---|---|---|
sequence | list of combinator | |
chooseOne | list of combinator | |
anyOrder | object | |
optional | any value | |
repeat | object | |
call | any value | |
effect | effects | |
window | string | |
when | expression | |
choose | list of choiceStep |
action
Type: object.
| Field | Type | Description |
|---|---|---|
params | propMap | |
anytime | boolean | |
window | string | |
before | effects | |
choose | list of choiceStep | |
require | expression | |
postcondition | expression | |
do | combinator | |
effect | effects | |
resolve | one of atomic, bestEffort | |
actor | expression | |
limit | string | |
free | boolean | |
windows | list of string | |
blockedDuring | list of string | |
role | string | |
note | string | |
label | string |
flowNode
Type: object.
| Field | Type | Description |
|---|---|---|
phase | string | |
do | effects | |
turns | object | |
turns.order | object | |
turns.order.from | expression | The seat taking the first turn: an expression such as firstPlayer or seat(white). |
turns.order.direction | one of clockwise, counterclockwise, alternate | |
turns.order.list | expression | |
turns.order.sides | list of string | |
turns.order.alternate | boolean | |
turns.order.next | expression | Recomputed after every turn; returns the seat that moves next. |
turns.order.by | string | a track or zone whose order is the turn order |
turns.budget | expression | |
turns.actions | list of string | |
turns.eachAction | object | |
turns.turn | combinator | |
turns.afterTurn | effects | |
turns.endOfRound | effects | |
turns.onNoLegalAction | effects | |
turns.until | expression | |
turns.seats | expression | |
turns.note | string | |
turns.pass | string | |
turns.steps | list of flowNode, or effect | |
simultaneous | object | |
simultaneous.seats required | expression | |
simultaneous.action required | string | |
simultaneous.mode required | one of snapshot, sequential | |
simultaneous.reveal | one of afterAll, immediately, never, anonymous | |
repeat | object | |
repeat.var required | string | |
repeat.values required | expression | |
repeat.steps required | list of flowNode | |
window | object | |
window.id | string | |
window.seats required | expression | |
window.order | expression | |
window.actions required | list of string | |
window.close | one of allPassConsecutively, eachOnce, firstPass | |
window.note | string | |
parallel | object | |
parallel.seats required | expression | |
parallel.actions required | list of string | |
parallel.done | string | action that ends a seat's part |
parallel.until | expression | |
parallel.note | string | |
roleTurn | object | |
roleTurn.seat required | expression | |
loop | object | |
loop.until required | expression | |
loop.steps required | list of flowNode | |
loop.maxIterations | integer | |
when | expression | |
note | string | |
realtime | object | |
realtime.seats required | expression | |
realtime.actions required | list of string | |
realtime.timer | string | id of a timer declared under timers |
realtime.done | expression | |
realtime.until | expression | |
realtime.onStop | effects | |
realtime.ordering | one of serverArrival | Actions from all seats are logged in the order the server accepts them; each is validated against the state at that point, so a lost race is a rejected action. |
realtime.note | string | |
anchor | string | A named point in the flow where expansions may insert nodes. Does nothing by itself. |
modifier
Type: object.
| Field | Type | Description |
|---|---|---|
id | string | |
when | expression | |
scope | expression | |
target required | string | |
match | expression | |
op required | one of add, multiply, set, min, max, forbid, allow, replace | |
value | expression | |
duration | one of whileActive, permanent, untilRemoved, thisTurn, thisRound, thisPhase, thisAction, untilConsumed | |
from | one of now, nextTurn, nextRound | When the modifier starts to apply, counted from when its source became active (the effect that created it, or the ability or component it belongs to; for a match over abilities, each matching ability). nextTurn: from the start of the owner's next turn. Default now. |
source | string | |
priority | integer | |
note | string |