4. Check, playtest and build
Check the story for mistakes, read a playtest that plays it to an ending, and build it into a folder that opens from disk.
By the end of this step you'll have checked the story for mistakes, read a playtest that plays it to an ending, and built it into a folder you can open from disk.
Check the content
The CLI loads the game the way the page does and reports every mistake in its content. Run it in a second terminal, beside the dev server:
npm run checkIt prints No problems. To see a report, misspell a scene id. In src/story/opening.ts, change the keep choice's { scene: 'ch2.bus' } to { scene: 'ch2.buss' }, save, and run the check again:
content · scene ch1.stop · goes to unknown scene "ch2.buss"
1 problem.Each line says where the mistake is and what's wrong. The check also reports a misspelt choice in a chose, and a stat that a condition names but nothing declares. Change ch2.buss back to ch2.bus before you go on. ifloom check says what else it reports.
Playtest it
A playtest plays the game with nobody at the keyboard. It presses a choice on each screen, one it hasn't pressed before where it can, until the story starts over:
npm run playtestIt prints a row of numbers for each turn, with a column for each of the player's stats, then the scenes it opened and the commands the game refused:
turn warmth scenes refused
1 2 3 0The story never ends a turn, so the whole run is turn 1. The playtest shared the umbrella, paid the fare and waved the man in, so it opened three scenes and ended with a warmth of 2. It doesn't type, so it never gave a name, and the greeting line stayed hidden.
Every screen it saw is in playtest/run.txt, with the choice it pressed on each. The last screen is the warm ending:
== Turn 1
# The end
He turns out to live two doors down. He brings biscuits next time.
[>] Start again
> {"type":"choose","id":"again"}
a new game: the playtest stops hereThe playtest stops when Start again begins a new game. A refused command is a button the game offered and then wouldn't do, so the playtest fails when the refused column isn't 0. Playtest and snapshot from the command line runs one on every change.
Build it
Stop the dev server, then build the game:
npm run buildThe build writes the game into dist/ as one index.html, then checks that index.html loads its script and styles only from files beside it, which a page opened from disk needs. It prints the largest files with their sizes, and a line for each problem it finds. Open dist/ in your file manager and double-click index.html. The game runs from the file, with no server, because it loads nothing at runtime (Why IFLoom works this way).
Checkpoint
The built game opens from dist/index.html in your browser, at "Chapter one: the stop" (after New game in the React template). Type your name, share the umbrella and pay the fare, then wave the man in. The page shows "The end", and Start again takes you back to the stop.
What you built
You wrote a story in three chapters with two endings. It keeps a stat for how kind the player has been, greets the player by name, and remembers each choice to change the chapters that follow. You checked it, playtested it and built it into one folder that opens from disk.
Each piece has a how-to of its own for going further:
- Write a flowing scene, where the story carries on below the player's choice instead of opening another scene.
- Organise your game's files, to give each chapter a file of its own as the story grows.
- Ship your game, to put the folder online.
Build a small town, the other tutorial, adds locations, a clock and a character with plugins. Three shapes of game shows a longer novel built the way this story is, and the Explanation tab says how the engine, the plugins and your UI fit together.
Last updated on