§7.8. Saying Complicated Things

As we saw in the overview, there are challenges in choosing the commands with which the player will communicate to the story. Two common approaches are ASK/TELL conversation, where the player can ask or tell characters about keywords, as in ASK JILL ABOUT JACK or TELL FARMER ABOUT CHICKEN COOP, and menu-based conversation, where the player is offered a list of things to say and must pick one (often by number), as in

1) Ask Jill where Jack went.
2) Tell Jill that the chicken coop was robbed.

or, sometimes,

1) "Jill, have you seen your no-good layabout brother Jack anywhere?"
2) "Look, Farmer Jill, I think a fox got into the chickens."

The problem with ASK/TELL conversation is that it can feel undirected - if the player doesn't know which keywords to ask or tell about next, he gets stuck. It also doesn't always provide much sense of ongoing context or conversational flow, since the player can ask lots of unrelated questions and jump around a lot. What's more, sometimes the thing the player character asks isn't quite the question the player had in mind. If we type ASK JILL ABOUT JACK, Jill could wind up answering any of a number of questions - where Jack is, how old Jack is, whether Jack committed the recent murder, and so on. The player doesn't have much fine control over the conversation. Nonetheless, this is sometimes just what we want: Farewell implements a moderately sophisticated system along these lines, which keeps track of what the player has already said and allows him to review past conversation.

Menu-based conversation solves most of these problems: a branching tree of conversation choices maintains a consistent flow of discussion, it's hard for the player to run out of things to say, and the player always knows what his character is about to say. But there are compensating flaws. For one thing, a menu doesn't allow for many surprises. The player can see all the conversation the story has to offer by working methodically through all the menu branches. (This problem is sometimes referred to as the "lawnmower effect", since the process of seeing all the conversation is like the process of running a lawnmower over every inch of the lawn. It becomes a chore rather than an entertainment.) Menu systems can be long-winded to set up and therefore none are exemplified here, but several have been released as extensions for Inform.

Since about 2001, more and more IF has used a sort of compromise method: the player is allowed to ask or tell about keywords, but he's sometimes given prompts about things to say that follow naturally on the conversation he was just having, as in

You could ask where Jack is.

Moreover, when he asks about a topic where many comments are possible, he'll be allowed to clarify, either using a menu or through a disambiguation question such as

>ask Jill about Jack
Do you want to ask where Jack is, how old Jack is, or whether Jack committed the recent murder?

Sweeney implements one such hybrid type of conversation.

A third option is to take away almost all the player's expressiveness and give him just one command, TALK TO. The player can TALK TO characters whenever he wants, and the story will pick the most appropriate thing for him to talk about. This works best in works with few or simple puzzles and a fast-moving, constrained plot, where the player will keep having new things to talk about. Cheese-makers demonstrates this.

Finally, a few extreme games try to fake natural language understanding by looking for keywords in the player's input, rather than an exact grammar. This is perilous, because it is all too easy for the story to completely misunderstand what the player meant to type. Nonetheless, for the sake of example, see Complimentary Peanuts, in which the incomprehension is partly excused by the fact that the player is talking to someone a bit hard of hearing.


arrow-up.pngStart of Chapter 7: Other Characters
arrow-left.pngBack to §7.7. Saying Simple Things
arrow-right.pngOnward to §7.9. The Flow of Conversation

**ExampleFarewell
People who respond to conversational gambits, summarize what they said before if asked again, and provide recap of conversation that is past.

paste.png "Sweeney"

A subject is a kind of thing. Some subjects are defined by the Table of Conversation Subjects.

Table of Conversation Subjects

subject

conversation

pies

Table of Pie Queries

employment

Table of Job Queries

Understand "job" as employment. Understand "meat" or "food" as pies.

Table of Job Queries

quip

discussion

label

subtopics

"whether there is a job available here"

"'Say, are you hiring?' you ask, as casually as you can manage. [The interlocutor] looks you over dubiously. 'I might be hiring someone, but I can't say it would necessarily be you.'"

0

--

"what happened to that boy that worked here"

"'Tell me, didn't you used to have a young assistant working here?' She shrugs. 'Young men these days are so unstable. He left-- who knows where he's gone? I haven't seen hair or fingernail of him for weeks.'"

0

--

with 3 blank rows.

Table of Pie Queries

quip

discussion

label

subtopics

"what pie fillings are available"

"'What pies do you have in today, Mrs Lovett?' you ask. She starts, then smiles. 'Meat pies, of course.'"

0

Table of Pie Flavor Queries

with 3 blank rows.

Table of Pie Flavor Queries

quip

discussion

label

subtopics

"what kind of meat"

"'What kind of meat goes into these pies, Mrs Lovett?' you ask pressingly. She looks shifty. 'Whatever the butcher brings this week,' she says. 'With the price of meat what it is, when you get it, you have to be glad of what you can get. If you get it.'"

0

--

To copy (first table - a table name) to (second table - a table name):
    repeat through first table:
        let copied quip be "blank";
        if there is a quip entry, now the copied quip is the quip entry;
        let copied discussion be "blank";
        if there is a discussion entry, now the copied discussion is the discussion entry;
        let copied subtopics be second table;
        if there is a subtopics entry, now the copied subtopics are the subtopics entry;
        choose a blank row in the second table;
        if copied quip is not "blank", now quip entry is copied quip;
        if copied discussion is not "blank", now discussion entry is copied discussion;
        if copied subtopics is not second table, now subtopics entry is copied subtopics.

Current conversation table is a table name that varies. Current conversation table is Table of Job Queries.

Interlocutor is a person that varies.

Understand "ask [someone] about [any subject]" as asking it about the subject.

Asking it about the subject is an action applying to two visible things.

Carry out asking it about the subject:
    say "You can't think of anything to say."

Instead of asking someone about the subject a subject listed in the Table of Conversation Subjects:
    now interlocutor is noun;
    now current conversation table is the conversation of the second noun;
    if the number of filled rows in the current conversation table is 1:
        repeat through current conversation table:
            now label entry is 1;
        now number understood is 1;
        try selecting 1 instead;
    if the number of filled rows in the current conversation table is 0:
        say "You can think of nothing further to say on that topic.";
        stop the action;
    otherwise:
        let index be 0;
        let total be the number of filled rows in the current conversation table;
        say "Do you mean ";
        repeat through current conversation table:
            now index is index + 1;
            now label entry is index;
            say "([index]) [quip entry]";
            if index is total, say "?";
            if index is total - 1, say ", or ";
            if index is less than total - 1, say ", ".

Understand "[number]" as selecting.

Selecting is an action applying to one number.

Carry out selecting:
    say "No such option is available."

Instead of selecting a label listed in the current conversation table:
    say "[discussion entry][paragraph break]";
    if there is a subtopics entry:
        copy subtopics entry to current conversation table;
    choose row with label of number understood in the current conversation table;
    blank out the whole row.

Mrs Lovett's Meat Pies is a room. Mrs Lovett is a woman in Meat Pies.

Test me with "ask lovett about pies / ask lovett about employment / 1 / 2 / ask lovett about pies".

**ExampleSweeney
A conversation where each topic may have multiple questions and answers associated with it, and where a given exchange can lead to new additions to the list.

paste.png "Sweeney"

A subject is a kind of thing. Some subjects are defined by the Table of Conversation Subjects.

Table of Conversation Subjects

subject

conversation

pies

Table of Pie Queries

employment

Table of Job Queries

Understand "job" as employment. Understand "meat" or "food" as pies.

Table of Job Queries

quip

discussion

label

subtopics

"whether there is a job available here"

"'Say, are you hiring?' you ask, as casually as you can manage. [The interlocutor] looks you over dubiously. 'I might be hiring someone, but I can't say it would necessarily be you.'"

0

--

"what happened to that boy that worked here"

"'Tell me, didn't you used to have a young assistant working here?' She shrugs. 'Young men these days are so unstable. He left-- who knows where he's gone? I haven't seen hair or fingernail of him for weeks.'"

0

--

with 3 blank rows.

Table of Pie Queries

quip

discussion

label

subtopics

"what pie fillings are available"

"'What pies do you have in today, Mrs Lovett?' you ask. She starts, then smiles. 'Meat pies, of course.'"

0

Table of Pie Flavor Queries

with 3 blank rows.

Table of Pie Flavor Queries

quip

discussion

label

subtopics

"what kind of meat"

"'What kind of meat goes into these pies, Mrs Lovett?' you ask pressingly. She looks shifty. 'Whatever the butcher brings this week,' she says. 'With the price of meat what it is, when you get it, you have to be glad of what you can get. If you get it.'"

0

--

To copy (first table - a table name) to (second table - a table name):
    repeat through first table:
        let copied quip be "blank";
        if there is a quip entry, now the copied quip is the quip entry;
        let copied discussion be "blank";
        if there is a discussion entry, now the copied discussion is the discussion entry;
        let copied subtopics be second table;
        if there is a subtopics entry, now the copied subtopics are the subtopics entry;
        choose a blank row in the second table;
        if copied quip is not "blank", now quip entry is copied quip;
        if copied discussion is not "blank", now discussion entry is copied discussion;
        if copied subtopics is not second table, now subtopics entry is copied subtopics.

Current conversation table is a table name that varies. Current conversation table is Table of Job Queries.

Interlocutor is a person that varies.

Understand "ask [someone] about [any subject]" as asking it about the subject.

Asking it about the subject is an action applying to two visible things.

Carry out asking it about the subject:
    say "You can't think of anything to say."

Instead of asking someone about the subject a subject listed in the Table of Conversation Subjects:
    now interlocutor is noun;
    now current conversation table is the conversation of the second noun;
    if the number of filled rows in the current conversation table is 1:
        repeat through current conversation table:
            now label entry is 1;
        now number understood is 1;
        try selecting 1 instead;
    if the number of filled rows in the current conversation table is 0:
        say "You can think of nothing further to say on that topic.";
        stop the action;
    otherwise:
        let index be 0;
        let total be the number of filled rows in the current conversation table;
        say "Do you mean ";
        repeat through current conversation table:
            now index is index + 1;
            now label entry is index;
            say "([index]) [quip entry]";
            if index is total, say "?";
            if index is total - 1, say ", or ";
            if index is less than total - 1, say ", ".

Understand "[number]" as selecting.

Selecting is an action applying to one number.

Carry out selecting:
    say "No such option is available."

Instead of selecting a label listed in the current conversation table:
    say "[discussion entry][paragraph break]";
    if there is a subtopics entry:
        copy subtopics entry to current conversation table;
    choose row with label of number understood in the current conversation table;
    blank out the whole row.

Mrs Lovett's Meat Pies is a room. Mrs Lovett is a woman in Meat Pies.

Test me with "ask lovett about pies / ask lovett about employment / 1 / 2 / ask lovett about pies".

***ExampleCheese-makers
Scenes used to control the way a character reacts to conversation and comments, using a TALK TO command.

***ExampleComplimentary Peanuts
A character who responds to keywords in the player's instructions and remarks, even if there are other words included.