Sitting in Judgement...
Parser: The Final Arbiter

An adventure game is only as good as its parser. That's the part of the program through which the player communicates with the game's environment. The importance of the parser to the value of the game cannot be understated β although why it's so crucial isn't obvious. It would be easier, perhaps, to say that an adventure can only be as sophisticated as its parser, but that's not enough. An adventure is only as fun as its parser allows it to be; if the parser gets in the way of the player's creative expression, even the best plotted game can become slow, tedious, and frustrating.
Adventure game parsers need not address the difficult (and for the most part, unsolved) problems involved in general English usage; their domain is limited to imperative sentences, a small subset of the language. Traditionally, the adventure parser understands sentences consisting of a single word (a verb or special command) or a two-word sentence containing a verb and a noun.
For ease of implementation, the two-word parser is hard to beat. At the simplest level, one can simply match the player's input with all the legal sentence combinations and act accordingly. As a more general method, one can separate understanding of the verb and noun to allow for a verb to handle legally any noun that comes its way. Regardless of method, the two-word parser is the core of the vast majority of adventure games.
The implications of having a two-word parser are many. A novice user is immediately aware of the communications limitation; almost everyone first sitting down to an adventure game types sentences far more complicated than the game can understand. When the player grasps the limits, a more serious problem occurs: how to phrase a proposed course of action in just two words. In the original Adventure, there is a birdcage and a bird. What could be more natural than to say, "Put the bird in the cage," or, less verbosely, "Put bird in cage." Naturally, this wouldn't work. What, then? "Put bird," "Cage bird," or "Trap bird"? The first, albeit perversely truncated, seems to be on the right track. The second and third took a bit of thought to conjure up. Unfortunately, none of these work. In fact, "Take bird," input while the player is holding the cage, places the bird in the cage automatically.
The bird and cage example demonstrates a problem inherent in two-word parsing β a problem that leads to the rejection of adventure games by potential players. The very nature of the adventure changes: what should be a fun, stimulating, goal-oriented challenge is reduced significantly to a pitched battle against the vocabulary of the game and its limited capacity to understand. With the bird and cage, you know immediately what you want to do, and that should be the end of the problem. The real problem, though, is expressing what you want to do. The solution is, perhaps, the biggest disappointment: it's magic, not logic. You lose.
In the five years during which the Zork games and their successors have been developed, the parser has been continually enhanced and expanded. The impetus for that expansion has been the desire to present the player with new and challenging problems.
Semantic Breakthroughs. Early, some game programmers recognized the importance of adjectives in allowing the existence of more than one object of the same kind. In a Zork I problem, a control panel has four buttons, each of a different color. You can, therefore, "Press the blue button." Without the understanding of adjectives, you might still say "Press blue," which, again, is not obvious. Another example from Zork I is doors. In the living room are two doors, a trap door (which is initially hidden) and a wooden door. The ability to distinguish between these is vital.
The addition of prepositions and compound verbs using prepositions (such as pick up, put down, turn on) was an important turning point in the construction of the Infocom adventure parser. There were two equally important reasons for this addition. In the case of prepositions, the need was compelling. Consider: "Put the knife in the trophy case," "Swing the sword at the cyclops," "Unlock the door with the key," "Fire the gun at the monster." Prepositions used in this way are vital if the verbs put, swing, unlock, and fire are to be used conveniently and logically. Without them, unlock might check whether you are holding a key and fire might assume the being you are trying to kill. In either case, some variety of magic has occurred and the player is somewhat cheated. The ability to use put properly opens a new dimension to a game, adding the concepts of containment, size, weight, bulk, and capacity. How, otherwise, as in Zork II, could you place some plastic explosive in a hole in the wall, insert a fuse into it, and ignite it?
Compound verbs allow a great deal of flexibility. Although the verb look is ubiquitous in adventure games, the additional ability to look inside, look behind, or look under adds new possibilities for game problem designers. The ability to pick up or put down objects is, for many people, especially beginners, more obvious than take and drop. With the flexibility of compound verbs, the game player can expect any number of different ways of expressing an action to workβfor example, "Take the rod," "Pick up the rod," "Get rod," and "Take the rod from the case."
These two additions, prepositions and adjectives, are probably the most important ones to date, but others have arrived and more are arriving. In Zork II, the ability to command another character in the story was achieved and the following command became possible: "Tell the robot 'take the sphere.' " This advance in parser sophistication allows another new range of problems to be designed in which the cooperation of other characters becomes important in the game.
The mystery Deadline incorporates a more conversational (albeit limited) style to interaction with the characters. You might say, for example, "Mrs. Robner, tell me about your husband." or "Mc- Nabb, show me the holes." The important thing to realize is that the entire interactive basis of Deadline is predicated on the availability of a parser that allows that interaction. The need for an ever-improving interaction has consistently led to ever-improving parsers.
Besides the powerful parser extensions, there is a complement of enhancements that make game playing more enjoyable, taking the drudgery out of such commonplace adventure activities as moving to a distant location and manipulating numerous objects. Foremost among these are the ability to use multiple objects in a command ("Take the rod, the coffin, and the sack," "Push all of the buttons," "Take all but the sword") and the ability to string multiple commands on one command line ("Take all but the sword and go south," "N,N.W,N.SW.Kill the troll"). The recognition of ambiguous nouns, with the game asking for clarification ("Which tablets do you mean, the ebullion tablets or the Sneezo tablets?"), and the ability to clear up the ambiguity easily (you need only respond, "The ebullion") are intended to save the player from time-consuming repetitions. The problems might consume time, but the interaction shouldn't.
The Few, the Proud, the Parsed. It is not surprising that so few games provide this kind of richly interactive environment. The nightmare world of full-sentence recognition, compared to the simplicity of two-word parsing, is a daunting prospect. The algorithms appropriate for small-vocabulary, two-word-understanding games are well known and simple to implement. Programmers who aspire to more complex parsing are in a barely explored alien world whose inhabitants have been through, in some cases, years of false starts and setbacks.
It seems almost trite to say that the most popular games in the long run will be those that are the most fun to play. In an adventure game, fun is largely a function of that interaction that distinguishes it from other types of games: the communication between player and game. Some people seem to have missed this point: games with whizz-bang graphics and sound added to the standard two-word parser abound; too often even the minimum parser is abridged in favor of the pizzazz. They have achieved much publicity and are no doubt easier to sell to the uninitiated, but they are being replaced by games β with and without graphics β that give the player the added sense of realism and accomplishment that only an advanced parser can give.
The future of adventure games seems to lie in the development of what might be called "interactive stories," Deadline being an early example of what such a game might be like. The player is simply one of a number of characters, each with some motivation and style. The flow of the story is controlled not only by the player's actions but also by interactions with the other characters with whose destinies the fate of the player is inevitably tied. The parsers required for a real triumph in this new genre have not been developed and will not appear at once; they'll require a progression of smaller advances like those made over the past few years. When they arrive, a new and exciting brand of fiction will be waiting for them.

This article appeared in
Softline
Jan 1983
These historical, out-of-print articles and literary works have been GNUSTOed onto InvisiClues.org for academic and research purposes.