Families on Shared Plugins

A family does not need a plugin of its own. Its rulebook can name the plugin that plays it, and declare the keys that plugin reads. Dou Shou Qi is ranked pieces on terrain, which the chess plugin already reads; a second plugin would be the chess plugin twice.

Naming the plugin

engine:
  plugin: chess
  plugins:
    dou-shou-qi:
      ranks:
        order: { rat: 1, cat: 2, ..., elephant: 8 }

gen-family-defaults.mjs carries the name into play/family-defaults.json, and the engine hands the family to that plugin. No family name is written in code.

Which family uses which

PluginFamilies
ChessDou Shou Qi, Surakarta, Agon, Tafl
DraughtsFanorona
RaceRoyal Game of Ur, Senet, Nyout, Pachisi, Chaupar
HopHalma, Stern-Halma, Asalto

Chess plugin keys

KeyMeaning
ranksCapture by rank, with also and never exceptions (Dou Shou Qi)
terrain.weaken, terrain.noCaptureAcrossA region that changes a piece's rank; a region whose edge no capture may cross
regionsNamed cells, rows, columns, rings from the centre, or {{ not: [...] }}
{{ type: cross }}A leap over a region to the first cell beyond it (the river jump)
{{ type: rail }}A capture along the lines through a board's arcs (Surakarta)
inwardA step that never ends further from the centre (Agon)
custodialCapture by enclosing, with hostile cells, line captures and an enclosed king (Agon, Tafl)
capturesTo: owner, dropRegions, dropFirstA captured piece returned by its owner, where its type may go, in order
goalA piece reaching a region, any piece, or one escorted by its own
quietLimit, loseWithoutA quiet stretch decided on material; a seat that loses without a given piece

Draughts plugin keys

KeyMeaning
captureMethods[approach, withdrawal]: capture a whole line by moving toward or away from it (Fanorona)
chain{{ optional, revisit, repeatDirection }}: a capture chain with a memory of where it has been

Topology keys

KeyMeaning
Grid arcsPairs of edge points joined round the outside of the board (Surakarta's loops)
Graph structure: star, grid-crossBoards generated with their points on a lattice, so lines and jumps run straight