Tuesday, 14 June 2011

Designing a Dialogue System From Scratch Part 3: The System

This is the final part of a discussion that began here. Next up we're considering how to model self-control & personal expression during dialogue.

Self-control: This is the tricky one. As long as we allow the player to consider his approach and choose his tone he's arguably too far removed from the scenario to truly struggle with self-control as we do in real life. To be truly successful, I think a dialogue system has to encourage the player to make decisions that he knows are to his detriment, simply because of who he is. Time limits tackle this to some degree - simply don't allow the player time to think so he reacts more instinctively. Strong characterisation of NPCs is also crucial: if we aren't invested in who we're talking to it's very easy to choose the 'correct' path.  However, if we present the 'correct' path (ie the one with the greatest rewards and fastest / funnest route to completion) as opposed to the one which provides us revenge on someone we hate then we're forced to balance one against the other.

     - Two types of conversation: This is harking back to that original line in the sand between dramatic, goal-oriented conversation and more social, everyday dialogue, as well as KOTOR II's [Lie] mechanic. If we're struggling to simultaneously reward the player for achieving goals through performance and expressing his personality, why not signpost them as two different systems? The game tells the player when he's talking to someone who's not going to be their friend and is there to be manipulated, and when he's talking to someone who's not worth putting an act on for. This way the serious do gooder can preach to his allies and attract those of a similar disposition, while the cocky comedian can drop that personality to get things done without fear the game will assume he's turned into a pansy.

     - Personality tracking: I think I read somewhere that Alpha Protocol does this. Instead of saying 'this sort of personality won't work with this character' and therefore forcing players out of their role play in order to achieve objectives, we allow for all personalities to work equally. We pre-program a set of personalities (base it on Briggs Myers, or some basic classes like 'joker', 'do gooder', 'professional' etc), detect which options the player tends to pick, and then present more options in those areas. It rewards consistent players, and means that if the joker tries to pull off sincere he'll have a tougher time of it (fewer options in that category or harder mini-games) than the guy who talks that way all the time. It needs very careful handling - the joker shouldn't be unable to express anger with a character he hates just because the game thinks he doesn't get angry often.

     - Emotion input: By this system, we allow the player all the usual luxuries of dialogue trees: carefully considering his approach and manipulating characters without care for his own personality or emotion. However, we also ask him to honestly input his emotion. Is he angry, scared, confused? We then use that information in inventive ways. Sometimes (based on pre-authoring, a mini-game or skill check) it has absolutely no effect. Sometimes it will result in an aside to an ally. Sometimes it'll result in the character failing to conceal the emotion and having it affect the dialogue in surprising ways. We encourage the player not to consider this a failure; not to game the system by always selecting 'calm and collected'; but to take it as a valuable and meaningful element of the experience. More so games are sold not on competing for high scores, not ont getting to the end, but on how you get to the end. This approach gives players a new way in which to take that conceit and run with it.

So, have we actually concluded anything?
If there's one thing games have always struggled with, it's how to handle failure; yet it's failure that's the core element currently missing from most interactive dialogue systems. We can't allow the player to put himself in an unwinnable position, and we're not bold enough to say to him "This character doesn't like you for no better reason than you're you." We always want to give him his power fantasies.

To my mind there are two key directions that come out of all this. One is the dynamic, image-based system which really needs a whole essay of its own, and is as much an AI and psychological concern as it is a narrative one.

The other is, I must concede, still a dialogue tree of sorts; but it's a dialogue tree built from the ground up with the intention of modelling realistic dialogue traits with the same depth of simulation that we apply to the end of a gun. It looks something like this:

- Strong characterisation and the threat of punishing / unsatisfying gameplay may be used to encourage and represent self-control or lack thereof. Does the player feel strongly enough in a given scenario to sacrifice reward in favour of personal gratification? Investment is encouraged by not rendering every route as equal in reward, and not using scenarios that affect the character but not the player. A quick example: the guard tells us we can't enter the city. For the character this might be really annoying; for the player it makes no difference because he knows that if he needs to enter the city the game will allow him to do so somehow. This is absolutely crucial - there must be no logical gap between the character's emotion and the player's. There should be no game objectives or mechanics that aren't legitimate elements of real conversation (for example we're encouraged to help people in RPGs because we're rewarded with experience; as a result we don't fully express ourselves).
- Input is in the form of keywords and emotions: The player can't tell what's important by looking at a list of sentences; he must use his intuition and perception to identify key topics and approaches. Where appropriate he's encouraged to express his personality.
- Mini-games provide active challenge and allow for unexpected successes or failures
- It's linear in overarching topic: a game which places conversation as its central mechanic doesn't need dead ends and cul-de-sacs any more than Call of Duty needs the option to get back on the chopper, go home and become a gardener.
- It uses a time limit to maintain natural flow and encourage more instinctive reactions & mistakes
- It doesn't use stats: your success is based on your own ability, apart from in areas where stats make sense such as group formation and prior knowledge
- Branching is used for key decisions and to discover new information without altering the fundamental direction or flow of conversation. It is triggered by some or all of:
     - Conscious, signposted decision points
     - The use of predefined pieces of prior knowledge
     - Mini-game success
     - Perception of keywords during dialogue
     - Personality detection (ie how often the player adopts certain tones and personality traits)
- Conversations may be signposted as goal or social focused so the player is free to manipulate and express his personality in equal measure.

I don't know if this is quite the revolutionary new approach we might have liked to come up with. It's possibly more theoretical pipe dream than practical mechanic. I do hope, at the very least, that the discussion has presented or refined specific mechanics and their potential uses. As ever games are a process of evolution, not revolution, and it's games like LA Noire, KOTOR II and Heavy Rain that continue to make small but meaningful advances in how we interact with dialogue then the holy grail will continue to edge just that little bit closer.


  1. Thanks so much for this valuable article series. It is required reading for the coders involved in this month's http://www.ludumdare.com/compo/ miniLD challenge.

    Anyone interested in writing their own dialogue system might enjoy this - everyone (beginners included) is warmly welcomed by a thriving community of gamedevs:


    The "secret phrase" will be announced at the start June 25th (midnight GMT or June 24th at 4pm PST). Good luck and have fun!

  2. I wonder how a system in which you define the character from the start would be received. So instead of moment-to-moment responses, you define a set attitude for your character and perhaps quirks or subjects that provoke unusual responses from them.

    It's like an extension of Daggerfall's system of selecting character strengths and weaknesses, but instead of food allergies, your character despises political assassinations used in place of negotiations. The dialogue flow is then automatic in terms of attitude, but the choice is there for the sake of defining what information the character finds important.

    I do believe I have a new blog post in the oven after considering this.

  3. It took me a while to get round to making quality time to read through this series so only just read parts 1-3 back-to-back. I'm really grateful that you've written on this subject and I've been grappling with some of these issues myself.

    Some of my own constraints are specific to what I'm trying to create but I'm facing general issues like avoiding providing leading questions on screen (when using a list of options with full text of question provided in advance) but balanced with wanting to avoid the player stumbling on important/useful information by accident. i.e. want the player to think strategically about the questions they ask and have an idea in advance of what information they think they might gain from asking certain questions based on information they've gathered from elsewhere. I basically want to make sure the player is using their brain the whole time and gets rewarded for decisions they actively make rather than for any other reason - don't want them to be able to 'game the system'.

    Of the things you talked about I found the ideas of incorporating personality tracking (rewarding broadly consistent play) and a system to simulate self-control particularly interesting as I haven't seen those aspects brough up before, but I can see their value. Also I like your example of a character trying to get into a city - not having a gap between a character and player's emotions is something I'm aware of but that just showed how easy and seemingly innocuously a gap can be created.

    I like Sid's idea above. I think it has merit and possibilities for use in some games.

  4. Chin-strokingly good stuff, but I would've like to see you go into the relationship between dialogue and the other gameplay systems more. The dialogue system theorised here would still freeze the game and allow the player to talk without considering any of the other gameplay systems. That's exactly what needs to be fixed, in my opinion: Dialogue systems might offer you rewards you can use in the main part of the game, but they're always cut off from everything else. They never interact with the combat in the same way as the stealth and hacking systems in Deus Ex do.

    My dream: The player can change from dialogue to combat or vice-versa instantaneously at any time. Games already switch from dialogue to combat and back when the player has won or lost some part of either, but putting that switch was under the players control makes it fluid and opens a lot more possibilities. A player could distract an enemy with chatter while reaching for their gun, try and talk a boss out of killing them as it attacks, shout questions at fleeing enemies.

    I've seen some of this implemented will in "'Mid the Sagebursh and the Cactus":


    But nothing beyond IF. Think I might try writing a blog post myself.