Modeling conversation flow: transitions in player speech

[This is part of a series of discussions on the craft of modeling conversation. For previous installments, see my original Homer in Silicon article which lays out the basic elements of the model, and previous blog posts on NPC initiative and subject changes.]

One of the issues that has already appeared several times in these posts is the idea of the transition: how do we produce smooth, plausible segues from one bit of speech to another?

In the present model, the NPC’s responses are generally written to go with the player comment that led into them, and we’ve already looked a little at the way the system creates transition text when the NPC wants to introduce a new topic of conversation.

The remaining area of concern is the transition from whatever the NPC last said to the player’s next comment, which appears at a turn break:

PC comments
NPC replies
> (player’s command)
PC comments again
NPC replies

Because the conversation model already encourages the player to choose quips that are at least generally relevant to whatever is already under discussion, this break is usually not too startling; and if the player is genuinely bringing in something from left field, we can acknowledge that by having the NPC react to a change of subject.

Sometimes, though, we want the quip to be worded a bit differently depending on which text exactly went before. For instance:

(After some generic conversation…)

“I wonder whether Fred Dinkins is going to make it to the altar,” you comment. “When I saw him this morning he looked strangely grim.”

“Oh, Fred’ll be all right. He’s always been nervous about being the center of attention, but he’s very much in love.”


“Sorry I’m late — I’ve just been chatting with Fred Dinkins,” says Mrs. Cooper.

“Doubt he’ll make it to the altar,” you remark. “He looked strangely grim this morning.”

“Oh, Fred’ll be all right. He’s always been nervous about being the center of attention, but he’s very much in love.”

It’s easy to implement this kind of thing with some conditional text in the player’s comment, as long as we have the right information in our model to start with.

Here are three transition effects, in order of how commonly I find them useful:

Segues from specific other quips. Because the conversation model records the last quip used, we can write conversation quips that start with something like

[if the previous quip is asking about dinkins]blah [otherwise]foobar [end if]

to create hand-made transitions. This would be a lot of work to do across the board, but of course in many many cases it’s not necessary; it’s just a nice touch in specific instances.

(Technical tangent particular to my system: Alabaster’s threaded conversation model relies on having many of its quips set to “directly follow” or “indirectly follow” other quips. If quip B directly follows quip A, that means it may only be spoken on the turn following A. If it indirectly follows A, that means it may be spoken on the turn following or later on. By keeping track of the tree of quips that follow one another, the system constructs a model of how the conversation is shaped; and a quip that has no followers is a dead end, the end of a thread. Consequently, the conversation system has a shorthand syntax for the very common situation where we want to give one transition if the player chooses the A-B path, and another if the player chooses A-other stuff-B.)

Segues based on subject matter. In this model, quips are associated with subjects — sometimes abstractions, sometimes actual things in the game world such as other characters or important props. That means that we might write transition text differently depending on whether the new quip being spoken shares any subjects with the previous quip (and which those are). So we could use

[if the previous quip mentions Dinkins]On the subject of Fred...
[otherwise if previous quip mentions weddings]Speaking of weddings...
[end if]

to get

“Fred and I were just chatting outside,” Mrs. Cooper remarks.

“On the subject of Fred, do you suppose he’s going to make it through his wedding without falling over?”


“I was at my cousin’s wedding last weekend…” says Mrs. Cooper.

“Speaking of weddings,” you say, “do you suppose Fred’s going to make it through his without falling over?”

The results are a little less detailed but also a easier to apply broadly than the specific quip transition.

Pronouns internal to the conversation. Under some circumstances it may be worth tracking what the main pronouns (he, she, it, they) refer to within the context of conversation as opposed to in the world model. This allows the player not to repeat the proper name of the person just most recently spoken of.

To do this, I usually use a method similar to the one in the Plurality extension, and just create new global variables to represent the currently-discussed male, etc. Then I can use text substitution phrases to have the game print “He” (if we’re talking about the same person) or “Fred” (if we aren’t).

The downside to this is that it requires rigorous markup of quips to make sure that we’re noticing every proper name, and it’s possible to mess up in a way that makes the output confusing. So I tend to use this sparingly and only when I think the output sounds stilted otherwise.

11 thoughts on “Modeling conversation flow: transitions in player speech”

    1. Yeeeah. (If you’re curious, I was the “circular psuedo-intellectual prevarication” part of that sentence, which makes me wonder what he thought I was lying about. Oh well.)

      1. That blog is hilarious! A clearer example of resentment vainly disguising itself as aloof criticism there is not.

        Some gems from the top posts:

        “If I could burn the IFMUD to the ground, I would.”

        “One of the reasons why the Ifwiki blows chunks is that it’s run by a clique of little Stalinists who try to prescribe their opinion about things as fact.”

        “For daring to go against what the little Stalinists had decreed was truth immutable, my edits were flayed, I was personally attacked, and eventually, they took out what I wrote on the basis of majority vote.”

        (When did Stalinists adopt the principle of majority vote?)

        “the sick tide of masturbatory intellectualism and indie game developer snobbery”

        “The IF “community” never seems to miss a chance to shoot itself in the foot and then brag about it to the world.”

        All of this within four days. :) Queue Zarathustrian laughter!

      2. Er, well. My impression is that he’s looking for a specific emotional tone and a certain level of professional upkeep of resources, and not finding those things in the IF community. It also looks like that problem is compounded because he seems to interpret disagreement as hostility when it wasn’t intended that way. I’m not crazy about some of the things he’s said, and I think he’s mistaken in how he understands the group dynamics, but I don’t think it’s helpful to pick on him.

      3. I’m not sure your psychological interpretation is much more helpful than my laughter–which, being Zarathustrian, is free of all malice. :)

        (And indeed, I was speaking of the narrator of the blog, not of its author!)

      4. Okay. What I meant to be understood here was: Please do not make fun of other people on my blog.

        I’ll take your assurance that what you said was not intended to be meanspirited, however, and we can leave it at that.

      5. Your point is well taken. (I have tried to take the whole thing more seriously and write something helpful on the newsgroup.)

        Anyway, I wish to apologise for taking the comments-thread so far off-topic! I am enjoying this series of posts very much, and will certainly try to give you some feedback once I have had the time to think about it.

Leave a Reply to Andrew Plotkin Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s