Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Games as Conversational Interfaces Workshop

Games as Conversational Interfaces Workshop

Presented at Node.js Interactive North America, November 30, 2016.

Kevin Zurawel

November 30, 2016
Tweet

More Decks by Kevin Zurawel

Other Decks in Programming

Transcript

  1. Will Crowther
 Colossal Cave Adventure
 (1975) By Nancyscrowther - Own

    work, CC0
 https://commons.wikimedia.org/w/index.php?curid=25991397
  2. You are in a small chamber beneath a 3x3 steel

    grate to the surface. A low crawl over cobbles leads inward to the West. The grate is open. > go west You are crawling over cobbles in a low passage. There is a dim light at the east end of the passage. There is a small wicker cage discarded nearby. > take cage Ok. >
  3. “It’s estimated that Adventure set the entire computer industry back

    two weeks.” - Tim Anderson,
 “The New Zork Times”, Winter 1985
  4. “It’s a program that sort of reacts to people… here

    was a thing that gave you the illusion, anyway, that you’d typed in English commands and it did what you said. And of course, behind it all was just a machine doing little things.” - Will Crowther
  5. TADS 3.1.3 (2013) • “The second most commonly used IF

    language” • Object-oriented programming language • Web server/client capabilities (“Web Play”) • Built-in conversation system
  6. ?

  7. ?

  8. TADS 3 Objects startRoom: OutdoorRoom roomName = 'Outside Cottage' desc

    = "You are standing in front of a brightly-painted cottage. " south = forest ;
  9. startRoom: OutdoorRoom roomName = 'Outside Cottage' desc = "You are

    standing in front of a brightly-painted cottage. " south = forest ; Object name Class inheritance list Close object with semicolon!
  10. heavyDesk: Surface, Fixture vocabWords = 'heavy wood desk/table' location =

    'cottage' dobjFor(Kick) { action() { "Your foot hurts. That desk is heavy! " } } ; Object name Class inheritance list Close object with semicolon! A method
  11. Object Templates Shortcuts for specifying commonly-used properties: startRoom: OutdoorRoom ‘Outside

    Cottage' "You are surrounded by trees in all directions. " ; name desc
  12. Containment forest: OutdoorRoom 'spooky forest' "You are standing in the

    middle of a spooky forest. It is dark. " ; + skull: Thing 'human skull' "A human skull, apparently?" ;
  13. The Four Main Conversational Actions •ask [X] about [Y] •tell

    [X] about [Y] •give [Y] to [X] •show [Y] to [X]
  14. Actors forest: OutdoorRoom 'spooky dark forest' "A dark and spooky

    forest. Why did you come here again? " ; + me: Actor ; + talkingWolf: Actor ;
  15. Topics talkingWolf: Actor
 ; + AskTopic @grandma "<q>Have you seen

    my grandmother?</q> <.p>The wolf pauses. <q>Hmm, doesn't sound familiar…</q> You think you see the start of a smile on its face." ;
  16. In action > ask wolf about grandma "Have you seen

    my grandmother?" The wolf pauses. "Hmm, doesn't sound familiar…" You think you see the start of a smile on its face. >
  17. Topics that are not game objects weatherTopic: Topic ‘sunny nice

    weather’; wolf: Actor; + TellTopic @weatherTopic “<q>Lovely weather we’ve been having, no?</q>, you say.” ;
  18. > tell wolf about weather “Lovely weather we’ve been having,

    no?”, you say. The wolf snorts. “I suppose.” >
  19. > ask wolf about grandma "Have you seen my grandmother?"

    The wolf pauses. "Hmm, doesn't sound familiar…" You think you see the start of a smile on its face. > ask wolf about grandma "Have you seen my grandmother?" The wolf pauses. "Hmm, doesn't sound familiar…" You think you see The repetition problem
  20. Varying output with response lists + AskTopic, StopEventList @grandma ['<q>Have

    you seen my grandmother?</q>
 …', '<q>Are you quite certain?</q>, you say, before describing your grandmother to the wolf.', 'The wolf has nothing further to say.' ] ;
  21. > ask wolf about grandma "Have you seen my grandmother?"

    The wolf pauses. "Hmm, doesn't sound familiar…" You think you see the start of a smile on its face. > ask wolf about grandma "Are you quite certain?", you say, before describing your grandmother to the wolf.
 "Now that you mention it…"
  22. Adding randomness + AskTopic, ShuffledEventList @grandma ['<q>Have you seen my

    grandmother?</q>
 …', '<q>I'm looking for an elderly woman. </q> You describe your grandmother to the wolf, who listens intently.', '<q>Excuse me</q>, you say. <q>I’m looking for my grandmother...</q>' ] ;
  23. Dealing with questions we didn't expect + DefaultAskTopic "The wolf

    looks at you quizzically. <q>I have no idea what you're talking about.</q>" ;
  24. Suggesting topics to the user + AskTopic, SuggestedAskTopic @grandma “<q>Your

    grandmother is missing, you say?</q> says the wolf.” name = ‘your grandmother’ timesToSuggest = 3 ;
  25. Using alternate topic entries + AskTopic @grandma // the usual

    response ; ++ AltTopic "The wolf looks aghast. <q>You think <i>I</i> kidnapped her?</q>” isActive = player.hasSeen(ransom_note) ;
  26. Keeping track of what is known + AskTopic @otherPeople “<q>Did

    you see anyone else? </q>, you ask. <q>Yes, a hunter came through earlier,</q> the wolf says.<.reveal hunter>” ;
  27. Keeping track of what is known + AskTopic @hunter “The

    wolf looks puzzled.” ; ++ AltTopic “<q>Oh yes, the hunter...</q>” isActive = gRevealed(‘hunter’) ;
  28. > ask wolf about hunter The wolf looks puzzled. >

    ask wolf about other people "Did you see anyone else?", you ask. // hunter revealed > ask wolf about hunter "Oh yes, the hunter..."
  29. Grouping alternate topics + TopicGroup isActive = wolf.isSurprised; ++ AskTopic

    @grandma ; ++ AskTopic @ransom_note ; + TopicGroup isActive = wolf.frightened; ++ AskTopic @grandma ;
  30. > tell man about hair "Your hair is on fire!",

    you shout. "AHHHHH!" The man starts running around frantically. > tell man about weather "Lovely weather we're having, eh?" "Oh yes, definitely. So nice."
  31. Better grouping: Actor States + wolfDefault: ActorState isInitState = true

    specialDesc = “The wolf is sitting.” ; + wolfSurprised: ActorState specialDesc = “The wolf looks surprised.” ;
  32. Transitioning between ActorStates + wolfDefault: ActorState isInitState = true ;

    ++ AskTopic @grandma topicResponse { “<q>Have you seen my grandmother?</q>” wolf.setCurState(wolfFrightened); } ;
  33. Start Hunter Defensive show ransom note to wolf ask wolf

    about hunter ask wolf about grandma "I saw the hunter carry
 her away!" "How dare you accuse me of kidnapping her!" ask wolf about eating people tell wolf about footprints
  34. “Galatea”, Emily Short (2000) “Galatea is my first released foray

    into interactive fiction. It is a single conversation with a single character, which can end any of a number of ways depending on the player's decisions. Despite its age, I continue to get strong reactions to it in my email inbox on a fairly regular basis. Some people love it; some people find it annoying or distressing. “
  35. 1. examine placard 2. ask galatea about thasos 3. ask

    galatea about gods 4. ask galatea about muses 5. ask galatea about apollo 6. ask galatea about dionysus 7. ask galatea about bonds 8. ask galatea about inhibition 9. ask galatea about pain 10. galatea, pray to dionysus 1. examine galatea 2. ask galatea about herself 3. read placard 4. ask galatea about pygmalion 5. ask galatea about loneliness 6. ask galatea about suicide 7. think about galatea 8. touch galatea 9. touch dress 10. ask galatea about dress 11. ask galatea about owners 12. ask galatea about backdrop 13. examine cheek 14. touch cheek 15. ask galatea about carving 16. ask galatea about pain 17. ask galatea about polish 18. ask galatea about artist 19. ask galatea about love 1. examine galatea 2. say hello to galatea 3. examine dress 4. ask galatea about artist 5. ask galatea about waking 6. ask galatea about fits 7. ask galatea about nightmares 8. ask galatea about shades 9. ask galatea about afterlife 10. ask galatea about gods 11. ask galatea about apollo 12. ask galatea about dionysus 13. ask galatea about illusions 14. ask galatea about masks
  36. 1. examine placard 2. ask galatea about thasos 3. ask

    galatea about gods 4. ask galatea about muses 5. ask galatea about apollo 6. ask galatea about dionysus 7. ask galatea about bonds 8. ask galatea about inhibition 9. ask galatea about pain 10. galatea, pray to dionysus 1. examine galatea 2. ask galatea about herself 3. read placard 4. ask galatea about pygmalion 5. ask galatea about loneliness 6. ask galatea about suicide 7. think about galatea 8. touch galatea 9. touch dress 10. ask galatea about dress 11. ask galatea about owners 12. ask galatea about backdrop 13. examine cheek 14. touch cheek 15. ask galatea about carving 16.ask galatea about pain 17. ask galatea about polish 18.ask galatea about artist 19. ask galatea about love 1. examine galatea 2. say hello to galatea 3. examine dress 4. ask galatea about artist 5. ask galatea about waking 6. ask galatea about fits 7. ask galatea about nightmares 8. ask galatea about shades 9. ask galatea about afterlife 10.ask galatea about gods 11.ask galatea about apollo 12.ask galatea about dionysus 13. ask galatea about illusions 14. ask galatea about masks
  37. Conversational Nodes + ConvNode ‘accuseWolf’; ++ AskTellTopic @grandma “<q>I know

    you did it! Where is my grandmother?</q>, you shout. The wolf snarls.” ;
  38. Conversational Nodes + TellTopic @ransomNote “<q>There was a note in

    her bedroom </q>, you say. <q>It looks like your handwriting. Why would that be?</q> The wolf is silent. <.convnode accuseWolf>” ;
  39. Asking Yes/No Questions “<q>Are you sure you want know?</q>, the

    wolf asks.<.convnode confirmReveal>” ; + ConvNode ‘confirmReveal’; ++ YesTopic “<q>Ok; you’re not going to like it.</q>” ; ++ NoTopic “<q>Some things are better left unsaid.</q>” ;
  40. > ask wolf about grandma “Are you sure you want

    to hear what I know?”, the wolf asks. > yes “Ok; you’re not going to like it.”
  41. Gating the user's progress + ConvNode 'importantChoice'; ++ YesTopic ;

    ++ NoTopic ; ++ DefaultTopic "<q>Seriously, yes or no?</q><.convstay>" ;
  42. "So what's it going to be, yes or no?" >

    ask about weather "Seriously, yes or no?" >
  43. Answering Actor Questions + ConvNode 'searchChoice'; ++ SpecialTopic 'search in

    the forest' ['forest'] "<q>Alright, we'll start in the forest.</q>" ; ++ SpecialTopic 'search underground' ['underground'] "<q>Underground it is.</q>"
  44. "She could be in the forest or underground. Where do

    we look first?" (You could search the forest, or search underground.) > forest "Alright, we'll start in the forest."
  45. Greeting Protocols + InConversationState specialDesc = “The wolf is listening

    to you talk.” ; ++ ConversationReadyState specialDesc = “The wolf is watching you, waiting for you to talk to it.” ;
  46. Actor-Initiated Conversations wolf.initiateConversation(nil, 'wolfHelp'); + ConvNode 'wolfHelp' npcGreetingMsg = "The

    wolf gets your attention. <q>You seem distressed,</q> it says. <q>Do you want me to help you look for your grandmother?<.convnode askForHelp>" ;
  47. Agendas + ConvAgendaItem isReady = (inherited() && rand(100) < 33)

    isDone = (gRevealed('hunter')) invokeItem() { "The wolf starts talking. <q>You know, I saw a hunter come through here not an hour ago...</q><.reveal hunter>" } ;
  48. The "combinatorial explosion" problem "The interconnectedness of all things in

    the model world… requires that the author think of every single combination that could validly apply, which is not a reasonable thing to expect from a human writer: A game with 100 objects provides almost five thousand (4,950) potential one-on-one object interactions." TVTropes.org
  49. Resources • TADS • Creating Dynamic Characters in TADS3 •

    Inform7 • Emily Short’s Interactive Storytelling • Vorple (web-based Z-Machine interpreter) • Twine, inklewriter, Undum (CYOA frameworks) • “Somewhere Nearby is Colossal Cave”, Dennis G. Jerz