James Lileks tries out Inform, a software tool that lets you make interactive fiction, or “text-based adventure games”, in the gamer’s vernacular. Inform is said to be “based on natural language”, which caused me to raise an eyebrow, Spock-like, the moment I read it. Interactive fiction is still a game. The player does things, and the game world is altered in some way. They continue to alter the game world until the story reaches its conclusion. This sort of thing requires some sort of branching logic. If the player goes left, they end up in the library. Right, and they go to the observatory. Go down into the basement and get eaten by a grue. Whatever. There is no way around this: You need some sort of logic to govern this, and that means you need a programming language. This “based on natural English” stuff sounds like Inform is making promises it can’t keep, that the would-be author can program without learning a programming language.
James gave it a try. He wrote a short introductory paragraph and told Inform to do its thing. Here is how things went for him:
Not exactly interactive fiction style, I know, but it's been a while. I asked the game to process what I'd written, and it came up with the following error messages. It's like remarks on a freshman comp paper from a brilliant grad student who completely fried his brain with acid:
Problem. You wrote 'You've awakened in a dark hole' : but I can't find a verb here that I know how to deal with, so I am ignoring this sentence altogether.
Problem. You wrote 'You can't tell what smells worse - you or the pit you're in' : again, I can't find a verb here that I know how to deal with.
Problem. The sentence 'The floor is hard, but you can see the sky' appears to say two things are the same - I am reading 'floor' and 'hard' as two different things, and therefore it makes no sense to say that one is the other: it would be like saying that 'the chalk is the cheese'. It would be all right if the second thing were the name of a kind, perhaps with properties: for instance 'Dairy Products School is a lighted room' says that something called Dairy Products School exists and that it is a 'room', which is a kind I know about, combined with a property called 'lighted' which I also know about.
Problems occurring in translation prevented the game from being properly created. (Correct the source text to remove these problems and click on Go once again.)
Noted, pal. Delete from drive.
I don’t blame him for being irritated. I gave inform a try myself. It turns out you can’t just throw down some prose and expect a computer to intuit what to do with it. You have to define things as a “room” (which is any place, room-like or not, such as ‘Jail Cell’ or ‘Baseball Field’), an “item” (something that can be picked up) a “door” (something that connects two rooms) or a “container” (something which may contain items, which may or may not be openable and may or may not be locked). There are these distinct types of things. You define them and describe them in certain ways. If you fail to describe things the way Inform expects, it will fail and will not be able to turn your text into a game.
Programmers will instantly recognize this process: It’s called compiling. It’s the process that takes your computer code and turns it into an executable. If you do not follow the rules of the programming language you’re using, the compile will fail and the compiler will give you an error message instead of making a game. This is exactly what happened to James.
So Inform is sort of trying to pretend that it is not using a programming language. This “based on natural English” is misleading at best, sophistry at worst. It is using a programming language, but since it is “based on natural English” the rules of the language are murky and the compiler is easy to confuse. Consider:
The key to the computer room is an item. It is on the table. It can be taken. It unlocks the steel door. The description is “a small brass key with well-worn teeth”.
This is how you have to write. Whether or not this is “natural English” is arguable. I’ve never met anyone who talks this way. A human can parse this easily, but the compiler is going to go nuts. It’s going to see “computer room is an item” and think the computer room is an item on a table. It may see “It is on the table. It can be taken.” and think the table can be taken. Should the period at the end of the last sentence go inside or outside of the quotes? Correct grammer says inside, but since that text is echoed back to the player- often in another contex – you don’t really want a full stop there. Trying to write things so as to totally disambiguate your meaning is very hard, and even when done properly the compiler can still get confused. The compiler can misunderstand just about anything. I’m sure once you get the hang of it you’ll eventually intuit what will work and what won’t, but note that in the end it is the
author programmer doing the intuiting, not the compiler. The rules must be learned via trial and error.
Let’s compare this to a language I’m going to make up right now:
+declare item:"computer room key"
description="a small brass key with well-worn teeth"
This is what programmers are used to: symbols, assigning properties to variables, indentation. I submit that even for a non-programmer the above is no less readble than what you would need to write for Inform. Yes, it seems cryptic and daunting, but the system has clear rules that can be clearly defined for the programmer and understood. Inform has rules as well, but they are obscured and mysterious. Like a blind man describing an elephant, you must feel around and probe the thing many times until you begin to get a sense of how it is really shaped.
But in the end I think the goal of Inform – which I am guessing is to bring the power of programming to non-programmers – is a noble endeavor which is fundamentally flawed. Certainly there are brilliant people out there who have great ideas for interactive fiction but lack the ability to bring them to life. Putting the power of coding in their hands would be a boon to fans of IF. Currently IF is dominated by various horror and science fiction stories, with the occasional mystery thrown in for good measure. I’m betting this is because these are the sorts of things that programmers enjoy. If non-programmers had a way of realizing their vision, we might end up seeing IF romance novels, coming-of-age stories, character-driven historical fiction, and other things that just don’t naturally come from the minds of coders. As nice as this would be, I don’t think it can be done this way.
Inform tried to allow programming without the use of a programming language, and what they built is programming with a confusing language that has nebulous rules.
UPDATE: I should add: It doesn’t do what users hope it will do, but Inform is nonetheless a very admirable and fascinating project.
Silent Hill Turbo HD II
I was trying to make fun of how Silent Hill had lost its way but I ended up making fun of fighting games. Whatever.
WAY back in 2005, I wrote about a D&D campaign I was running. The campaign is still there, in the bottom-most strata of the archives.
What is Vulkan?
There's a new graphics API in town. What does that mean, and why do we need it?
Was it a Hack?
A big chunk of the internet went down in October of 2016. What happened? Was it a hack?
id Software Coding Style
When the source code for Doom 3 was released, we got a look at some of the style conventions used by the developers. Here I analyze this style and explain what it all means.