Some useful Inform 7 extensions

Very often I turn transcripting on when I start playing IF. As a side effect Zoom automatically runs the command VERSION, which in case of Inform 7 games shows the list of extensions the game uses. More often than not the list is empty.

I'm a big fan of extensions. Creating an IF game takes enough time as it is, so any way of avoiding reinventing the wheel someone has already invented and made public is a big plus. Extensions don't get enough use, and I'm not alone with this opinion: Aaron Reed has called for more exposure, including blogging about the best ones. I'll take a head start by introducing some of my own favorites.

Epistemology by Eric Eve

By far the most useful extension I've yet found. The first thing I do every time I start a new project is including this extension because it will almost certainly be used.

Epistemology adds two properties to every thing in the game: seen/unseen and familiar/unfamiliar. Every object starts as unseen and when the player encounters things (is in the same room or looks in the container where the object is) they automatically change to being seen. The familiar/unfamiliar property is what the author can toggle when needed if the player character already knows about something or learns about it during the game. The author can test whether a thing is either seen or familiar by checking if it's known or unknown.

The most obvious use is for an ask/tell conversation system: you can prevent the player from asking about things that the player character would not yet know about by defining the action as "ask [person] about [any known thing]".

In addition you should consider using the [any known thing] token every time when an action allows any noun to be used (not only those in scope). Let's say you want the player to be able to get more information about NPCs by commanding WHO IS. You've implemented the command with the grammar line "who is [any person]". You don't want the player to ask about John Q. Public, who is the surprise villain of your game. So you write something like this:

Check asking who John Q Public is:

if John Q Public is not revealed:

say "You don't know who that is." instead.

That works well when the player refers to John Q. by his full name, but now disambiguation can give the surprise away:

>WHO IS JOHN

Who do you mean, John Doe or John Q. Public?

It's better to use "who is [any known person]" to avoid the disambiguation mechanism revealing things the player shouldn't know about.

Far Away by Jon Ingold

Far Away provides the adjective "distant" which simply puts things out of the player's reach. Anything except examining (and other actions that do not require touch) will be blocked with a "you can't reach it" message.

Far Away is most useful for filling in scenery items mentioned in room descriptions. You can create the item, give it a description, make it distant, and then just forget about it. No need worrying whether touching the sun or taking the clouds gives a reasonable response -- the response is always the "can't reach" one.

Object Response Tests by Juhana Leinonen

There's a reason other than shameless self-promotion for this extension to be on this list. The amount of verbs in the standard library is huge and testing each object against each verb is a staggering task. Object Response Tests allows you to try every available verb on one item with a single command. You can scan the output for unsuitable responses, like "You feel nothing unexpected" when the player types TOUCH THE FIRE.

You can also try a single verb on all objects in scope, or all verbs on all objects at once. Any custom commands in the game can be added to the testing batch, or disabled commands removed from it. Testing commands are disabled in the released game.

The extension is not a replacement for proper testing done by humans, but it will help catch some of the cases easily missed by testers.

Disambiguation Control by Jon Ingold

Another one of Jon Ingold's extensions, Disambiguation Control, completely replaces the default disambiguation mechanism. It's a tinkerer's dream: in addition to improving the parser's functionality in general, you get to define the parser's disambiguation preferences to whatever you want.

In contrast to the extensions mentioned before, this is not one that I'd recommend to everyone. I7's own disambiguation engine works fairly well in most cases. Disambiguation Control requires a relatively large amount of learning to use efficiently. It will also potentially increase the author's work because it adds new layers and options to the mechanism that by default does everything more or less automatically. Nevertheless if you find yourself thinking the standard parser's disambiguation should be smarter or hoping for more control over disambiguation choices, this is the extension for you.

One thought on “Some useful Inform 7 extensions

  1. Epistemology is indeed wonderful. I relied on it heavily -- indeed on Eric's whole wonderful TADS 3-like conversation system -- in developing The King of Shreds and Patches. Far Away is also incredibly useful in modeling a coherent world. Matter of fact, I think a "distant" property should probably come with Inform 7 out of the box. It would prevent a whole lot of inappropriate responses.

    Just as a side note, it's not Zoom that's running a Version command when you start a script. That behavior is actually built into the Inform library, and so will occur on any interpreter.

Comments are closed.


Did you find this article useful? By subscribing to the blog's mailing list you will receive an email whenever a new blog post is published. The address won't be used for any other purposes.