9 features you may not know about in OS X Inform

While developing the Inform 7 IDE, many features were added to make developing a game smoother. This article lists some of the features that you may not have spotted.

Automatically number headings

Inform has a few features to help you manage the numbering of your section headings. One of these is the 'renumber all sections' option, found in the Format menu. If you've given your headings numeric values, this will renumber them so that they are all sequential.

Inform can also automatically assign numbers to headings as you type them in. You'll need to turn on the 'Auto-number sections' option in the Intelligence preferences:

Turning on auto numbering

Once you have done this, whenever you type in the start of a heading - for instance by typing 'Volume ' at the start of a line - Inform will fill in the next number for you. If you add a new heading in the middle of your code, it will also automatically renumber all of the following sections.

Navigate headings

Finding your way around a large source file can be tricky. The Contents tab of the index can help you a bit, but it is only updated whenever you compile the source and so can rapidly get out of date. To counter this, Inform has a headings navigator that appears in the Source tab:

Clicking on this drops down a window listing all of the headings near to the current cursor location. This is not quite a drop-down menu - the standard menu system is not very good at dealing with the deep structure that a large game often develops:

You can click one of the headings to go straight there. Only the 'nearby' headings are listed, so if you've built up a complicated structure of volumes, chapters and sections you'll only see a small portion of your source here. In the example above, the cursor is in a section in the State Rooms chapter of Bronze, so only the sections in that chapter are shown.

You can click in the breadcrumb at the top of the drop-down window in order to navigate to a wider view of the headings. For example, if you click on 'World', you'll see the chapters underneath that part of the source:

When there is an arrow to the right of a heading, you can click it to see the sections that it contains.

Play all blessed

One of the toughest parts of developing any software is ensuring that it is well tested before release. Interactive Fiction is no exception: to release a really good quality game, you have to check every path through the game, including the dead-ends and you need to recheck any bugs reported by your beta-testers. Previously you had to do this manually, or mess around with transcripts and recordings.

Inform 7 takes the tedium out of doing this. While you are writing your game, you should 'bless' any important points in your game using the transcript. How you do this is up to you, but I would suggest having at least one blessed knot in the transcript for every long piece of text in the game, each stage in a puzzle and for every reported bug that you've fixed. Setting up a comprehensive transcript will tell Inform how you think that your game should be working.

When you are preparing to release your game, you can revisit every blessed node in the transcript by using the 'Play All Blessed' feature, found in the Build menu or the panel bar for the skein tab. This will play your game multiple times and cause it to revisit every blessed knot at least once. You can look for knots that have changed in the skein by looking for the red 'badges'. Clicking a badge will take you to the item in the transcript, with the items highlighted. You'll find that either Inform has detected a bug in your game, or that you want to bless the new text for the item.

You can also skip through all of the differences using the 'Next difference in skein' option from the Transcript menu (cmd+opt+ctrl+down arrow).

Edit the transcript

This is a simple but powerful feature: you can click in the right side of the transcript and edit the 'blessed' text for a knot. This is useful when you know what the game's output should be but you haven't yet written the code.

This is also useful when you want to review and edit your games output without being distracted by the actual code that implements it. You can edit large sections of game text until it reads how you want it to, then edit the code and use the 'Play All' feature to repeatedly play through the game until it plays just how you want it to.

Skein labels

By clicking the blue 'note' icon on a skein knot (the leftmost in the set surrounding knot), you can apply a label to it that will make it easier to find using the 'Labels' drop-down in the panel bar.

Use this to mark important points in the game: the knot at the end of your preferred solution or the beginning of important scenes for example. Note that in general it is more useful to label items deep down in the skein than items towards the top.

The inspector

You can display a floating window of inspectors through the Window menu or by pressing cmd+opt+I. These provide you with a place to jot down quick notes associated with the project, a way to look at the skein without having to switch to the skein tab, an alternative way to navigate the headings in your game and more options for searching.

If you're writing an Inform 6 game, you'll also find the file manager and the debugging options here.

Deal with player transcripts

Something that's quite hard to deal with when beta-testing is finding out exactly what a player did to provoke a particular bug. Inform has a feature that can make this much easier: using the File menu you can import game recording files or skein files saved by an interpreter.

A player can generate a recording file by typing 'recording on' as their first move in a game: this will cause it to save out a file containing each move they make. When they want to send a bug report, they can send this to you, and you can import it directly into the skein and play the exact moves that the tester was using.

If your beta tester is using Zoom, things are even better. Zoom records player moves all the time regardless of whether they typed 'recording on' or not. For Z-Code games it can even preserve them if the player saves the game and restores it later on. There are options in Zoom's file menu to save out recording files in the formats that Inform understands. Inform can also extract the information directly from a save game produced by Zoom.

Navigate with the keyboard

We often improve Inform's keyboard navigation abilities with each release. There are a few keyboard shortcuts that you may not be aware of, which can make developing games a lot quicker.

Firstly, you can use the function keys to switch between tabs. You can also use cmd+3 to cmd+9 to switch directly to specific tabs in the index. You can switch between the left and right panels by using cmd+1 and cmd+2. Finally, you can use cmd+- and cmd+= to move forwards and backwards in the history for a panel.

Write Inform 6 games

If you have an existing Inform 6 work, or want to start a new one, the OS X IDE can accommodate you. Inform 6.3 projects are available under the 'New Project' wizard.

When developing Inform 6 games you have access to a few features not appropriate for Inform 7 games: you can use the File Inspector to manage many files, you can change the library that you are using, you can even compile your own version of the Inform compiler and use that instead. Finally, you get access to Zoom's symbolic debugger when writing Z-Code games and can inspect the values of your games variables as it runs.