Chapter 13: Testing and Publishing
§13.1. Testing; §13.2. Publishing
|Contents of The Inform Recipe Book|
|Chapter 12: Typography, Layout, and Multimedia Effects|
|Indexes of the examples|
There are no recipes for testing, alas, although most experienced IF authors have their preferred ways of going about it. Briefly: the best advice is to build and maintain a Skein which holds complete play-throughs of the piece, so that it is easy to check with a single click that all is still well; to have beta-testers who play through (substantial) drafts and send back their transcripts of play, along with suggestions; and to listen to these suggestions, and treat the beta-testers as editors rather than galley slaves.
Alpha shows a way to gracefully accept beta-testers' annotations without advancing time in the game.
Most large works of IF have historically provided secret commands for testing and debugging - commands removed (or sometimes accidentally not) in the final released product. Inform does this automatically: the commands SHOWME, ACTIONS and SCENES are always present except in a released story file. It also allows us to write passages of source text which apply only for the testing phase, so that we can define new testing commands, or other checks that all is well: Bic demonstrates this, and is also useful in its own right.
|Start of Chapter 13: Testing and Publishing|
|Back to Chapter 12: Typography, Layout, and Multimedia Effects: §12.5. Glulx Multimedia Effects|
|Onward to §13.2. Publishing|
It may occasionally be useful to check whether all objects in our game have a given property. Here we have a "not for release" section that will run at the start of the game and alert us to any objects lacking description:
Section 1 - Testing descriptions - Not for release
When play begins (this is the run property checks at the start of play rule):
repeat with item running through things:
if description of the item is "":
say "[item] has no description."
Section 2 - Story
The Staff Break Room is a room.
The player carries an orange, a Bic pen, and a napkin. The description of the orange is "It's a small hard pinch-skinned thing from the lunch room, probably with lots of pips and no juice."
The description of the napkin is "Slightly crumpled."
Sometimes we want to let testers of a game insert their own comments during a transcript, without those comments wasting turns of the game or producing lengthy or inappropriate parser errors. Many testers have a habit of prefacing comments with a punctuation mark, so let's say that we'd like to catch any command that starts with any punctuation at all:
When play begins:
say "Hi, Larry! Thanks for testing my game!!"
Unimplemented Room is a room. "Room description goes here..."
The scary troll is a man in Unimplemented Room.
After reading a command (this is the ignore beta-comments rule):
if the player's command matches the regular expression "^\p":
reject the player's command.
Test me with "x me / x troll / !this game is a bit dull so far / kiss troll / ? does this troll do anything? / :yawn".