Skip to content

Rules DSL

Every Arbitas game is one rules file, written in the Arbitas rules DSL: YAML for the game’s structure (its players, boards, pieces, turns, moves and scoring), with short C#-like expressions in quotes for its conditions and values. When you publish, Arbitas compiles the file into a deterministic engine that runs on the server and in every player’s browser.

actions:
mark:
choose:
- at: { from: "board.cells()", where: "pieceAt(at) == null" }
effect:
- create: { type: mark, props: { owner: self }, into: at }

That’s tic-tac-toe’s one move: choose an empty square, and put your mark on it.

The language is versioned, and each rules file says which version it’s written in, on its first line:

dsl: "1.1"

DSL 1.0 is frozen: what it accepts will keep working. Later 1.x versions only add to it. DSL 1.1 adds the bot heuristic and limits on how deep rules may nest and how much work one move may take. Files written for the drafts before 1.0 ("0.1" to "0.4") still load.

You write rules on your game’s Rules tab in the builder portal. The editor colors and completes expressions as you type, with each function’s documentation, and checks the file as you go, linking each problem to its line. A Visual mode beside the text edits the same rules through forms. You can also import a rulebook and let AI write a first draft for you to review.

The guide explains the language a step at a time:

  1. How rules work: state, zones and components, actions, the flow of turns, effects and expressions.
  2. Build tic-tac-toe: a complete game from an empty file, then extended into a match.
  3. Hidden information and randomness: hands, decks, secret choices, shuffles and dice.
  4. Scoring and game end: how a game ends and who wins.
  5. Hooks: the escape hatch for rules the language can’t express.
  6. Variants, options and expansions: one game, played several ways.
  7. The bot heuristic: game knowledge that makes the bots play better.

The reference is generated from the language’s own definitions each time this site is built, so it always matches what the checker accepts:

Every complete example in this guide passes the checker and plays to the end on the engine.