Brass Lantern
the adventure game web site


Introducing Inform 7

by Stephen Granade

There have been many specialty programming languages for writing interactive fiction. The programming directory of the IF Archive holds some fifty different languages and systems. Of them, Inform is one of the best known. Since its release on April 30, 1993, Graham Nelson's IF programming language has arguably become the most popular one.

There has been little change in Inform for nearly a decade. Inform 6, the last major update, was released on April 30, 1996. Changes since then have been incremental, with the language itself remaining stable for a decade.

That changed on April 30, 2006, when Graham Nelson released Inform 7. Inform 7, or I7, is a dramatic departure from what has come before. IF languages such as Inform 6, TADS, and Hugo are procedural, C-like languages, familiar to most any modern computer programmer. I7 doesn't take that approach. Instead, its language is based on English.

I'll pause a moment to let that sink in.

Rather than using a small set of terse programming directives as Inform 6 did, Inform 7 uses a subset of English, in an effort to make interactive fiction programming more accessible to writers who lack a computer programming background. For instance, the following I7 code creates a three-room house:

The Living Room is a room. "This is your living room, as featured in a number of games written by first-time interactive fiction authors." East is the Kitchen. North is the Bedroom.

I7 also deviates from the standard object-oriented approach to IF, where objects in the game are mapped to objects in code, and the interaction between objects is contained as code associated with the objects. Instead, I7 uses a form of logical programming, where you define rules that explain how the game world works and how objects interact. For example,

Instead of taking the fire, say "It would burn you."

This sets up a rule that, when the player tries to take the fire, they can't; instead, they're told that the fire would burn them. And if you just found yourself thinking, "Well, of course; that's obvious," then you've identified one of the selling points of I7.

Along with the language itself, I7 comes with a front-end development environment that introduces a number of extremely useful tools. For instance, the I7 front-end keeps track of what commands you typed every time you play through your game. It arranges all of those commands into a tree that branches at every point that you departed from previous run-throughs. Using the tree you can select a set of commands to re-run. This allows you to quickly and easily re-test portions of your game.

This article presents an overview of the I7 language and tools in some depth. It concludes with my thoughts on the strengths and weaknesses of I7. I intend this to give you a flavor of what I7 does to help you decide whether or not you'd like I7. I'm assuming you're familiar with interactive fiction and, to a certain extent, with interactive fiction programming. If you're a programming novice you can still learn from this article, but some of my references to programming conventions may not mean much to you.

Next | 1 | 2 | 3 | 4

About Us | Contact Us | Technical Info | History
Copyright © 1997-2010, Stephen Granade.