ParlorNet
Turn-based game server for any computer, old or new
Clients | Protocols | Browsers | Telnet programs | Docs | Source

backgammon/1 (draft)

Two players. Server rolls all dice. Flags: staged. Rulesets: standard (nackgammon and hypergammon are not offered). Options: cube=0|1 (default 1), match=n (a match to n points, 1-99; default 0, a single money game). The time per turn is the server's turn= (protocol.md).

Geometry

Static geometry (flag G): BRD 24, the number of points.

Absolute points 1-24. Seat 0 moves from 24 down to 1 and bears off from 1-6; seat 1 moves 1 up to 24 and bears off from 19-24. A client may flip or mirror for display; the protocol never does.

View lines

LineMeaning
P 1 c1 ... c12Checkers on points 1-12. Signed: positive = seat 0's, negative = seat 1's, 0 empty.
P 13 c13 ... c24Points 13-24, same form.
B n0 n1Checkers on the bar, per seat.
O n0 n1Checkers borne off, per seat.
D d d [d d]Dice still to play this turn (two, or up to four on doubles). Empty line D before rolling.
C value ownerCube: value 1-64, owner - (centered), 0 or 1.
W seatWhose turn it is (W - when the game is over).
Q phaseroll (cube available: send roll or double), move, take (answer a double), resign (answer a resignation), over.
N nSteps the roll requires this turn (the maximum-dice rule); 0 before rolling or when it is not a moving turn.
DR d dThe dice rolled this turn (only after the roll; D shrinks as steps are played, DR does not).
CA a0 a11 if that seat may double when its turn starts: cube on, not the Crawford game, cube below 64, centred or owned by that seat.
L nMatch play only: the match length in points.
T seat pointsMatch play only: the score, one line per seat (the common T line).
G n [crawford]Match play only: the game number in the match; crawford in the Crawford game.
RS seat points kindWhile a resignation offered by seat is waiting for an answer: points and single, gammon or backgammon.

N, DR, CA, L, T, G and RS were added after the first draft; a client that does not know them can skip them. A full view is about 200 bytes.

Move tokens (one step each)

M lists legal single steps given the dice left, including the rule that the maximum possible dice must be played (bearing off the last checker counts as playing every remaining die) and the larger-die rule. When a turn begins, the server rolls and sends the event; a player with no legal step is passed automatically (PASS). After the last playable step MOV returns OK done; the client sends END (or UND to rethink). roll answers OK more (the turn goes on with the steps). CHK of an accepted step or answer answers OK with a word (ok, roll, double, take, drop, resign, accept, reject, end).

Events

Match play (match=n): a won game (by bearing off, a dropped double or an accepted resignation) gives WON seat points kind and SCORE s0 s1. Unless the match is decided, the next game follows in the same reply: GAME n [crawford], then OPEN, TURN, ROLL, STEPS. The table ends (END) only when a player reaches n; END then repeats the last game's result. The first match starts with GAME 1. The Crawford rule applies: no doubling in the game after a player first reaches n-1. Gammons and backgammons count in every game.

Size

Typical event 10-20 bytes; a turn with two dice is a roll event, a steps event and two steps, under 60 bytes. Worst-case view about 200 bytes.

Open

This doc on GitHub


 These pages cover every ParlorNet server. | Source code | ParlorNet is free software.