Skip to content

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.

FieldTypeDescription
id requiredstringMatches ^[a-z0-9-]+$.
name requiredstring
players requiredobject
players.min requiredintegerAt least 1.
players.max requiredintegerAt most 16.
seats requiredobject
seats.topology requiredone of ring, ordered
seats.nameslist of string
seats.neutrallist of object
seats.neutral[].id requiredstring
seats.neutral[].whenexpression
seats.neutral[].controllerexpression
versionstringRuleset version (semver). Expansions declare which base versions they accept. Matches ^\d+\.\d+\.\d+$.

variants

Type: list of object.

FieldTypeDescription
[].id requiredstring
[].name requiredstring
[].whenexpression
[].requiredboolean
[].optionslist
[].defaultany value
[].overridesobjectReplace whole actions or named flow phases when this variant is on. Use when guards for one-line differences.
[].overrides.actionsmap of names to action
[].overrides.phasesmap 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.

FieldTypeDescription
<name>list of stringThe 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.

FieldTypeDescription
<name>objectComponent. A component type and its properties.
<name>.props requiredpropMapProperties. Each property's name and type.
<name>.publicPropslist of stringPublic properties. Properties everyone sees even when the zone hides the component's face, such as clue marks.

abilities

Type: map of names to object.

FieldTypeDescription
<name>object
<name>.paramspropMap
<name>.kind requiredone of passive, immediate, scoring, scoringChoice, endOfTurn, action
<name>.tradableboolean
<name>.effecteffects
<name>.scoreexpression

data

Type: map of names to object. Data tables. Tables of components: rows written in the rules, a file, or both.

FieldTypeDescription
<name>objectData table. One table of components.
<name>.ofstringComponent. The component type each row is.
<name>.filestringFile. A CSV or JSON file holding more rows.
<name>.notestringNote. A note for whoever reads the rules.
<name>.versionWithone of rules, componentsVersioned with. Whether the table changes with the components (the default) or only with a new rules version.
<name>.rowslist of objectRows. 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.

FieldTypeDescription
<name>objectZone. One place components can be. It may also hold keys the schema doesn't list, which the schema doesn't check.
<name>.kind requiredone of stack, set, cell, slots, track, list, bag, layoutKind. How the zone holds its components, such as a stack, a set or a board cell.
<name>.ofstringComponent. The component type the zone holds.
<name>.visibilityone of public, owner, hidden, countOnly, topPublic, faceDown, nobody, allButOwnerVisibility. Who can see the components in the zone.
<name>.perSeatbooleanPer seat. Whether each seat has its own copy of the zone.
<name>.knowledgeone of none, retainedOnPassKnowledge. Whether a seat keeps knowing a hidden component after passing it on, as when hands are passed.
<name>.onEmptyDrawobjectOn empty draw. What happens when a seat draws from the zone while it is empty.
<name>.layoutstringLayout. The layout of a layout zone's spaces.
<name>.capacityexpressionCapacity. The most components the zone can hold.
<name>.notestringNote. A note for whoever reads the rules.
<name>.keysstringKeys. What the zone is keyed by when there is one per key, such as an age.

state

Type: object.

FieldTypeDescription
globalpropMap
seatpropMap
campaignpropMap
sidepropMap
rolepropMap

functions

Type: map of names to object.

FieldTypeDescription
<name>object
<name>.params requiredpropMap
<name>.returns requiredstring
<name>.expr requiredexpression

procedures

Type: map of names to object.

FieldTypeDescription
<name>object
<name>.params requiredpropMap
<name>.do requiredeffects

setup

Type: effects.

history

Type: object.

FieldTypeDescription
positionKeylist
derivedobject

flow

Required. Type: list of flowNode. At least 1 item.

actions

Type: map of names to action.

triggers

Type: list of object.

FieldTypeDescription
[].event requiredstring, or list of string
[].whenexpression
[].crossesobjectFire 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 requiredexpressionThe value after the event.
[].crosses.deltaexpressionHow much the value changed. Defaults to event.delta.
[].crosses.threshold requiredexpression
[].crosses.direction requiredone of up, down
[].do requiredeffects
[].idstring
[].timingone of replace, before, after, afterAction
[].orderByone of activeSeat, owner, fixed, decider
[].limitstring
[].optionalboolean
[].ownerexpression
[].priorityinteger
[].notestring

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.

FieldTypeDescription
evaluate requiredexpression
scaleintegerAt least 1.
prefermap of names to expression

clock

Type: object.

FieldTypeDescription
supportedlist of one of suddenDeath, increment, delay, bronsteinDelay, perTurn
onTimeExpiredeffects

end

Type: object.

FieldTypeDescription
whenexpression
scoringany value
scoringChoiceslist
tiebreaklist of expression
shareTiesboolean
seatsexpression
hookslist of string
ratingone of elo, glicko2, openSkill, none
sidesboolean, or map of names to object
sides.<name>object
sides.<name>.winexpression, or list of expression
sides.<name>.loseexpression, or list of expression
sides.<name>.scoreexpression
instantWinsboolean, or list
notestring
checkAfterlist of one of action, step, phase, turn, round, effect

hooks

Type: map of names to object.

FieldTypeDescription
<name>object
<name>.kind requiredone of scoring, choiceGenerator, condition, effect, notation
<name>.signature requiredstring
<name>.notestring

sides

Type: list of object.

FieldTypeDescription
[].id requiredstring
[].membersexpression
[].outcomeone of shared, individual
[].shareKnowledgeboolean
[].notestring
[].hiddenMembershipbooleanMembership is projected only through the knownBy of the fields it is computed from.

roles

Type: map of names to object.

FieldTypeDescription
<name>object
<name>.namestring
<name>.sidestring
<name>.controlslist of string
<name>.whenexpression
<name>.setupeffects
<name>.flowlist of flowNode
<name>.actionslist of string
<name>.statepropMap
<name>.scoringexpression
<name>.notestring

automa

Type: map of names to object.

FieldTypeDescription
<name>object
<name>.whenexpression
<name>.rolestring
<name>.seatexpression
<name>.policy requiredstringprocedure that takes the automa's decisions
<name>.deciderexpression
<name>.deckstring
<name>.notestring

modifiers

Type: list of modifier.

modules

Type: map of names to object.

FieldTypeDescription
<name>object
<name>.namestring
<name>.activatedBystring
<name>.actionsmap of names to action
<name>.triggersthe same as triggers
<name>.modifierslist of modifier
<name>.setupeffects
<name>.scoringany value
<name>.notestring

communication

Type: object.

FieldTypeDescription
defaultone of free, none, limited
phasesmap of names to one of free, none, limited
signalslist of string
notestring

loadout

Type: object.

FieldTypeDescription
propspropMap
fromstring
validateexpression
defaultany value
notestring

campaign

Type: object.

FieldTypeDescription
statepropMap
carryOverlist of string
resetlist of string
contentobject
unlockslist
notestring

timers

Type: map of names to object.

FieldTypeDescription
<name>object
<name>.secondsexpression
<name>.segmentsexpression
<name>.onExpireeffects
<name>.notestring

options

Type: map of names to object. Table options and house rules: each overrides one const. Rated play may allow only some.

FieldTypeDescription
<name>object
<name>.labelstring
<name>.type requiredone of int, bool, enum
<name>.default requiredany value
<name>.mininteger
<name>.maxinteger
<name>.valueslist
<name>.const requiredstringthe const this option overrides
<name>.ratedbooleanwhether a non-default value is allowed in rated matches
<name>.notestring

ruleset

Type: object. Written by the composer, never by hand: the exact composition a match runs.

FieldTypeDescription
basestring
expansionslist of string
optionsobject
hashstring
provenanceobjectwhich 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.

FieldTypeDescription
kind requiredone of grid, graph, slots, track, hexGrid, squareGrid, tiles, rings, regions
filestring

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.

FieldTypeDescription
<name>object
<name>.fromexpression
<name>.optionsexpression
<name>.rangestring
<name>.whereexpression
<name>.whenexpression
<name>.countexpression
<name>.optionalboolean
<name>.defaultany value
<name>.suggestone of cheapest, none
<name>.skipIfNoneboolean
<name>.fallbackstring
<name>.minimalCoverexpression
<name>.valueexpression
<name>.sequentialboolean
<name>.labelstring
<name>.deciderexpression
<name>.secretboolean
<name>.minexpression
<name>.maxexpression
<name>.distinctboolean
<name>.notestring

combinator

Type: object. It may also hold keys the schema doesn't list, which the schema doesn't check.

FieldTypeDescription
sequencelist of combinator
chooseOnelist of combinator
anyOrderobject
optionalany value
repeatobject
callany value
effecteffects
windowstring
whenexpression
chooselist of choiceStep

action

Type: object.

FieldTypeDescription
paramspropMap
anytimeboolean
windowstring
beforeeffects
chooselist of choiceStep
requireexpression
postconditionexpression
docombinator
effecteffects
resolveone of atomic, bestEffort
actorexpression
limitstring
freeboolean
windowslist of string
blockedDuringlist of string
rolestring
notestring
labelstring

flowNode

Type: object.

FieldTypeDescription
phasestring
doeffects
turnsobject
turns.orderobject
turns.order.fromexpressionThe seat taking the first turn: an expression such as firstPlayer or seat(white).
turns.order.directionone of clockwise, counterclockwise, alternate
turns.order.listexpression
turns.order.sideslist of string
turns.order.alternateboolean
turns.order.nextexpressionRecomputed after every turn; returns the seat that moves next.
turns.order.bystringa track or zone whose order is the turn order
turns.budgetexpression
turns.actionslist of string
turns.eachActionobject
turns.turncombinator
turns.afterTurneffects
turns.endOfRoundeffects
turns.onNoLegalActioneffects
turns.untilexpression
turns.seatsexpression
turns.notestring
turns.passstring
turns.stepslist of flowNode, or effect
simultaneousobject
simultaneous.seats requiredexpression
simultaneous.action requiredstring
simultaneous.mode requiredone of snapshot, sequential
simultaneous.revealone of afterAll, immediately, never, anonymous
repeatobject
repeat.var requiredstring
repeat.values requiredexpression
repeat.steps requiredlist of flowNode
windowobject
window.idstring
window.seats requiredexpression
window.orderexpression
window.actions requiredlist of string
window.closeone of allPassConsecutively, eachOnce, firstPass
window.notestring
parallelobject
parallel.seats requiredexpression
parallel.actions requiredlist of string
parallel.donestringaction that ends a seat's part
parallel.untilexpression
parallel.notestring
roleTurnobject
roleTurn.seat requiredexpression
loopobject
loop.until requiredexpression
loop.steps requiredlist of flowNode
loop.maxIterationsinteger
whenexpression
notestring
realtimeobject
realtime.seats requiredexpression
realtime.actions requiredlist of string
realtime.timerstringid of a timer declared under timers
realtime.doneexpression
realtime.untilexpression
realtime.onStopeffects
realtime.orderingone of serverArrivalActions 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.notestring
anchorstringA named point in the flow where expansions may insert nodes. Does nothing by itself.

modifier

Type: object.

FieldTypeDescription
idstring
whenexpression
scopeexpression
target requiredstring
matchexpression
op requiredone of add, multiply, set, min, max, forbid, allow, replace
valueexpression
durationone of whileActive, permanent, untilRemoved, thisTurn, thisRound, thisPhase, thisAction, untilConsumed
fromone of now, nextTurn, nextRoundWhen 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.
sourcestring
priorityinteger
notestring