The Pain and Promise of the Parser

Readers love and hate interactive fiction largely because of its challenges. In early interactive fictions, the most renowned (and sometimes infamous) of these challenges took the form of complex, difficult, multi-step puzzles, and puzzles remain important in most IF stories. Students often cite the gamelike, problem-solving elements of interactive fiction as their favorite facets of the genre, and teachers usually like IF puzzles, too, as a gateway to improved critical and creative thinking.In another section of this website, we’ll take a close look at interactive fiction as a tool for developing thinking skills.

babelFish

A T-Shirt, Commenting on a Very Complex IF Puzzle

 

However, even in IF stories that eschew puzzles entirely, parser-based literature offers real challenge. It’s “ergotic”; that is, the reader has to make a significant effort just go get through the text. In parser-based interactive fiction, for inexperienced readers, much of this effort focuses of wrestling with the story’s parser.

 

The Parser

In IF, the parser is the part of the story’s computer code that translates the reader’s input into something that the story can deal with. Early interactive fiction, such as Adventure, by Will Crowther and Don Woods, generally used a “two-word” parser, which could respond only to particular sentences of one or two words. Usually, the first of the two words would have to be a verb, but the reader could type “south,” and might get a more or less reasonable response. “Get lamp” would work too, especially if the story included an available lamp. “Put the candle in the lantern” would confound the two-word parser. But lots of two-word combinations would go just as far beyond the parser’s ken. “What’s up,” “Hello, world,” the widely popular “Stupid parser” would all fail miserably to communicate with the story.

During the 1980’s when interactive fiction became an important commercial product, an American company called Infocom introduced a more complex parser, which could recognize and respond to a wide variety of sentence types, though a vast majority of natural-language utterances were not within its grasp.   This new parser could recognize all of the following sentences.

Tie the rope to the mast.

Put the blue scroll into the box.

Ask the troll about the hobbit.

Tell the hobbit about the troll.

Take all.

Give the sword to the gnome.

Ask the elf for a jewel.

Hit the shiny nail with the hammer.

Where is the silver coin?

What is a zorkmid?

 

Two Parser Problems

The improvement here is pretty obvious, but, in a way, the new parser is more deceptive than the old one. With its expanded power and openness, it gives the false impression, to some people, at least, that the interactor can expect to type just about anything into the story and get a sensible response. As the renowned IF author and theorist Emily Shot has noted, this “false promise” leads new readers to lots of frustration. Consider this sequence of commands, from a video blog on IF by Jason MacIntosh.

Interactor: Where am I?

Story’s Response: That’s not a verb I recognize.

Interactor: You don’t understand “where”?

Story’s Response: That’s not a verb I recognize.

Interactor: Boy, are you stupid!

Story’s Response: You seem to want to talk to someone but I can’t see whom.

Interactor: :(

Story’s Response: That’s not a verb I recognize.

This sort of tangle can be frustrating, but it can be misleading, too. As IF author and polymath Andrew Plotkin has noted, when new readers of interactive fiction encounter problems with the parser, “That’s a real experience. The misconception is that that’s the intended interaction of the game, and that’s what the author has spent all of his time thinking about.” In truth, the IF author’s intent is far more benign. He or she almost always spends lots of time and effort in trying to make the reader’s experience of the parser go a smoothly as possible.

Taming the Parser

For all its foibles, the interactive fiction parser is a wonderful tool. Even its limitations, are, in a way, advantages, since they tend to funnel the interactor’s input in a somewhat predictable and positive direction. If the reader really could type any sentence at all into the parser, he or she might well find that puzzles would become almost impossible to solve. The parser, at its best, functions as a set of “rules” that limits the number of possible solutions.

The key to taming the parser is understanding its limitations. In truth, even the most sophisticated IF programs can deal with only a few kinds of English sentences. In the 1980’s, during the commercial heyday interactive fiction, the best of the available stories came with elaborate printed documentation, much of which dealt with the quirks of the parser in general and with particular tweaks of vocabulary and grammar that a particular story offered. Outstanding examples of this documentation are still available, free of charge, at the “Infocom Documentation Project” website, at http://infodoc.plover.net/.

If you are reading more recent works of IF, the corresponding documentation is likely to be included as part of the story itself. Many such stories advise the reader to type “About” or “Intro” or “Help” to read the docs.

Here are some general guidelines about the parser. All works of interactive fiction, even the very earliest ones, can recognize sentences like “take coin,” which the story will consider to mean, “I want to take the coin.” Most IF stories can recognize many more kinds of sentences, but experienced readers often keep the two-word pattern in mind, anyway. For example, IF stories can now recognize “Take the gold coin,” “Take the gold coin from the fountain,” or “Take the gold coin and give it to the librarian.” However, an experienced reader may type “Take coin,” before trying a more complex formulation. If the story then asks, “Which coin do you mean, the gold coin or the copper coin?” the player will then clarify with the word “gold.” Once the player/character has the coin, the interactor might try, “Give the gold coin to the librarian.” In other words, when in doubt, it’s often best to try the simplest possible formulation.

The same simplicity principle applies, in spades, to the use of adverbs in readers’ input, though IF stories themselves use all parts of speech in their text. If experienced readers want their characters to run really fast to the west, they’ll probably type “West” or “Go west,” and get the desired result. “Run west” might also work, but “Run really fast to the west” will surely confound the parser.

Many works of IF can recognize at least some simple questions that begin with “who,” or “what.”    Most stories also use a variety of useful abbreviations, including “x” for “examine,” “g” for “again,” “z” for “wait,” “i” for “inventory of what I’m carrying,” “l” for “look,” “n” for “go north,” “s” for “go south,” and “u” for “go up.”

“Look at the book” is equivalent to “examine the book.” However, “look,” with no object means “look around and report on what’s nearby.” If the player/character is in a particular place, such as a kitchen, “Look at the kitchen,” will usually not produce useful results. The word “look,” by itself, will work fine.

Here are some of the more popular transitive verbs that IF stories use.

Examine
Take
Open
Drop
Put
Give
Eat
Drink
Fill
Climb
Wear
Break
Burn

Popular intransitive verbs include “look,” “listen,” “jump,” and “undo,” which “undoes” the player’s last move.

Individual stories frequently use unusual verbs. Try the “About” or “Help” command to find out about nonstandard verbs in the story that you’re reading.

Conversing with other characters in IF can be lots of fun, but it can be frustrating, too, mainly because different stories use widely different conversation systems. That’s one reason the read the “About” or “Help” file that comes with practically every IF tale. It also helps to keep in mind several patterns that most stories can understand. Directly talking to a character with a command will often work; for example, “Miss Voss, tell me about the magic stone.” Also, a reader can often make progress by asking or telling a character about something, as in “Ask the bartender about the vampire.” “Talk to the bartender” will also produce good results in some stories. Frequently, a story will interpret a single word to mean that the character says the word. In other words, “hello” will often mean the same as “say ‘hello,’” though it is sometimes necessary to type out “say ‘hello.’”

 clash

Clash of the Type-Ins

            The best way to learn to use the IF parser is to work through a story with an experienced reader of the genre. However, not everyone has such a tutor on call. Still, almost everyone does have a way to listen to experienced interactors as they make their way through a variety of interactive fictions. This free-and-easy tutor takes the form of a hilarious podcast called “Clash of the Type-ins” (http://rcveeder.net/clash/). In each episode, hosts Ryan Veeder and Jenni Polodna, both experienced IF readers and writers, read a story together. Most episodes include a third participant, the author of the story that’s being read.

From the “Clash” website, here’s a list of the first eleven episodes. You can’t go wrong with any of them, but listening to them in order is probably the most fun.

EPISODE ONE: You’ve Got a Stew Going! (February 6, 2014)

In this, the first episode, Jenni Polodna plays Ryan Veeder’s first game, a game about rats. Jenni says the word ‘titular’ kind of a lot. If horses ran the world, keyboards would be weird.

EPISODE TWO: Dinner Bell (February 12, 2014)

Ryan plays a game based on a They Might Be Giants song, a game that Jenni wrote for Apollo 18+20, a game that has plagued Ryan’s nightmares for years. Jenni reveals that she has never played Tetris Attack. .yadot suoiciled etsat uoy teb I

EPISODE THREE: It (April 16, 2014)

Jenni and Ryan play Emily Boegheim’s It. It is the name of the game. Cultural gaps are bridged. Murder is attempted.

EPISODE FOUR: Taco Fiction, Part I (May 2, 2014)

In this one we play play Ryan’s IF Comp-winning Taco Fiction, which is a game about crime. Emily and Jenni do some heinous things in this game, but Ryan doesn’t even try to stop them. And you’re about to listen to the whole thing! Nobody is blameless.

EPISODE FIVE: Taco Fiction, Part II (May 15, 2014)

The thrilling conclusion of Emily and Jenni playing Taco Fiction, which is a game about crime. Ryan unmasks all the game’s secrets, expounds on all of its social and ethical implications, and basically never stops talking. Even this sentence is a form of Ryan talking. You can’t escape.

EPISODE SIX: Violet, Part I (July 11, 2014)

Jeremy Freese brings us his IF Comp-winning Violet, a game painstakingly calculated to drive Ryan to the brink of insanity and then drive him over that brink. And Jenni just smiles and laughs! While her friend Ryan is falling apart! Clearly whoever is writing this summary hasn’t completely recovered.

EPISODE SEVEN: Violet, Part II (July 14, 2014)

With Jenni’s help, Ryan achieves self-actualization. His mental energies finally suppress his somatic anxieties, and he succeeds in escaping from the cramped cell of repression and into the light and fresh air of true awareness. He achieves this by solving Violet, by Jeremy Freese.

EPISODE EIGHT: The Statue Got Me High (July 14, 2014)

Jenni and Jeremy play a game that Ryan wrote based on a They Might Be Giants song. Hey, just like that other game! But that game was weird, and creepy. This one will be normal, and pleasant.

EPISODE NINE: A Day for Fresh Sushi (January 9, 2015)

Jenni and Ryan play Emily Short’s Speed-IF about an angry fish, and Flavor Flav finally finds the career he was born for.

EPISODE TEN: Bronze (January 10, 2015)

Emily Short brings us one of her fractured fairy tales and Ryan works himself into a fanboy frenzy. Jenni tries to remember Dom DeLuise’s first name. Shameful lunchtime secrets are revealed.

EPISODE ELEVEN: Nautilisia (January 20, 2015)

Crazed with power, Ryan demands that Emily Short and Jenni play a game he wrote about a person who keeps yakking about being in a coma. The person in the game does not necessarily depict Ryan. I want to make that clear.

 

Joys of the Parser

The interactive fiction parser is worth all the hassles it introduces.   For one thing, it creates the impression that the interactor is, in some odd way, writing the story, even though the tale has an author who has provided its plot, setting, tone, mood, characters, and themes. Is this impression that the reader creates an already-authored story just an illusion? No, it’s not.

To illustrate the truth of this seeming contradiction, let’s consider two transcripts. Each of these transcripts shows one person’s way through the first few moves of a famous IF story called Lost Pig, in which the player/character is an orc named Grunk. The first transcript is more typical of what experienced IF readers would to with the story, but the second one represents another approach that is not uncommon. In both transcripts, the user input is marked with the “greater than” symbol (>), as is traditional in IF.

 download

Transcript One – A Very Common Approach

Lost Pig
And Place Under Ground
Release 1 / Serial number 070917 / Inform v6.30 Library 6/11 S
(For help, use “HELP”.)
Standard interpreter 1.1 (4F) / Library serial number 04022

Pig lost! Boss say that it Grunk fault. Say Grunk forget about closing gate. Maybe boss right. Grunk not remember forgetting, but maybe Grunk just forget.

Boss say Grunk go find pig, bring it back. Him say, if Grunk not bring back pig, not bring back Grunk either. Grunk like working at pig farm, so now Grunk need find pig.

 

Outside

Grunk think that pig probably go this way. It hard to tell at night time, because moon not bright as sun. There forest to east and north. It even darker there, and Grunk hear lots of strange animal. West of Grunk, there big field with little stone wall. Farm back to south.

 

>Inventory

Grunk have:

torch (on fire)

pants (Grunk wearing them)

 

>Go east.

Forest look dark. Pig probably some place in there, but Grunk not know which way to go. Not want end up lost in forest with no pig.

>Go north.

Forest look dark. Pig probably some place in there, but Grunk not know which way to go. Not want end up lost in forest with no pig.

>Go south.

Grunk get in big trouble if Grunk go back with no pig.

>Listen.

Grunk get quiet. Listen for noise in dark.

Grunk hear noise! It come from some place in bushes, but Grunk not sure which way it come from.

>Listen.

Grunk get quiet. Listen for noise in dark.

When Grunk really quiet, try looking around some more. There, hear noise again! It come from northeast. Must be pig, hiding in bushes.

[Grunk score go up one.]

>Go northeast.

If that where pig go, that where Grunk go. It hard to see where Grunk going to, because there so much dark and leaves and branches here. Then suddenly, there not ground here any more!

Oof! Ow! Umf! Ugh!

Grunk fall down deep hole! Drop torch. Torch go out when Grunk land on it, so now it dark, too.

Hole

Grunk at bottom of deep, dark hole. It even smell like deep, dark hole. There some light that come from tunnel to east; that how Grunk see where Grunk at. Look like there maybe stairs at west side of hole that go up to outside, but them all broken now. There big crack in ground near stairs, too.

Grunk see torch (black and sooty) here.

 

Transcript Two – A Fairly Common Approach, With “Attitude”

Pig lost! Boss say that it Grunk fault. Say Grunk forget about closing gate. Maybe boss right. Grunk not remember forgetting, but maybe Grunk just forget. Boss say Grunk go find pig, bring it back. Him say, if Grunk not bring back pig, not bring back Grunk either. Grunk like working at pig farm, so now Grunk need find pig.

Lost Pig
And Place Under Ground
Release 1 / Serial number 070917 / Inform v6.30 Library 6/11 S
(For help, use “HELP”.)

 

Outside

Grunk think that pig probably go this way. It hard to tell at night time, because moon not bright as sun. There forest to east and north. It even darker there, and Grunk hear lots of strange animal. West of Grunk, there big field with little stone wall. Farm back to south.

>Inventory

Grunk have:

torch (on fire)

pants (Grunk wearing them)

 

>Scream.

RAAARRRR!

That fun! Grunk like shouting.

>Take off pants.

OK, pants off.

>Burn pants.

(with torch)

Grunk set pants on fire. Mmm. Grunk like fire.

>Look at forest.

Many tree and bush and leaf and branch and other plant like that. That what forest mean. It dark, too. Pig probably some place in there, but Grunk not know which way to go.

>Jump.

Grunk jump and jump, but moon still too high to reach.

>Look at the wall

Wall made of many big rock. It not very tall; Grunk lots taller than wall. Maybe it too hard, find enough big rock to make big wall. There field on other side of wall.

>Kick wall.

Grunk remember last time Grunk try hitting rock. It hurt Grunk more than it hurt rock.

Grunk hear noise! It come from some place in bushes, but Grunk not sure which way it come from.

>Kiss wall.

That only make sense for person and animal and thing like that.

>Burn forest.

(with torch)

That maybe dangerous. But then if forest all burned up, pig not have any place to hide, so maybe it really good idea. Grunk not sure. That really what Grunk should do?

>Burn forest.

(with torch)

Grunk hold torch up to tree. Tree start to burn. Then other tree start to burn.And other tree. And other tree. Then Grunk hear pig squeal! Pig run out of forest, and it not even see Grunk until after Grunk grab it. Silly pig!

Ha ha. Grunk smart, catch pig. Grunk get to go back to farm now. Maybe boss say that Grunk do good job. Fire go toward farm, too. There lots of tree to burn.

Fire go even faster than Grunk.

Uh oh. There lots of tree near farm, too. Fire get there before Grunk. Farm burn like tree. Grunk think that maybe boss not say Grunk do good job, if boss find out that Grunk make fire. Maybe it better if Grunk not go back to farm after all.

Oh well. At least Grunk get to keep tasty pig.

*** Grunk not bring pig back to farm   ***

Grunk have 0 out of 7 that time.

Time for Grunk to RESTART or RESTORE a saved story or UNDO what Grunk just do or tell FULL score or just QUIT?

> Undo.

Outside

[OK, Grunk undo that.]

>Listen.

Grunk get quiet. Listen for noise in dark.

When Grunk really quiet, try looking around some more. There, hear noise again! It come from northeast. Must be pig, hiding in bushes.

[Grunk score go up one.]

>Go northeast.

If that where pig go, that where Grunk go. It hard to see where Grunk going to, because there so much dark and leaves and branches here. Then suddenly, there not ground here any more!

Oof! Ow! Umf! Ugh!

Grunk fall down deep hole! Drop torch and pants. Torch and pants go out when

Grunk land on them, so now it dark, too.

Hole

Grunk at bottom of deep, dark hole. It even smell like deep, dark hole. There some light that come from tunnel to east; that how Grunk see where Grunk at. Look like there maybe stairs at west side of hole that go up to outside, but them all broken now. There big crack in ground near stairs, too.

Grunk see pants (black and sooty) and torch (black and sooty) here.

Looking at the Transcripts

These are, of course, transcripts of the same story. They have the same opening text, they introduce the same character, and they eventually respond to the same required moves; namely, listening and going northeast. However, the transcripts are significantly different, too, reflecting the different approaches and attitudes of the readers who contributed to them. The first transcript proceeds in a straightforward, problem-solving way, and, not surprisingly, it comes to the required moves much faster than the second transcript. It also creates a different impression of the player/character, since he, too, operates in direct and reasonable way.

The second transcript suggests that the interactor has a bit of an “attitude,” and, as a result, Grunk seems less sensible, too. The second transcript is also longer and more meandering, but it uncovers more of the comic nature of the story. The less rational approach also reveals an important fact that turns out to be essential for later problem-solving: the fact that the torch is just a good for burning things as it is for lighting.

These transcripts highlight one way in which one person’s (or group’s) reading of “Lost Pig” can differ significantly from another. Particularly in stories that require the reader to explore a large number of locations, readers often differ even more markedly. Some readers, or classes, stop exploring new locations as soon as they find a puzzle to solve, moving on to new places only when they’re solved the puzzle or determined that they can solve it only by finding new tools in new locations. Other interactors take the opposite approach, exploring as far as they can before trying to solve puzzles. Teachers who are guiding multiple classes through the same IF story at the same time often find students asking which class is farthest “ahead” in the narrative.   The answer, if there is one, often hinges on how the classes are approaching the story, more than on a counting up of places visited or problems solved.

Without the open-ended parser, which invites the reader to bring his or her own personality to the story, the sort of variation that we see among these approaches and their resulting narratives could not happen, at least not to the same degree. And, without this sort of variation, students would not experience the highly-motivational sense of agency that interactive fiction offers.

 

The Teacher as Parser

In a classroom, the teacher serves as the students’ first parser, translating suggested student input into a form that the story’s parser can understand. Suppose, for example, that uninitiated students find that their player/character is threatened with capture in a churchyard that features a large tombstone. In this situation, a student might suggest that the teacher type, at the story’s command prompt, “Get out of sight behind the gravestone.” This suggestion, of course, makes good sense, but it would only confuse the parser, resulting in an error message. The teacher might translate this request into the typed command, “Hide behind the tombstone,” which would produce the desired result. In addition, the teacher might recognize a “teachable moment” for helping students to understand the nature of the parser, with its many weaknesses and its considerable value.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *