[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, and transitions in player speech.]
There’s a hacky moment in Alabaster to do with interruptions.
During one of the first moves of the game, you can ask Snow White about something while she’s waiting for an answer about whether you’re going to escort her to the forest. So, if you talk about something else instead, she gets angry and interrupts. In the first implementation, she waited for the subject-changing hook to object; but I didn’t like the effect of that, so I decided to have her actually interrupt the speech in progress. Whatever the player is saying, after the first few words, she’ll leap in: this is done by dumping the quip content to indexed text and running a regular expression to automatically detect a safe break-in point. This happens regardless of which question you’ve asked her (and there are dozens of possibilities). For instance:
“Why do you –”
She sets her jaw as she realizes you are changing the subject.
“–avoid the Queen’s mirror? Many of us have stood before it, and taken no harm.”
If you asked this under any other circumstance, this question would just print as “Why do you avoid the Queen’s mirror? …” without interference.
The strength of this is that it let me introduce this feature across dozens of possible quips the player might say here, without having to edit the quips themselves. As this sample demonstrates, though, the weakness is that the algorithm for producing break-in points is pretty basic. Here we have Snow White looking irritated before the gist of the player’s comment is really clear at all.
Still, sometimes it works a lot better, and I found that it was still more interesting than using the subject-changing hook to show her anger in this particular context, so I left it as it was.
I didn’t refine the interruption system further in Alabaster because I only wanted to use this effect once and didn’t want to significantly overhaul the system or tweak every single quip. In that context it didn’t seem worth doing, but I’ve given some more thought now and then to how this might be implemented better.
Let’s start from the assumption that we are not going to do a really rigorous implementation in which the code somehow models the informational content of every bit of spoken dialogue and generates the NPC’s reactions on a word-by-word basis, allowing the NPC to leap in and respond based on his knowledge and mood at absolutely any point in the player’s speech. That sounds awesome, but it totally breaks the existing quip-threading model: it becomes much more flexible for short-term effects, but loses the model features that contribute to coherent story-telling over multiple turns.
Moreover, the complexity of an information-content model and the amount of effort that would have to go into encoding each bit of information rapidly puts such a system into the “impossible for a single human being to develop for” category — and one of my major goals has been not only to develop a system that produces plausible narration of conversation but does so in a way that a single author can write for in a reasonable number of hours. In other words, it needs to be easier to write for than the existing options, not harder.
A lighter approach, though still somewhat onerous for the author, would be to include some markup in quips — just a bracketed phrase, probably, like [possible-interrupt] — that would check for whether the NPC wants to jump in at that particular moment. This phrase would then run an activity to print the interruption text and set any mood counters or flags. It would certainly be more work than my original approach, because it requires hand-editing of many quips, but it would produce smoother results.
I think this would work, but to be honest, I’m not crazy about it yet. I wonder whether there might be some third kind of markup
A final note: if we wanted the NPC to follow up an interruption with an angry response or refusal to answer, that’s something we should do at the next step, without relying on the interruption hook. As you may recall if you read earlier posts on this system, the sequence of conversation looks like this:
1. PC’s comment (which can be multiple paragraphs, but usually isn’t)
2a. NPC challenges a change of subject, if relevant
2b. NPC’s response (which can be multiple paragraphs, but usually isn’t)
3. (If step 4 is going to happen) A grounding beat is produced to mark a pause in the conversation, to pave the way for
4. (Optionally) If the current conversation thread is at an end, and if the NPC has something else planned to say, he now starts a new conversation thread by saying the next thing on his list.
So any interruption effects happen during step 1, and the reason they’re tricky is that they require breaking up what is naturally an atomic step, printing the player’s speech — either breaking it up mechanically using indexed text, or more organically but laboriously using hooks the author has put into every quip that might trigger such a response. But we can easily meddle with step 2 with something like
Instead of Lucy discussing a sensitive quip when Lucy is offended:
say “Lucy sniffs pointedly and refuses to reply.”