Saved playtests from your tools
A saved playtest is a recording of a game played on a draft in the portal’s Playtest: the seed, who played each seat, and every move. The portal saves them from a finished or stopped game, replays them on the current draft, and shows where a rules change makes a recorded game go differently. Your own tools can read and add recordings through the Builder API with an API key, for example to keep a set of recorded games in your repository and upload them for the team to replay.
The operations
Section titled “The operations”| Operation | Request | Key | What it does |
|---|---|---|---|
listPlaytests |
GET /v1/games/{gameId}/playtests |
read | A game’s saved playtests, without their moves |
getPlaytest |
GET /v1/playtests/{playtestId} |
read | One playtest, with its whole recording |
uploadPlaytest |
POST /v1/games/{gameId}/playtests/uploads |
build | Adds a recording a tool wrote, or one downloaded from another game |
savePlaytest |
POST /v1/games/{gameId}/playtests |
build | Saves a recording, as the portal does when a playtest ends |
renamePlaytest |
PATCH /v1/playtests/{playtestId} |
build | Renames one |
deletePlaytest |
DELETE /v1/playtests/{playtestId} |
build | Deletes one |
Each saved playtest has an ID (pts_…) and a summary: its name, the draft revision and rules hash it was played on,
its players and number of moves, whether the game ended, whether it was saved or uploaded, and who saved it (a builder
or an API key). Saved playtests belong to the game, and everyone in the organization sees them.
The recording
Section titled “The recording”A recording is one JSON document, the same file the portal’s Saved games page downloads and uploads. Its full shape is
PlaytestRecording in the Builder API reference.
{ "format": "arbitas.playtest.v1", "name": "Corner opening", "draftRevision": 7, "rulesetHash": "3f5c…", "seed": 1234, "players": 2, "seats": [ { "seat": 0, "controller": "builder" }, { "seat": 1, "controller": "searchBot" } ], "moves": [ { "seat": 0, "move": { "action": "place", "choices": [{ "step": "cell", "value": "a1" }] } }, { "seat": 1, "move": { "action": "place", "choices": [{ "step": "cell", "value": "b2" }] } } ], "ended": false}| Field | What it holds |
|---|---|
format |
Always arbitas.playtest.v1 |
name |
1 to 100 characters |
draftRevision |
The draft revision it was played on |
rulesetHash |
The SHA-256 of the rules text it was played on, as 64 hex digits |
seed |
The match’s seed, from 0 to 4,294,967,295 |
players |
How many seats, 1 to 16 |
seats |
One entry per seat, in order from 0: who played it (builder, searchBot or botFile) |
moves |
Up to 5,000 moves in order: the seat, and the move’s action and choices |
ended |
Whether the game reached its end (optional) |
Each move may also carry hash, the state’s hash after the move, which the portal writes and checks when it replays.
A tool that doesn’t run the engine leaves it out. The recording doesn’t hold the rules themselves: they’re named by
rulesetHash and draftRevision, and a replay plays the recorded moves on the game’s current draft.
A recording can be up to 1 MiB; a bigger one is refused with 413. The game a recording names is replaced by the game
you upload it to.
Upload one
Section titled “Upload one”curl -X POST "https://build.arbitas.dev/v1/games/$ARBITAS_GAME/playtests/uploads" \ -H "Authorization: Bearer $ARBITAS_TOKEN" \ -H "Content-Type: application/json" \ --data @corner-opening.playtest.jsonIt answers 201 Created with the summary. It’s refused with 400 validationFailed when the recording doesn’t match
the format: for example when seats doesn’t list exactly players seats in order, or a move names a seat the game
doesn’t have.
Replay it
Section titled “Replay it”Open the game’s Playtest in the portal and the recording from Saved games. The portal plays it on the current draft with the same seed and moves. If the rules have changed since, it says so, and names the first move the new rules don’t accept or where the game goes differently. You can step through the moves, and play on from any of them.