46
1 Interactive Fiction and Natural Language Processing David J. Snyder

1 Interactive Fiction and Natural Language Processing David J. Snyder

Embed Size (px)

Citation preview

Page 1: 1 Interactive Fiction and Natural Language Processing David J. Snyder

1

Interactive Fiction and Natural Language Processing

David J. Snyder

Page 2: 1 Interactive Fiction and Natural Language Processing David J. Snyder

2

What is Interactive Fiction?“Interactive fiction, often

abbreviated as IF, is a simulated environment in which players use text commands to control characters.”

Wikipedia, the free encyclopediahttp://en.wikipedia.org/wiki/Interactive_fictionApril 5, 2005

Best known example is a series of “text adventure games” produced by a company called Infocom in the 1980s.

Page 3: 1 Interactive Fiction and Natural Language Processing David J. Snyder

3

The classic example is

ZORKZORK has been made available as freeware by Activision, the current owner of the Infocom properties, and is available for download at http://www.infocom-if.org/downloads/downloads.html

Page 4: 1 Interactive Fiction and Natural Language Processing David J. Snyder

4

A Short HistoryAll IF has one common ancestor- the game ADVENTURE.

“In 1975, Will Crowther wrote the first text adventure game, Adventure. It was programmed in Fortran for the PDP-10 In 1976, Don Woods discovered Adventure while working at the Stanford Artificial Intelligence Lab, and obtained Crowther's permission to expand the game. Crowther's original version was more or less realistic; Woods' changes were reminiscent of the writings of J.R.R. Tolkien, and included a troll, elves, and a volcano inspired by Mount Doom. “

Wikipedia, the free encyclopediahttp://en.wikipedia.org/wiki/Interactive_fictionApril 5, 2005

Also know as ADVENT and Colossal Cave

Page 5: 1 Interactive Fiction and Natural Language Processing David J. Snyder

5

Adventure Continues“My idea was that it would be a computer game that would

not be intimidating to non-computer people, and that was one of the reasons why I made it so that the player directs

the game with natural language input, instead of more standardized commands. My kids thought it was a lot of

fun."

— William Crowther

The Colossal Cave Adventure pagehttp://www.rickadams.org/adventure/a_history.html April 5, 2005

Page 6: 1 Interactive Fiction and Natural Language Processing David J. Snyder

6

Adventure ExamplesCommands(Adventure) “only accepts commands of one or two words…”

Montfort,2003. page 108

Examples- “IN”, “N”, “GET SILVER”, “DROP KEYS”, “LAMP ON”, “XYZZY”, “PLUGH”Adventure – Solving in in Easy StepsFrom The Rom Ranger- Dr. Digitalhttp://www.textfiles.com/100/adventur.txtApril 5, 2005

Location“YOU ARE AT A COMPLEX JUNCTION. A LOW HANDS AND KNEES PASSAGE FROM THE NORTH JOINS AHIGHER CRAWL FROM THE EAST TO MAKE A WALKING-PASSAGE GOING WEST. THERE IS ALSO A LARGE ROOM ABOVE. THE AIR IS DAMP HERE.”

Montfort, Nick 2003Twisty Little Passages :An Approach to Interactive FictionCambridge, MA:The MIT Presspage 88

Page 7: 1 Interactive Fiction and Natural Language Processing David J. Snyder

7

ZORKZork was developed by students at

MIT’s Laboratory of Computer Science as a follow-up to Adventure. It was originally written in MDL, a LISP variant that allowed for the creation of user-defined data types. The vocabulary of the mainframe version included 908 words of which 71 were distinct actions.

Leibling, P. David, Marc S. Blank and Timothy A. Anderson 1979“Zork: A Computerized Fantasy Simulation Game”IEEE Computer 12(4)(April): 51-59.http://www.csd.uwo.ca/~pete/Infocom/Articles/ieee.htmlApril 5, 2005

Page 8: 1 Interactive Fiction and Natural Language Processing David J. Snyder

8

ZORK Object

;"An object: A stack of Zorkmid bills (Zorkmids are the currency of Zork)“

<OBJECT ["BILLS" "STACK" "PILE"] ;"The object's name and synonyms."

["NEAT" "200" "ZORKM"] ;"Adjectives which refer to the object."

"stack of zorkmid bills" < + ,OVISON, READBIT, TAKEBIT, BURNBIT>

;"Properties of the object: it's visible, readable, takeable, flammable"

BILLS-OBJECT ( ) ;"The contents of the object (always empty for this object)."

Page 9: 1 Interactive Fiction and Natural Language Processing David J. Snyder

9

ZORK Object (cont)

[ODESC1

"200 neatly stacked zorkmid bills are here."

;"The long description." ODESCO

"On the floor sit 200 neatly stacked zorkmid bills."

;"The initial long description (when first seen by the player)."

OSIZE 10

;"The object's weight."

OTVAL 15

;"The value of the object: points for finding it and saving it."

OFVAL 10 OREAD ,ZORKMID-FACE

;"What to print when the object is read."]

;"The elements of an object with tokens naming them are rare (few objects are readable and thus need OREAD slots). The other slots are common to all objects.">

Page 10: 1 Interactive Fiction and Natural Language Processing David J. Snyder

10

Zork Object (cont);"The object function for the Zorkmid bills. It is there mostly to make a

few sarcastic comments.“

<DEFINE BILLS-OBJECT ( ) <SETG BANK-SOLVE!-FLAG T> <COND (<VERB? "BURN">

<TELL "Nothing like having money to burn!"> <>) ;"Prints sarcasm but doesn't handle the command

(accomplished by returning the false object <>). This allows BURN also to deal with it." (<VERB? "EAT">

<TELL "Talk about eating rich foods!"> ;"Doesn't allow EAT to run (by returning a non-false.")>>

Leibling, Blank Anderson. 1979

Page 11: 1 Interactive Fiction and Natural Language Processing David J. Snyder

11

“You are Dealing with a Fairly Stupid Parser”

• First verifies all words in the command are in its vocabulary.

• Attempts to reduce the command to a verb and an optional direct object and indirect object.

• Verbs are mapped to known actions. Prepositions are considered part of the verb for determining an action. For example “Look under” would be distinct from “Look at” and handled differently.

Montfort.2003page 107

Leibling, P. David. 1980“Zork and the Future of Computerized Fantasy Simulations”Byte (December)http://www.csd.uwo.ca/~pete/Infocom/Articles/byte.htmlApril 10, 2005

Leibling, Blank, Anderson. 1979

Page 12: 1 Interactive Fiction and Natural Language Processing David J. Snyder

12

“Stupid Parser” Continued

The same verb can map to two different internal action representations.

“Knock down the thief with rusty knife” [<action STRIKE> <object THIEF> <object RUSTY-KNIFE>

“Knock on the thief” [<action RAP> <object THIEF>

Leibling, Blank, Anderson. 1979

Page 13: 1 Interactive Fiction and Natural Language Processing David J. Snyder

13

“Stupid Parser” Continued

If an object is omitted and only one available object is associated with the command, the parser will attempt to use that. For example, if you enter the command “Attack”, the command attack is associated with a direct object of type “villain” and an indirect object “weapon”. If there is only “villain” type object present (for example “Troll” and you are only carrying one weapon (“sword”), they are placed in the appropriate spots in the attack verb frame and the command succeeds without further action required.

However, if you are carrying two or more weapons, or nothing that is normally recognized as a weapon, the interactor will be asked what object to use and the answer will be rolled in as the object in the command.

Leibling, Blank, Anderson. 1979

Page 14: 1 Interactive Fiction and Natural Language Processing David J. Snyder

14

Parser Continued Adjectives are used to distinguish between like

objects. For example, the “red button” or the “blue button” and are otherwise ignored. They can be combined with “all” and “but” to specify groups of objects.

Adverbs were considered but not found a good use for. “The problem is to think of reason why you would not do everything ‘quietly’, ‘carefully’ or whatever.”

Leibling. 1980

Determiners are completed ignored.Leibling, Blank, Anderson. 1979

Page 15: 1 Interactive Fiction and Natural Language Processing David J. Snyder

15

ZORK Verb;"The definition of the `verb' READ:

"<ADD-ACTION "READ" "Read" [(,READBIT REACH AOBJS ROBJS TRY)

;"restrictions on characteristics and location of objects for defaulting - filling in an unadorned `READ' command. The object must be readable and accessible."

["READ" READER] DRIVER] ;"READER is the function, and the form `READ object' is

preferred (the `driver')" [(,READBIT REACH AOBJS ROBJS TRY) "WITH" OBJ ["READ" READER]] ;"specification for `READ obj1 WITH obj2'"

[(,READBIT REACH AOBJS ROBJS TRY) "THROU" OBJ ["READ" READER]] ;"specification for `READ obj1 THROUGH obj2'">;“

Synonyms for READ:"<VSYNONYM "READ" "SKIM">;"READER is the general reading function:“

Page 16: 1 Interactive Fiction and Natural Language Processing David J. Snyder

16

ZORK Verb (cont)DEFINE READER ( )

<COND (<NOT <LIT?,HERE>> ;"There must be light to read." <TELL "It is impossible to read in the dark."<) (<AND <NOT <EMPTY? <PRSI>>>

;"<PRSI> is the indirect object. If there is one, the player is trying to use something as a magnifying glass."

<NOT <TRNN <PRSI>,TRANSBIT>> ;"If so, it better be transparent!"> <TELL "How does one look through a " 1 <ODESC2 <PRSI>> "?">

;"It failed the test, so print sarcasm") (<NOT <TRNN <PRSO>,READBIT>>

;"The direct object should be readable." <TELL "How can I read a " 1 <ODESC2 <PRSO>> "?">

;"It's not.") (<OBJECT-ACTION>

;"Now the object read gets a chance.") (ELSE ;"It didn't handle it, so print text."

<TELL <OREAD <PRSO>>,LONG-TELL1>)>>

Leibling, Blank, Anderson. 1979

Page 17: 1 Interactive Fiction and Natural Language Processing David J. Snyder

17

Infocom GamesArthur: The Quest for Excalibur(1989) Planetfall (1983)Ballyhoo(1986) Plundered Hearts (1987)Beyond Zork: The Coconut of Quendor (1987) Seastalker (1984)Border Zone (1987) Sherlock: The Riddle of the Crown Jewels (1987)Bureaucracy (1987) Sorcerer (1984)Cutthroats (1984) Spellbreaker (1985)Deadline (1982) Starcross (1982)Enchanter (1983) Stationfall (1987)Hitchhiker’s Guide to the Galaxy (1984) Suspect (1984)Hollywood Hijinx (1986) Suspended (1983)Infidel (1983) Trinity (1986)James Clavell’s Shogun (1989) Wishbringer (1985)Journey: The Quest Begins (1989) Witness (1983)Leather Goddesses of Phobos (1986) Zork I (1980)The Lurking Horror (1987) Zork II (1981)A Mind Forever Voyaging (1985) Zork III (1982)Moonmist (1986) Zork Zero (1988)Nord and Bert Couldn’t Make Head Or Tail Of It (1987)

Montfort. 2003Page 122-124

Page 18: 1 Interactive Fiction and Natural Language Processing David J. Snyder

18

The OZ Project

The OZ Project was a research program out of Carnegie Mellon dedicated to the development of Interactive Drama.

“We use the phrase ``interactive drama'' to mean the presentation by computers of rich, highly interactive worlds, inhabited by dynamic and complex characters, and shaped by aesthetically pleasing stories….

`highly interactive’ indicates the interactor is choosing what to do, say, and think at all times…”

Kelso, Margaret Thomas, Peter Weyhrauch and Joseph Bates. 1992“Dramatic Presenence”Technical Report CMU-CS-92-195 School of Computer ScienceCarnegie Mellon UniversityPittsburgh, PA, DecemberOriginally appeared in PRESENCE- The Journal of Teleoperators and

Virtual Environments 2:1http://www-2.cs.cmu.edu/afs/cs.cmu.edu/project/oz/web/papers/CMU-CS-92.195.posExcerpt at http://www-2.cs.cmu.edu/afs/cs.cmu.edu/project/oz/web/overview2.htmlApril 12, 2005

Page 19: 1 Interactive Fiction and Natural Language Processing David J. Snyder

19

High Level View of OZ

Matteas, Michael. 1997An Oz-Centric Review of Interactive Drama and Believable AgentsTechnical Report CMU-CS-97-156School of Computer ScienceCarnegie Mellon UniversityPittsburgh, PA. Junehttp://www-2.cs.cmu.edu/afs/cs.cmu.edu/project/oz/web/papers/CMU-CS-97-156.htmlApril 11, 2005

Page 20: 1 Interactive Fiction and Natural Language Processing David J. Snyder

20

Believable Agents “In an interactive environment, eccentric

personalities … cover up … limitations.” “(Joseph) Bates (of Oz) recommends modeling … after … the highly engaging characters of cartoons, comics, and the theater of the absurd.”

Graceful degradation- “unanswerable questions are handled in a way that neither halts the conversation nor break’s the user’s willing suspension of disbelief.”

Ryan, Marie-Laure. 2001Narrative as Virtual RealityBaltimore: The Johns Hopkins University PressPage 314

Page 21: 1 Interactive Fiction and Natural Language Processing David J. Snyder

21

Believable Agents – other issues “Incomplete or Ungrammatical Input” Failure- “Can have personality specific effects…

Misunderstanding is expected.” Consistency – “It would be difficult to accept as believable

an agent that says things it cannot understand.”Loyall, A. Bryan. 1997“Some Requirements and Approaches for Natural Language in a Believable Agent”Creating Personalities for Synthetic Actors: Towards Autonomous Personality Agents(Lecture notes in computer science; 1195 : Lecture notes in artificial intelligence)Robert Trappl; Paola Petta (Eds.)New York: SpringerPages 117-118

Page 22: 1 Interactive Fiction and Natural Language Processing David J. Snyder

22

ELIZA Effect “the tendency for people to treat programs that respond to them (people) as if they

(programs) had more intelligence than they (programs) really do.”

“People who knew very well that they were conversing with a machine soon forgot that fact, just as theater goers, in the grip of suspended disbelief, soon forget that the action they are witnessing is not ‘real’…. They would often demand to be permitted to converse with the system in private, and would, after conversing with it for a time, insist, in spite of my explanations, that the machine really understood them.”

Stern, Andrew. 2002“Virtual Babyz: Believable agents with Narrative Intelligence”Narrative IntelligenceMichael Mateas and Phoebe Sengers (Eds.)Philadelphia: Benjamins Publishing CompanyPage 217

Weizenbaum, Joseph. 1976Computer Power and Human ReasonSan Francisco: W.H. Freeman and CompanyPage 189

Page 23: 1 Interactive Fiction and Natural Language Processing David J. Snyder

23

ELIZA Transcript“Do you think that I can use the computer this morning?WHY DO YOU ASK?I might be able some additional telcomp sales.WHY AREN’T YOU SURE?My prospective customers have never seen a demonstration of the system.DOES THIS MEAN VERY MUCH TO YOU?Of course it does.YOU SEEM VERY POSITIVE ABOUT THAT.This is ridiculous.WHAT DO YOU MEAN THIS IS RIDICULOUS?Is there any reason why I can’t use the computer now?TELL ME MORE ABOUT YOUR PROSPECTIVE CUSTOMERS.Please dial me up on 491-1850”

Murray, Janet. 1997Hamlet on the Holodeck: The Future of Narrative in CyberspaceNew York: Free PressPage 70

As reported by Daniel G. Bobrow of Bolt Beranak and Newman (BBN) in the December 1968 issue of the SIGART Newsletter

Murray. 1997page 289

Page 24: 1 Interactive Fiction and Natural Language Processing David J. Snyder

24

Façade: an experiment in interactive drama

“In Façade, you, the player, using your own name and gender, play the character of a long-time friend of Grace and Trip, an attractive and materially successful couple in their early thirties. During an evening get-together at their apartment that quickly turns ugly, you become entangled in the high-conflict dissolution of Grace and Trip’s marriage. No one is safe as the accusations fly, sides are taken and irreversible decisions are forced to be made. By the end of this intense one-act play you will have changed the course of Grace and Trip’s lives – motivating you to replay the drama to find out how your interaction could make things turn out differently the next time.”

Matteas, Micheal and Andrew Stern. 2003Façade: An Experiment in Building a Fully-Realized Interactive DramaGame Developers Conference, Game Design Track, Marchhttp://www.quvu.net/interactivestory.net/papers/MateasSternGDC03.pdfApril 12, 2005

Page 25: 1 Interactive Fiction and Natural Language Processing David J. Snyder

25

Trip and Grace

Matteas and Stern. 2003

Page 26: 1 Interactive Fiction and Natural Language Processing David J. Snyder

26

Façade - Goals 15-20 minutes of “emotionally intense,

unified, dramatic, action.” Player should not be just an observer, but

should have a significant effect on events without obvious branch points (like a Choose Your Own Adventure or hypertext would have.)

Should be repeatable 6-7 times without player necessarily feeling s/he has exhausted all the possibilities

Matteas and Stern. 2003

Page 27: 1 Interactive Fiction and Natural Language Processing David J. Snyder

27

Façade Player interacts through movement and some gestures

using the mouse and through typing in spoken dialog. Characters respond with spoken dialog and actions.

Drama manager controls story beats. Changed about once a minute.

Players actions are interpreted as “discourse acts”, “a concise summary of the general meaning”. These discourse acts are interpreted differently depending on the beat and effect the choice of future beats.

Matteas and Stern. 2003

Page 28: 1 Interactive Fiction and Natural Language Processing David J. Snyder

28

Discourse Acts

Most have an option to refer to a character.“agree referTo <topic> intimatedisagree praise judgmentpositive exclamation ally suggestionAdvicenegative exclamation criticize light misc-customexpress happy criticize harsh

destructiveManipulationexpress laugh oppose jokeTestLimitsexpress sad flirt inappropriateexpress angry pacify bugmaybeUnsure provoke comfortdontUnderstand greet kissthank goodbye physicallyFavorapologizeExcuseMe getAttention wanderAway”Matteas and Stern 2002

Page 15

Unrecognizable text maps to a discourse act “systemDoesNotUnderstand”

Matteas and Stern 2002Page 16

Page 29: 1 Interactive Fiction and Natural Language Processing David J. Snyder

29

Façade – Natural Language Understanding

Understanding is Broad and Shallow. Not concerned with syntax or semantics, but with the pragmatic effects.

Phase 1 turns surface text into discourse acts. Phase 1 rules are generally shared across all beats. Rules map “islands” of text.

Phase 2 determines what effect the discourse act has on behavior of the characters

 Mateas, Michael and Andrew Stern. 2004“Natural Language Understanding in Façade: Surface Text Processing”Best Paper Award, Technologies for Interactive Digital Storytelling and Entertainment (TIDSE),, Darmstadt, Germany, JunePage 2http://www.quvu.net/interactivestory.net/papers/MateasSternTIDSE04.pdfApril 11, 2005

Page 30: 1 Interactive Fiction and Natural Language Processing David J. Snyder

30

Pattern Sub-language(X Y) exactly X and Y

(X | Y) exactly X or Y

([X]) optional

* Many words

? One word

(tand X Y) X and Y in the string in any order

(tor X Y) X or Y in the string

(toc X) X in the string

(tnot X) X not in the string

Basically regular expressions with some shortcuts to allow easy typing.Mateas and Stern. 2004Page 5

Page 31: 1 Interactive Fiction and Natural Language Processing David J. Snyder

31

Template Language;; A template rule for agreement

(defrule global-agree-rule1

(template (toc (love (to | it | that))))

=>

(assert (iAgree)))

iAgree will combine with other rules to determine addressed (potentially none) to produce DAAgree

Mateas and Stern. 2004Page 5

Page 32: 1 Interactive Fiction and Natural Language Processing David J. Snyder

32

Positional FactsRules can provide positional information about where the match occurs.

;;Rule for recognitional positional “is” fact(defrule positional_Is

(template (tor am are is seem seems sound sounds look looks))=>

(assert (iIs ?startpos ?endpos)))

;;Rule for recognizing positional “positive description fact(defrule positional_PersonalPosDesc

(template (tor buddy comrade confidant friend genius go-getter pal sweetheart))=>

(assert (iPersonalPosDesc ?startpos ?endpos))

;; Rule for recognizing praise(defrule Praise_you_are_PersonPOs

(template ({iPersonPosDesc} | (you [{iIs}] [a|my] {iPersonPosDesc} *)))=>

(assert (iPraise)))

Mateas and Stern. 2004Page 7

Page 33: 1 Interactive Fiction and Natural Language Processing David J. Snyder

33

Sample Rules

Processing “Hello, Grace”

Pseudocode:“hello” iGreet“grace” iCharacter(Grace)iGreet and iCharacter(?x) DAGreet(?x) means DAGreet(Grace)

Additional iGreet rules would be written for other greetings than hello.

Mateas and Stern. 2004Page 3

Mateas and Stern. 2004Page 2

Page 34: 1 Interactive Fiction and Natural Language Processing David J. Snyder

34

Rules Additional Rules can be specified to use WORDNET for

synonym and hyponym relationships. For example, a rule could apply to “alcoholic beverage” and if you said “I’d like some Chablis”, the parser would determine that “Chablis” is a kind of wine which is a kind of alcoholic beverage and that rule potentially applies.

Rules can also support stemming.

Mateas, Michael and Andrew Stern. 2002“Architecture, Authorial Idioms and Early Observations of the Interactive Drama Façade “CMU-CS-02-198December 5, 2002http://reports-archive.adm.cs.cmu.edu/anon/2002/CMU-CS-02-198.pdfPage 16April 11, 2005

Page 35: 1 Interactive Fiction and Natural Language Processing David J. Snyder

35

Rule Ranking• First tier of rules handle low-level patterns (like is

rule)• Second tier handles idiomatic expressions

(~1000 pertinent to the domain)• Third tier handles negation• Final tier looks for key words and combinations

(like in positional example) to produce final discourse act.

Mateas and Stern. 2004Page 9

Page 36: 1 Interactive Fiction and Natural Language Processing David J. Snyder

36

Rules

~800 template rules compile to ~6800 internal rules

Rules “err on the side of being overly permissive.” Statements made by players may be misinterpreted and the characters aren’t going to be correcting anyone’s grammar.

Mateas and Stern. 2004Page 7

Matteas and Stern 2002Page 28

Page 37: 1 Interactive Fiction and Natural Language Processing David J. Snyder

37

Discourse Act Examples(DAAgree ?char) Certainly. No doubt. I would love to.

(DADisagree ?char) No way. Fat chance. Get real. Not by a long shot.

(DAPositiveExcl ?char) Yeah. Wow. Breath of fresh air.

(DANegExcl ?char) Damn. That really sucks. How awful. D’oh.

(DAExpress ?char ?type) I’m thrilled. That bums me out.

ha ha (laughter) It really pisses me off (angry)

(DAMaybeUnsure ?char) I don’t know. Maybe. I guess so. You’ve lost me.

(DaThank ?char) Thanks a lot

(DaGreet ?char) Hello. What’s up.

(DAAlly ?char) I like you. You are my friend. I’m here for you.

(DAOppose ?char) Kiss off. You’re the worst. I hate you.

(DADontUnderstand ?char)I’m confused. I don’t get it. What are you talking about.

Mateas and Stern. 2004Page 3

Page 38: 1 Interactive Fiction and Natural Language Processing David J. Snyder

38

Discourse Act Examples (cont)(DAApologize ?char) I’m sorry. My bad. How can I make this up to you.

(DAPraise ?char) You’re a genius. What a sweetheart you are.

(DACriticize ?char ?level) You’re weird. (light) What a dipshit. (harsh)

(DAFlirt ?char) You look gorgeous. Kiss me.

(DAPacify ?char) Calm down. Relax, guys. Take it easy.

(DAExplain ?param ?char) Grace is lying. Trip is having an affair.

(DAAdvice ?param ?char) You should get a divorce. Try to work it out.

(DAReferTo ?char ?obj) I like the couch. Your wedding picture looks nice.

(DAIntimate ?char) What’s wrong? Let it all out. Talk to me.

(DAGoodbye ?char) Catch you later. So long. I’m out of here.

(DAInappapriate ?char) “slut”

(DAMisc ?char ?type) I’d like a drink. Is this a bad time. Should I leave.

Mateas and Stern. 2004Page 4

Page 39: 1 Interactive Fiction and Natural Language Processing David J. Snyder

39

Phase 2

Reaction rules map discourse acts to reaction. Unlike the phase 1 rules, the templates for

reaction rules are beat-specific. There also some shared global context. Each beat maps some or all ~40 discourse acts

to 5-10 local reactions.

Matteas and Stern 2002Page 16-17

Page 40: 1 Interactive Fiction and Natural Language Processing David J. Snyder

40

Typical ReactionsLocal

“Player is mildly agreeing with the question/situation posed to her in this beat.

Player is strongly agreeing with the question/situation posed to her in this beat.Player is mildly disagreeing with the question/situation posed to her in this beat.Player is strongly disagreeing with the question/situation posed to her in this beat.Player is not giving a direct answer to the question/situation posed to her in this beat.”

Global - hundreds“Player has referred to an object in the roomPlayer has done an affinitity move (e.g. praise, criticize, flirt)Player has referred to a related topic (e.g. marriage, divorce, infidelity)Player had repetitively pushed on a topic.Player has referred to the content of a previous beat.”

If no reaction applies, system must deflect.

Matteas and Stern 2002Page 16-17

Page 41: 1 Interactive Fiction and Natural Language Processing David J. Snyder

41

Beats Each Beat has “goals” and a “gist”. The gist generally

occurs when all beat goals have been met. Before a gist occurs, reactions are consider “mixins”,

causing the characters to react but not resolving the beat. After a beat gist occurs, one reaction will be a “transition-

out.” There is one transition-out per beat. Mixins and transitions-out may have effect global state. To handle interrupts, beat goals have “repeat dialog

alternatives” and “reestablish” dialog. “Drama manager” aka “beat sequencer” chooses next

beat based on rules and interactions.

Matteas and Stern 2002Page 17-19

Page 42: 1 Interactive Fiction and Natural Language Processing David J. Snyder

42

Trip and Grace

Matteas and Stern. 2003

Page 43: 1 Interactive Fiction and Natural Language Processing David J. Snyder

43

INFORM

INFORM is one of the languages most commonly used by Text Adventure hobbyists today. It produces code that runs on the same virtual “Z-Machine” that was used to run ZORK and various other Infocom games when they were released commercially.

Nelson, Graham. 2001The Inform Designers ManualFourth EditionSt Charles, IL: The Interactive Fiction Libraryhttp://www.inform-fiction.org/manual/DM4.pdfApril 10, 2005Page I

Page 44: 1 Interactive Fiction and Natural Language Processing David J. Snyder

44

Inform Parser Grammar COMMAND <oops-word><word> | <action phrase> | <order><oops-word> “oops” | “o”<order> <actor> “,” <action phrase><actor> <noun phrase><action phrase> <verb phrase> | <verb phrase> <then-word> <action phrase><then-word> “.” | “then”<verb phrase> <again-word> | <imperative verb> <grammar line><again-word> “again” | “g”<grammar line> <noun phrase > | <preposition> <noun phrase> |<grammar line> <noun phrase> <preposition> <noun phrase> | …<preposition> “on” | “under” …<noun phrase> <basic np> | <basic np> <connective> <noun phrase>|…<connective> <and-word> | <conjuction> | <but-word> <disjunction><and-word> “,” | “and”<but-word> “but”| “except”

Nelson. 2001pages 245-246, 250

Page 45: 1 Interactive Fiction and Natural Language Processing David J. Snyder

45

Inform ParseParse of sentence “conan, put every sword in the box”

Nelson. 2001pages 250

Page 46: 1 Interactive Fiction and Natural Language Processing David J. Snyder

46

Links and Resources Interactive Fiction Archive- http://www.ifarchive.org ZORK- http://www.infocom-if.org/downloads/downloads.html Hitchhiker’s Guide to the Galaxy-

http://www.bbc.co.uk/radio4/hitchhikers/game.shtml Hamlet- The Text Adventure-

http://www.robinjohnson.f9.co.uk/adventure/hamlet.html Façade (coming soon,

hopefully)-http://www.quvu.net/interactivestory.net Group Blog- http://www.grandtextauto.org Rec.arts.int-fiction and Rec.games.int-fiction