Play Books Atlas

Play a gamebook

Any dungeon or gamebook in the collection, played in the browser with an adventure sheet and dice under the Kidaneland rules. Every book is checked against the gamebook/1 format first, so the same page can test what a model writes.

Rules of play, in short

Roll SKILL (one die + 6), STAMINA (two dice + 12) and LUCK (one die + 6). These are your initial scores; STAMINA never rises above its initial value except by the book's say-so.

Fights. Each round you and your foe roll two dice and add SKILL to find your Attack Strength; the higher wounds the other, and a tie is a parry. Your weapon tier adds to Attack Strength and sets the damage (tier 2, a soldier's sword, does 2). A wounded side wearing armour rolls one die: equal to or under the rating, the wound does 1 less, never less than 1. After a wound you may press your luck: lucky, your blow does 2 more or theirs 1 less; unlucky, the reverse. Fighting several foes together, you pick one each round, and any other who beats your Attack Strength wounds you.

Tests. Test your Luck: two dice, equal to or under LUCK; LUCK falls by 1 each time. Test your Skill: two dice plus any modifier, equal to or under SKILL. Persuade: as Skill, but a double six insults them. Intimidate: equal to or under SKILL plus half your SHADOW, and you gain 1 SHADOW whatever happens. Deceive: as Luck.

The rest. A meal restores 4 STAMINA. HONOUR and SHADOW run from 0 to 12; at SHADOW 12 the Worm's marrow claims you. The purse counts crowns and shillings (10 shillings to the crown) or, in the dungeons, gold pieces. The full rules are on the Rules page.

The gamebook/1 format

The gamebook/1 format

A gamebook is one JSON object: a title page, a starting character, and numbered sections that send the reader to other sections. It is the format the Play page (site/play.html) runs and validates, and the format a model is asked to write. gamebook.schema.json is the same thing as a JSON Schema; tools/validate_gamebook.py checks a file from the command line.

{
  "schema": "gamebook/1",
  "title": "Spires of Winedihul",
  "author": "Kidaneland project",
  "licence": "Original, created for this project",
  "setting": "Kidaneland",
  "rules": "kidaneland",
  "currency": "cr",
  "intro": ["Rain has followed you all the way from Orcos.", "The Prince forbids anyone to enter the crypt."],
  "character": { "gold": 2, "provisions": 2, "weapon": 2, "armour": 2, "items": ["Sword", "Leather jack", "Lantern"] },
  "start": 1,
  "sections": [
    { "id": 1, "text": "A sign at the fork reads *GO BACK*.",
      "choices": [ { "text": "Take the left fork toward Litta", "to": 14 },
                   { "text": "Approach the spires through the forest", "to": 212 } ] },
    { "id": 14, "text": "An old woman holds out her hand.",
      "choices": [ { "text": "Give her 5 shillings", "to": 301, "if": { "min": { "gold": 0.5 } }, "effects": { "gold": -0.5 } },
                   { "text": "Try to frighten her", "test": { "stat": "intimidate", "pass": 88, "fail": 156 } } ] },
    { "id": 156, "text": "She is not an old woman at all.",
      "combat": { "foes": [ { "name": "CRYPT-WIGHT", "skill": 9, "stamina": 12 } ], "win": 240 } },
    { "id": 212, "text": "The forest closes over the road.",
      "test": { "stat": "luck", "pass": 77, "fail": { "stamina": -2, "note": "The marsh takes your boot.", "to": 77 } } },
    { "id": 260, "text": "You lead the children out into the rain.", "effects": { "honour": 2 }, "ending": "win" }
  ]
}

The book

FieldRequiredMeaning
schemayesAlways "gamebook/1".
titleyesThe book's title.
startyesThe id of the first section.
sectionsyesThe sections, in any order.
idnoA short slug, such as spires-of-winedihul. Defaults to one made from the title.
author, licence, source, settingnoShown on the title page.
rulesno"kidaneland" (the default: the rules below) or "none" (the book keeps its own score).
currencyno"cr" (the default: gold crowns, written with shillings as decimals, so 0.5 is 5 shillings) or any other label such as "gp".
intronoBackground shown on the title page: a string, or an array of paragraphs.
covernoA frontispiece plate for the title page, written like a section's art.
characternoStarting values, see below.
mapno{ "ascii": ["#..#", "..."], "legend": { "#": "rock" } }, shown under a spoiler. Add width, height, rooms ({id, x, y, w, h} in map cells, one per section) and corridors ({from, to, path: [[x, y], ...], secret, locked}) and the Play page draws a map that reveals each room as the reader enters it. The dungeon adapter fills these in.

The character

Every field is optional. The defaults are the Kidaneland rules.

FieldDefaultMeaning
skill"1d6+6"A dice expression or a number.
stamina"2d6+12"
luck"1d6+6"
gold10In the book's currency.
provisions5Meals. Eating one restores 4 STAMINA.
honour, shadow00 to 12.
weapon2Weapon tier 0 to 5: improvised, common, soldier's, fine, named, relic.
armour2Armour rating 0 to 5: none, padded, leather, mail, plate, steam harness.
items[]Starting items, as strings.

A section

FieldRequiredMeaning
idyesA positive integer, unique in the book. Ids need not be consecutive.
textyesThe entry: a string with blank lines between paragraphs, or an array of paragraphs. italic and bold are allowed.
titlenoA heading, for books that have them.
artnoAn ink plate shown above the text: a file name in site/assets/img/gamebooks/ (from world/art/gamebooks/), a path or URL, or { "file", "alt", "caption" }.
effectsnoApplied as soon as the reader arrives.
testnoOne test the reader makes here.
combatnoOne fight.
choicesnoWhere the reader can go next.
endingno"win", "death" or "end". The adventure stops here.

Play runs in this order: the text is shown, effects apply, then the test, then the combat, then the choices. Every section needs at least one way on (a choice with to, a test outcome with to, a combat win) or an ending.

Effects

An object. Every key is optional; a book may combine them.

KeyValueMeaning
skill, stamina, lucknumber, or "max"Add the number (negative to lose), or restore to the initial score. STAMINA never rises above its initial score. At 0 the adventure ends.
gold, provisionsnumberAdd.
honour, shadownumberAdd. Both run from 0 to 12. SHADOW 12 ends the adventure.
add, removestring or arrayItems gained or lost.
flag, unflagstring or arrayRemember or forget something, for if conditions later.
notestringShown to the reader when the effects apply. Stat changes are reported automatically.

Conditions (if)

An object; every part must hold.

KeyValueMeaning
has, lacksstring or arrayItems the reader must carry, or must not.
flag, notflagstring or arrayFlags that must be set, or not.
min, max{ "gold": 5 }Lower or upper bounds on skill, stamina, luck, gold, provisions, honour, shadow.

A choice whose condition fails is shown greyed out with the condition, unless it has "hidden": true.

A choice

FieldRequiredMeaning
textyesWhat the reader does.
tousuallyThe section to turn to. May be omitted when the choice has a test (its outcomes say where to go) or only effects (the reader stays in the section).
ifnoA condition.
effectsnoApplied when the choice is taken.
testnoA test made when the choice is taken.
oncenotrue: the choice can be taken once in a section.
hiddennotrue: hide the choice while its condition fails.
notenoSmall print after the text, such as a condition the book does not enforce.

A test

FieldRequiredMeaning
statyes"luck", "skill", "persuade", "intimidate" or "deceive".
modifiernoAdded to the dice. Negative helps.
textnoWhat is being tested, such as "Test your SKILL to leap the chasm".
pass, failyesOutcomes.

An outcome is a section id, or an effects object that may also carry to. An outcome without to keeps the reader in the section, where the choices follow.

How tests work under the Kidaneland rules:

  • Luck: roll two dice; equal to or under LUCK passes. LUCK falls by 1 either way.
  • Skill: two dice plus the modifier, equal to or under SKILL.
  • Persuade: as Skill. A double six insults them: a fail.
  • Intimidate: two dice plus the modifier, equal to or under SKILL plus half SHADOW (rounded down). The reader gains 1 SHADOW whatever the result.
  • Deceive: as Luck, with the modifier.

A combat

FieldRequiredMeaning
foesyesOne or more foes: { "name", "skill", "stamina" } plus optional armour (rating 0 to 5), damage (default 2), attacks (rolls per round, default 1), first_round_bonus, min_weapon_tier (weaker weapons cannot wound it) and note.
modeno"sequence" (the default: one foe at a time) or "together" (the reader picks a foe each round; every other foe who beats the reader's Attack Strength wounds them).
winnoWhere to turn after winning. If omitted, the section's choices follow.
lootnoEffects applied on victory.
escapeno{ "to": 14, "cost": 2 }: the reader may flee, losing cost STAMINA (default 2).
afterno{ "rounds": 3, "to": 40 }: after that many rounds the fight stops and the reader turns to to.
textnoA line shown above the fight.

How a fight works: each round both sides roll two dice and add SKILL to find their Attack Strength. The reader adds the weapon's attack bonus (tier 0 to 5: −2, −1, 0, +1, +2, +3). The higher wounds the other; equal, nothing happens. The reader's wound does the weapon's damage (tier 0 to 5: 1, 2, 2, 3, 3, 4); a foe's wound does its damage. Whoever is wounded and wears armour rolls one die: equal to or under the rating, the wound does 1 less, never less than 1. After a wound the reader may test their Luck: lucky, their wound does 2 more or the foe's 1 less; unlucky, their wound does 1 less or the foe's 1 more. At STAMINA 0 the reader is dead.

Endings

"win" for the book's good ending, "death" when the reader dies, "end" for any other stop. The Play page also ends the adventure when STAMINA reaches 0 or SHADOW reaches 12.

The same book as numbered text

A model can write a book as plain numbered text instead of JSON; the Play page's Paste book box and node tools/gamebook_cli.js from-text turn it into gamebook/1, and to-text writes any book back out in the same form. Every sample book survives the trip with its structure unchanged. An excerpt (the sections it points to are left out):

SPIRES OF WINEDIHUL
===================

Children have been vanishing from the village of Litta...

You set out with Sword; Leather jack; Lantern. Your purse holds 2 cr. You carry 2 provisions.

Begin at 1.

1

A sign at the fork reads GO BACK.

Take the left fork toward Litta: turn to 14.

Leave the road and approach the spires through the forest: turn to 212.

14

An old woman holds out her hand.

If you have at least 5 sh, you may give her 5 shillings (Pay 5 sh): turn to 301.

You may try to frighten her. Test to intimidate. If you succeed, turn to 88. If you fail, turn to 156.

156

She is not an old woman at all.

CRYPT-WIGHT   SKILL 9   STAMINA 12

If you win, turn to 240.

260

You lead the children out into the rain. Gain 2 HONOUR.

You have succeeded. THE END.
  • A section starts with its number alone on a line, after a blank line. Each choice is its own paragraph.
  • A plain choice is an action, a colon and turn to N; changes it makes go in brackets before the colon.
  • Conditions open the line: If you have the Bone key, you may…, If you remember the word DROWNED-STAIR, you may…,

If you have at least 5 sh, you may…, If your SHADOW is 4 or more, you may….

  • A choice that tests begins You may…, then the test (Test your Luck, Test your Skill, or the words persuade,

intimidate or deceive), then If you succeed / are Lucky… and If you fail / are Unlucky…. An outcome may change scores before Then turn to N, or leave the reader in the section.

  • A choice that only changes things reads You may take the silver: if you do, add 1 cr 2 sh to your purse. Gain 1 SHADOW.
  • Changes use fixed verbs: Gain/Lose N SKILL|STAMINA|LUCK|HONOUR|SHADOW, Add/Pay N cr|sh|d, `Note the X on your

Adventure Sheet, Cross the X off your Adventure Sheet, Remember the word WORD`.

  • A foe is a line in capitals: NAME SKILL n STAMINA n (optionally ARMOUR n), then If you win, turn to N.,

and optionally You may escape at any time by losing 2 STAMINA and turning to N.

  • Endings: You have succeeded. THE END. (win), Your adventure ends here. (death), The end. (other).

The parser also reads the 500 dungeon texts in structured/maps/dungeons/text/ and most hand-written gamebook prose; what it cannot place, it reports as notes.

Canon, voice and playtest checks

Beyond the format, the Play page's validation panel and node tools/gamebook_cli.js check report:

  • Canon (books in Kidaneland money): names not found in the gazetteer, world.json or the guide; money that is not

crowns, shillings and pennies; foes whose SKILL and STAMINA don't match their Bestiary card or their stated tier; Honour and Shadow gains above the guide's 3 for one deed; prices far from the guide's price list.

  • Draft checks (each issue carries a code; aimed at the mistakes small models make):
  • same-outcome: a test whose success and failure go to the same place with the same effects, or two or more

choices that all lead to the same place with the same effects.

  • dup-choice: a choice that repeats the combat's own win or escape route, repeats the section's own test,

or repeats another choice's text and destination.

  • rules-in-prose: rule lines in the section text that belong in the objects: "Test your SKILL at +2" (warning),

"Test your SKILL" when the test is another stat or there is no test (warning), "Gain 1 HONOUR" with no effect that gives it (warning); a plain repeat of the test or of an effect the Play page already shows is a note.

  • price-mismatch: a price the reader is told to pay in the text ("Pay…", "you pay/spend", "costs you", "the price")

or named in a choice ("Buy rope (1 sh)") that differs from the gold the effects move. Money in prose is read as cr/crowns, sh/shillings and d/pennies, in figures or words, on the Shifton Standard: 1 cr = 10 sh = 100 d.

  • coin-format: crowns written as decimals in prose ("0.05 cr"); the house style writes "5 d".
  • foe-name: a combat foe whose name nearly spells a Bestiary card (edit distance 1 or 2, or every word close to the

card's words): use the card's name, and its scores if they differ. Plural cards match singular foes ("Hoarspine wolf").

  • honour-reason: Honour or Shadow given "for" a deed (in the text or the effect's note) that nothing else in the

section shows is a warning; an award in a section whose text names no deed at all is a note.

  • Warnings are what tools/gamebook_pipeline.py sends back to the model for fixing (with the code and the section

ids from where); notes are sent back only with --strict-voice.

  • Voice: sections with no "you" outside dialogue, first person, past tense, very long sentences, very short or

very long sections, "turn to" written into section text or choice text.

  • Playtest: a bot plays the book a thousand times with fresh characters (eating when hurt, fleeing losing fights,

preferring unseen sections, rarely taking an obvious way out) and reports win and death rates, the sections where players die, sections no play reached, plays that got stuck or looped, and how many fights were won.

What the validator checks

Errors stop a book from being played:

  • schema, title, start and sections are present and of the right type.
  • Section ids are positive integers with no duplicates, and every section has text.
  • start, every to, every test outcome and every combat win, escape and after point at a section that exists.
  • Every choice has text, and either to, a test or effects.
  • Every test has a known stat and both outcomes. Every combat has foes with a name, SKILL and STAMINA.
  • ending is one of the three values.

Warnings point at likely mistakes:

  • A section with no way on and no ending (a dead end).
  • Sections unreachable from start.
  • No ending reachable, or no "win" ending.
  • A choice that leads to its own section; a section whose choices all lead to the same place.
  • Items or flags a condition asks for that no effect ever grants.
  • Unknown fields, foe scores outside the usual range (SKILL 1 to 16, STAMINA 1 to 60), effects on stats that do not exist.
  • Very short sections (under 12 words) that are not endings.