Friday 3 June 2011

Designing a Dialogue System From Scratch Part 1: What is Dialogue?

I did a couple of sessions at this year's GameCamp: a discussion on designing dialogue systems and a debate on the morality of wargames. For those that aren't in the know, GameCamp is an unconference - anybody that turns up can ad lib a session, with anywhere from 3 to 30 people rocking up to take part in each. 

The morals thing was a bit slapdash - I realised two things very quickly. 1) It's not really a discussion about games so much as it is about individual people's moral codes and 2) most people aren't kitted out to have an argument about moral theory, and those that are sit at the back looking grumpy.

The dialogue session, though, was much more favourably received, albeit with the caveat I should have employed my usual presumptuousness and run it over two blocks so we could get a bit more stuck in. Here's what we were mumbling about, tarted up rather a lot with my own thinking post-event.

My pitch was that dialogue trees are one of the oldest mechanics in games and that they do a terrible job of actually emulating real conversation and the skill, personality and emotion that goes into it. Instead of thinking inside the box, what happens if we analyse what makes up a real conversation and then develop a system that models these features? Can we abstract and interact with dialogue in the same way we do gunfights or murder investigations?

So what was our dialogue system hoping to achieve? The whole point of thinking about a new way in which to interact with dialogue is to find a system that:

- Is sufficiently realistic: It doesn't need to be simulation (obviously that's impossible for the foreseeable), but it does need to be a plausible abstraction. An in-game firefight doesn't require physical fitness, combat training or the know-how to strip a Beretta; but it does test reflexes and knowledge of basic tactics like cover and flanking. If conversation in the real world were as simple as choosing an emotional response from a list and asking every question you can think of we'd all be expert manipulators.

- Is interesting & dramatic: Obviously.

- Is goal oriented & skill-based: Gameplay assumes a goal. It may not always be an explicitly stated one (discover the location of the secret lair), it might be a player assigned one (learn about a character's past or teasing someone he doesn't like).

- Allows the player to express his personality: This is the tricky one - how do we balance personal expression versus goal achievement / manipulation? In Mass Effect 2 both friendly and aggressive paths usually achieve the same goal, which removes the skill; but requiring a certain approach in order to achieve a goal sidelines personal expression.

We started off by looking at what was already out there.

Traditional Dialogue Trees (almost every RPG / point & click ever): They don't flow naturally, they provide options the player might not have considered, and don't provide options that he has. Little skill involved.

Free text input / keywords (Facade, Starship Titanic): Hard to program believably, can't represent complexity as easily as dialogue trees, but do give a greater sense of freedom and hide the inner workings more effectively.

Mini games (Theme park's trade union negotiation, Republic): Provide a more skill based interaction, but are overly abstracted

LA Noire's doubt/lie system:  Completely removes active roleplay and conversation topic control to  focus soley on testing perception and contextual knowledge. Big on player skill, low on player ownership.

Interesting tweaks on dialogue trees:

     - Mass Effect's dialogue ball: Overly simplifies options to good, neutral, bad and more information. Morality system contradicts the player's and encourages them to 'game' the system, ie non-roleplay. But it does provide a cinematic flow.

     - KOTOR II's [Lie] option: Allows the player to express his personality without reducing his ability to manipulate characters (ie the game knows the difference between a player who says nice things because he's nice and a player who says nice things because he wants something).

     - Fahrenheit's system: The timelimit encourages instinctual responses and keeps dialogue flowing naturally; chosing a thematic word instead of an entire sentence provides greater sense of player ownership; impossible to explore every thread or 'game' the system.

     - Alpha Protocol's system: Focuses on character roleplay and character manipulation. Player has a goal which can be achieved by understanding the NPC's personality and manipulating it with appropriate tonal choices; but equally may choose to piss off characters he doesn't like. 

Next we considered what makes up real dialogue. We decided there are two types of conversations we're familiar with, though naturally they are often combined.

Dramatic: Goal oriented. At least one person is seeking either information or support through persuasion, at the expense of varying degrees of personal expression (ie how manipulative is that person, and how much can they control their natural personality?) For instance, I'm going for a job interview; my goal is to persuade the interviewer that I'm a good candidate; in order to do so I may have to conceal or exaggerate certain facts, as well as adopt a more formal voice and refrain from telling knob gags.

Social: No goal beyond entertainment / expression of care. Often unfocused. I'm allowed to tell knob gags as an expression of my personality and as a kind lure or scarecrow for people who I'm likely to get on with or dislike respectively.

Traditionally the traits that define the calibre of a conversationalist are either represented in games by stats (intelligence, charisma etc), or not at all (dialogue trees where NPC reactions are pre-programmed). But what are these traits in detail?

Perception: Picking up on underlying meaning and emotion through tone, body language and word choice.
Knowledge: Useful information on the topic in hand or the other person that can be leveraged.
Eloquence / Timing: Understanding the other person isn't enough to achieve a goal; the speaker also has to have the charisma to successfully deliver a line that leverages that understanding appropriately.
Self-control: How much is a person willing / able to adapt their personality in order to achieve their goals?
Group Formation: What is the person's social standing with the other speaker/s?

In 'Part 2: Structure' we'll consider the fundamentals of how we might present, progress and input dialogue, and begin thinking about how to model and test the traits we've just identified.


  1. Wahey, we're knee deep in theory again! This is part 1 of 3, so plenty more to come. It's nto too late to incorporate any intelligent thoughts you lot have got on the matter.

  2. Awesome, this is exactly what I'm doing my college thesis on right now!

  3. Nice read... Can't wait to se the whole trilogy. :)

  4. Wonderful article. It is of particular interest in that I am hosting a Ludum Dare game jam competition on the last weekend of this month and this article suits the theme of the jam perfectly. Keep up the fantastic work.

    For gamedevs looking for a fun 48 hour game jam based on the above, be sure to check out
    on or before the weekend of June 25th 2011.

  5. Ah! Glad you're taking on this subject! I'm trying to write my first game right now, and I'm thinking about how to naturally/thematically tie in my more-or-less novel concept for a dialogue system with the narrative (or lack thereof) itself.

    A question: what coding languages or development programs/mod engines would be best to make a really simple game - one with physically static actors and no complex mathematical systems, but that relies a tonne on the written word? (excluding IF)

  6. Hmm... the only dev tool I use regularly is The Games Factory 2. I used it for my text-based game, ir/rational, and it's certainly easy to use and will handle what you're describing. However, its text editing functionality is rough as balls (in the new version we're putting all the text into images to get around the issue).

    Other options? Ren'Pi is used for Japanese dating Sims, it's halfway between an IF parser and something more complex.

    These tools are linked to on the narrative design resources page, link top left.

  7. Ah, most cool; this looks good! Thanks for the response.