Skip to content

Reference: Shorthand and legacy keys

The engine normalizes several shorthand forms and legacy keys so you can write less JSON. These are applied during expand-game-rules before the game runs.

Key renames

You writeBecomes
thatMatchesconditions (value used as the single element or array of conditions)
entityTypetype (on entities)
moveTypetype (on moves)
endConditionsendIf

So you can use endConditions instead of endIf, and thatMatches instead of conditions when there’s only one condition or you pass an array.

Condition shorthands

When a condition value is a string, it is replaced as follows:

StringExpands to
isCurrentPlayerIs condition with matcher player from ctxPath currentPlayer
isEmptyNot condition wrapping a single Contains condition

So you can write thatMatches: "isCurrentPlayer" or "isEmpty" instead of the full condition object.

Result shorthand

You writeExpands to
ownerOfFirstResultEntitycontextPath into results, first match, first entity, attributes.player

Used in endIf when the win comes from a HasLine (or similar) condition: the winner is the owner of the first entity in the first match. So you can set result winner to "ownerOfFirstResultEntity" instead of writing the long contextPath.

Single condition to array

If you pass a single condition object where an array is expected (e.g. conditions), the engine wraps it in an array. So thatMatches with an array like "type": "Space" and "isEmpty" is valid.

Default condition type: Is

If an object in a conditions array has no conditionType, the engine sets conditionType to "Is" and uses the object as the matcher. So you can write a single object with type: "Space" instead of wrapping it in an Is condition with matcher.

target as string

If target is a string (e.g. "mainGrid"), it is expanded to an Is condition with matcher name equal to that string.

So you can write target: "mainGrid" in conditions that accept a target.