Text adventure games are an interesting branch of the extremely varied tree of videogames. While Spacewar started the 2D Multiplayer Shooter genre in the late 60s, you’re not going to mistake Pixeljunk Shooter for Spacewar. On the other hand, Colossal Cave (also from the 60s) looks pretty much the same as all other text adventure games, because text looks like text. Like books, text adventures are all about what’s written. Unlike books, the reader drives the story via their own input, and gets feedback according to what the author has told the computer to do.
Text adventures are almost all second-person perspective and present tense, something that is extremely rare in non-interactive fiction. “You are in a room. The daylight streams in through the window, making you squint slightly.” instead of “Conan was in a room. The daylight streaming in through the window made him squint slightly.”
You type into a parser what you want your in-game character to do and the game will describe what happens next:
“You close the curtains, though it is still quite bright in the room.”
“The south door is locked.”
“>unlock door with key”
“You do not have a key to unlock the door. Perhaps there is one hidden in the room somewhere.”
…and so on. The parser breaks down the phrases the player types in into commands that the game acts upon. Behind the scenes, the game keeps track of all the nouns (rooms, objects, creatures), the verbs the player can use (moving, taking items, wearing things), special events, and so on. If all goes well, the player doesn’t run into too many generic error messages and is able to figure out what commands to type to get through the game.
AGT made some big steps towards making adventure games easy to write. Creating a room is as simple as typing:
Top of Cliff
You are standing near the edge on the top of a tall cliff. To the east is a sheer drop of several thousand feet. To the north, west and south are paths that lead down the side of the mountain.
Now, that’s fine. But it’s very similar to programming in a programming language, especially when you get into Dummy Verbs and Meta-Commands. That still was a lot simpler than trying to write your own game from scratch in Pascal or whatever. But the way Inform 7 would do it is:
Top of Cliff is a room. “You are standing near the edge on the top of a tall cliff. To the east is a sheer drop of several thousand feet. To the north, west and south are paths that lead down the side of the mountain.”
Same functionality: much, much, much less like programming.
The clever part of Inform 7 is that they took the idea of parsing player commands and put parsing in the compiler. Writing a game in Inform 7 is just like typing a story, except you have to fix illogical statements (bugs) as you go along. The compiler will take care of translating your plain English into the actual code, and it will give you error messages in plain English. Sort of like what your English teacher might tell you, though exponentially more picky.
This is brilliant, and it’s a pity I had ignored the Interactive Fiction* scene for the last few years or else I could have written about this years ago. I don’t know if I’ll finish the game I just started (I have a bunch else to do right now), but it’s definitely a very interesting way of making games. Inform 7 is not going to replace C++ anytime soon, but it’s pretty much the way to make text adventures.
*Ever since the Internet became popular the cool name for text adventures is “Interactive Fiction”.