So here we are in 2003 and people are still writing games in AGT. Even more disheartening, they’re still writing terrible games in AGT.
–from Paul O’Brian’s review of Curse of Manorland, IFComp '03
Having sailed back three decades to reach the dusty shores of the Adventure Game Toolkit and thereafter returned, I wanted to report on my voyage. For personal and narrative reasons, I knew I wanted to use AGT for LAKE Adventure. The last time an AGT game was entered was 2003, so after two interceding decades, I felt it might be time.
AGT is historically influential because it was the first IF-creation system for non-programmers that achieved widespread use in the U.S. Jimmy Maher’s site The Digital Antiquarian gives a robust and thoughtful history of the software and its creators. While writing LAKE, I was often thinking about AGT’s successes as a coding platform and also about its downfall and quick supplanting by Inform (and TADS, though I know much less of that history). I wondered what, if anything, had been lost in its disuse, and if AGT offered anything that has been forgotten by more modern engines.
And for a while, AGT was truly at the vanguard for amateur authors. Its philosophy and fundamental structures are modeled after Colossal Cave Adventure and Infocom games, and AGT promised authors they could write games of similar complexity and scope. It was most characterized, though, by a plain-English coding style that in some ways feels like shorthand Inform 7. AGT was updated regularly, and by its last update in 1993, the Master’s Edition of AGT offered very readable code and even rudimentary support for multimedia—LAKE displays a DOS-compliant title image at the outset, for example. In 1988, AGT’s publishers began an annual contest for games created with the system. It ended the year immediately prior to the year the Interactive Fiction Competition began.
Here are toy examples of code that accomplish essentially the same thing. First, Inform 7:
"Picnic"
Grassy Meadow is a room. "You're sitting in a grassy meadow. It's the perfect place to have a picnic."
The picnic basket is an openable closed container in Grassy Meadow. The description of the picnic basket is "You can't wait to open this picnic basket and enjoy the lunch inside!" Understand "lunch" as the picnic basket.
Rule for writing a paragraph about the picnic basket:
say "You've brought your picnic basket. Your lunch is inside it."
Instead of opening the picnic basket:
if the player is in Grassy Meadow:
say "You have a delightful picnic on this beautiful day!";
end the story saying "You win!";
otherwise:
say "This isn't the ideal place for a picnic."
Instead of eating the picnic basket:
try opening the picnic basket.
Now AGT, Master’s Edition:
#INCLUDE stddefs.agt
ROOM [Grassy Meadow]
Grassy Meadow
END_ROOM
ROOM_DESCR [Grassy Meadow]
You're sitting in a grassy meadow. It's the perfect place to have a picnic.
END_ROOM_DESCR
NOUN [Picnic basket]
Basket
Picnic
You've brought your picnic basket. Your lunch is inside it.
LOCATION [Grassy Meadow]
CLOSABLE
NOUN_SYNONYMS lunch picnic
END_NOUN
NOUN_DESCR [Picnic basket]
You can't wait to open this picnic basket and enjoy the lunch inside!
END_NOUN_DESCR
COMMAND OPEN BASKET
Present [Picnic basket]
AtLocation [Grassy Meadow]
PrintMessage [You have a delightful picnic]
WinGame
DoneWithTurn
END_COMMAND
COMMAND OPEN BASKET
NOT AtLocation [Grassy Meadow]
PrintMessage [This isn't the ideal place]
DoneWithTurn
END_COMMAND
COMMAND EAT BASKET
RedirectTo OPEN BASKET
END_COMMAND
MESSAGE [You have a delightful picnic]
You have a delightful picnic on this beautiful day!
END_MESSAGE
MESSAGE [This isn't the ideal place]
This isn't the ideal place for a picnic.
END_MESSAGE
And here’s the transcript of playing the AGT version in Gargoyle:
Grassy Meadow
You’re sitting in a grassy meadow. It’s the perfect place to have a picnic.
You’ve brought your picnic basket. Your lunch is inside it.
> x basket
x -> examine
You can’t wait to open this picnic basket and enjoy the lunch inside!
> take basket
You are now carrying the picnic basket.
> open basket
You have a delightful picnic on this beautiful day!
*** Congratulations. You have won the game. ***
Your score is 0 (out of 0 possible).
You have visited 1 locations (out of 1 in the game)
While the AGT code is longer and feels more cumbersome, I think it’s fairly readable—most code blocks should be fairly self-evident. The coding of special actions like OPEN BASKET in AGT are called “metacommands,” and they take the place of Inform’s Instead rules. Their structure is somewhat convoluted in terms of logic: multiple conditions are joined by an implicit AND, OR conditions are possible but confusing, and there is no ELSE structure available. The DoneWithTurn has the same effect as an Instead rule in Inform—it skips the parser’s typical processing. In this way, Inform’s Before rules are also possible in AGT; one would simply eliminate DoneWithTurn. AGT’s parser is also sophisticated: it parses words reasonably sensibly, including the ability to handle pronouns, direct objects, and multiple commands in a single line like TAKE LUNCH AND EAT IT.
So, what did I learn about AGT and its eventual failure? Is there anything to be learned about parsers in general, and when to choose one system over another?
I had hoped to be able to sing AGT’s praises and say that we have indeed lost something in our newer parser systems. But it simply isn’t the case. Perhaps the only two things I could genuinely praise about AGT are related. 1.) AGT’s documentation is outstanding. It is clear, readable, and replete with examples. 2.) The number of possible commands, actions, and ways to model and manipulate the story’s world in AGT are fewer than Inform 7, but they are enough to do ~90% of what we might ask a robust engine to accomplish. In Inform 7, there are often several ways to code something, and folks can discuss the purest implementations, but each requires the wording to be just so. And that “just so” wording isn’t always clearly documented or is only gleaned from the Inform Recipe Book, not Writing with Inform. There’s no question about how to word things in AGT. The commands are clearly listed and documented—you just need to look them up and hope the programmers presupposed the need for the case you’re currently trying to solve.
(I should say that AGT has a multiple-choice mode that might be able to be used for dialogue trees and the like, something which vanilla Inform still lacks. But I haven’t tried that feature in AGT.)
AGT, though, is fundamentally backward-looking. It was trying to allow authors to recreate some flavor of ADVENT from 1976 or otherwise Infocom games, which went belly-up in 1989. AGT mandates that a game have a score, for example, and its fundamental worldview about NPCs is that they largely exist to be killed, like the dwarf in Colossal Cave. (The default description of a creature’s death is a puff of smoke, the same as the dwarf’s.)
Inform’s initial coding structures were in many ways harder to read than AGT’s, as suggested by the I5 Designer’s Manual. But throughout that manual beats a deeper aspiration of what a text adventure could be, each section punctuated by philosophical epigraphs. In AGT, a game is a database. In Inform, a game is an ontology. It is a world.
AGT was also limited by two other factors. One was that its chief mode of dissemination, discussion, and collaboration was via the pre-Internet online service CompuServe. Inform, instead, was initially released on the soon-to-be much more widely available Usenet group rec.arts.int-fiction. As the Internet became dominant and online services (including BBSes) became increasingly dormant, AGT no longer had a community of authors and players who connected to each other as easily as before.
The other unfortunate factor is that, after the Internet boom, a lot of AGT games are … not good, or worse. Currently at IFDB, only two other AGT games have generated some reasonable interest and success in terms of reviews, the first being Cosmoserve by Judith Pintar. Interestingly, that game, like LAKE Adventure, is largely about someone interacting with a computer (and specifically a parody of CompuServe). It even features, as a parody, Wisconsin: The Adventure Game by fictional author R.J. Wright, whose initialed, alliterative name is eerily close to my own. IFDB ratings aren’t always an accurate picture of game quality, of course, but even Son of Stagefright by Mike McCauley, a winner of the annual AGT competition, has only garnered a single (five-star) IFDB rating.
No, instead the bad AGT games are much more famous. They include Detective (which later received the Mystery Science Theatre treatment) and, of course, The Incredible Erotic Adventures of Stiffy Makane. Prior to this year, only five AGT games had ever been entered into IFComp, and while none did particularly well, several were particularly bad, including last place in 1996 and third-last in 2003. I imagine that once enough people made an implicit assumption that any game created with AGT was likely to be amateurish and bad, whatever life AGT may have still had was quickly extinguished.
The thing is, AGT isn’t bad. It’s perfectly serviceable. And I might even recommend it if it wasn’t such a pain in the ass to deal with. I wrote the AGT code in Visual Studio Code, but all the compiling has to be done in DOS. I was somewhat astonished to learn that the DOS implementation of the AGT interpreter and the AGiliTy version, which is used in modern interpreters like Gargoyle, aren’t exactly the same. (AGiliTy is largely the same and its small changes are generally better.) And then there was the matter of making sure LAKE Adventure could be easily played for the Comp, which required a lot of fiddling to make DOSBox run on a webpage while also giving offline players a file they could use for one of three interpreters.
Beyond that, it took a reasonable amount of rejiggering to make AGT compatible with modern IF players’ expectations. The most interesting example is that one does not X anything in AGT to examine it. Instead, you must EX it (so, EX DRESSER rather than X DRESSER). Similarly, there’s no concept of the player, so X ME has to be jury-rigged, along with a bunch of other verbs that Inform has already cheerfully prepared for you.
So, my two takeaways from the AGT experiment that might be helpful for other parser authors are:
1.) You can make a good game / story with any competent development system. The issue of “Which system should I choose?” occasionally pops up in the forums. And the answer usually is: Whichever one makes the most sense for you to use. I guess I’ll add to the chorus of voices and say I agree. I think my only addition (also suggested by others) is that the choice should be Inform 7 by default. It’s the most widely used, highly tested and highly capable. But if the natural-language code doesn’t make sense, of if you need to accomplish a very specific task (such as displaying an image with every room, in which case Adventuron would be my clear choice), pick whatever contemporary system speaks to you. Top-ten Comp entries have been created in Inform, TADS, Dialog, ADRIFT, Hugo, Quest, Adventuron, and apparently now AGT.
2.) Maybe more importantly: It’s not the quality of the parser, it’s the quality of the response messages that matters. This is another case where Inform shines—its default messages are clear and typically helpful in terms of why an action did or didn’t work (and what it may have accomplished). Here is my absolute least favorite thing about AGT (in DOS only):
? EX ALIEN
You see nothing unusual.
I would argue that in a game like LAKE Adventure, an alien would indeed be something unusual. It’s just a bad error message, and while there are many messages that can be altered in AGT’s Master Edition, “You see nothing unusual” is hard-coded in. Particularly when a player enters a verb or noun that isn’t part of the game, I believe a game should either directly (“VERB isn’t used in this story.”) or cleverly (“You don’t remember the last time you saw a NOUN, but it certainly wasn’t around here!”) indicate as such. Good default responses and error messages serve double duty: they lend tone and flavor to the narration, and they let the player know if they’re on the right track. Most systems I know of allow authors to override the default responses (or, in the case of AGT, create new, more helpful responses in line with contemporary expectations). Authors should take advantage of that. For AGT, it’s a necessity.
AGT is a good language, and it could even still be relevant today if a.) there was a compiler for contemporary OSes and b.) there was an easy way to have the story play on a web page. But personally, while I enjoyed my expedition, I don’t think there’s a proven need to return. (However, if you disagree, or if you’re simply curious, I’ve placed the source code online for your perusal.)
And yet, the strangest thing happened in this year’s Comp: after a twenty-year drought, two AGT games were entered, the other being Creative Cooking by @Piergiorgio_d_errico. (And technically that game uses MAGX, a more-advanced offshoot of AGT.) And somewhat recently on the forums, @GusCE6 has been working on modifying the AGT engine and creating a game. I’d love to hear their thoughts on why AGT was their choice for game development.
As for me, as I said, the choice was both narrative and personal. The personal bit is that in LAKE Adventure, in the opening acts, you are in fact wandering the ruins of My First Game, written 1989-1991, with all its attendant cliches. I cut out a lot of the pointless in-jokes and obviously terrible puzzles and code. But a lot of my thirteen-year-old writing, including the original overarching plot—get to the birthday party!—remains. That’s my bedroom you’re starting in, my red dresser you open, my ridiculous red glasses that you’re wearing. My Vendex computer on which I made the original game is on the porch, and it’s there in LAKE Adventure, too. Go ahead, X COMPUTER, PLAY GAME, and MAKE GAME. But look out the window; it’s a nice summer day outside. See the cat on the deck? That’s my cat. Her name is Christmas. You should pet her and tell her I say hello from almost three lifetimes later.