Sunday, February 20, 2011

Dialogue Trees: The art of deception

A common complaint about dialogue trees is that the player's choices don't matter. No matter what option you pick, you wind up in the same place. The choice of words is just a nod to geeky roleplayers who imagine their characters outside the confines of the game - or worse, a deception meant to fool players into thinking there's more to the game than there really is.

To which I reply: Yeah, so what?

Sure, there's an illusion here - just like there's an illusion in movies, plays, and TV. However, it's an illusion created with the assent of the audience. Does it bother anyone that Two and a Half Men is filmed on a set with flimsy portable walls? Of course not. We want to be deceived. The only time the phoniness of a show bothers us is when it's too obvious, interfering with our ability to believe in what we're seeing.

The same is true of all aspects of game design. In the Neverwinter Nights 2 toolset, there are flat buildings and tree models that look just like stage props. They're for placing at the edge of an area to create the illusion of a bigger world. Similarly, if you pop open an area from Dragon Age, you'll probably find things like towers floating in the air far from the playable area - meant not to be visited, but to fill out the skyline.

But this is the last post in my series on dialogue trees, so I'm going to focus on how you create the illusion that the player's dialogue choices really matter. Of course, sometimes those options do matter. Sometimes they determine a course of action, such as whether to attack an NPC, or open a store, or do any number of other things. However, by necessity most options are Roleplaying Responses that don't have a direct impact on the game. Its those options - the stage props of RPG conversations - that I'm going to focus on.

Chopping down the metaphor
Perhaps some of the disdain for dialogue trees comes from the metaphor itself. A tree implies something that grows from a certain point, continually branching in different directions and reaching myriad ends.

It doesn't work like that. It can't work like that. If it did, game writers would be spending all their time writing branches, and sub-branches, and sub-sub-branches, and... well, you get the picture. To keep conversations from growing exponentially with each set of PC responses, writers have to use links to steer the conversation down a more-or-less linear path.

I've tried to think of something better than the tree metaphor, and the only thing I've been able to come up with is a river that periodically forks and then reforms a short distance later. There's a start and an end, multiple ways to navigate through it, and potentially multiple endpoints. However, most of the "traveling" is done via the main waterway.

Example of a "dialogue river" flowing left to right
To put it in game terms, the player's choices result in a different path through the conversation, but don't alter the course defined by the writer. One of the goals of the conversation writer is to make it seem like the NPC is responding directly to what the PC says - in other words, to create an illusion that the conversation really is an ever-branching tree, instead of the weird forking river of my (tortured) metaphor.

Linking up downstream
The worst conversations - the ones that give dialogue trees a bad name - simply link all the player's selections back to the next NPC node. As a result, the NPC responds with the same rigid dialogue whether the PC is complimenting his mustache or casting aspersions on his mother (assuming the writer is silly enough to give the player such a range of options).

It's easy for players to tell when they're being "railroaded" this way because they still have the previous dialogue options fresh in their mind when the generic NPC response pops up. To conceal the linear nature of the conversation, the ideal NPC response directly addresses what the PC just said and then smoothly gets the conversation back on course (ie, moving downstream).

A conversation from Dragon Age: Origins. The linearity of the conversation isn't as obvious in-game because the NPC responds directly to what the PC says before forcing the conversation back on track.

Not every player option requires a unique NPC response. The important thing is for the NPC to seem to be responding directly to what the PC says, and that's often possible by linking multiple player options to the same NPC node. On the other hand, if all the player options in a set link back to the same node, that's a sign that the player's dialogue options are too limited. Most of the time, a set of player responses should produce at least two different NPC responses.

Marking the player's words
All that sleight of hand is effective for creating believable conversations, but leaves the player's dialogue choices largely superficial. Whether that's a problem is a matter of debate, but many games attempt to add more import to conversations by "keeping score" through scripts attached to the player's dialogue options. These scripts typically adjust variables that track the PC's relationships and personality.

Mass Effect's morality tracker
A prominent example is the alignment meter, which is a common feature of Bioware RPGs. Whether it's the alignment system of Dungeons and Dragons titles, the Light Side/Dark Side dichotomy of the Star Wars games, or the Paragon/Renegade scale in Mass Effect, it's all about lending long-term significance to the player's words and actions. In this way, many dialogue options that would normally just be Roleplaying Responses with no impact on the game can have a major cumulative effect, either through special game rules (good/evil item requirements, for example) or how the narrative plays out (alternative endings).

The danger of adding character-defining significance to dialogue choices is that it can easily assume too much about the player's motivations. Is the PC threatening that commoner because he's a bully, or because he has some greater good in mind? An approach that's less susceptible to ambiguity is one that tracks the perception of the PC's personality. In other words, if the PC threatens a commoner, people will be more likely to believe him a bully - whether it's true or not. In this way, the player's dialogue choices really do matter, but not in a way that attempts to modify the player's unique conception of the PC.

If you made it this far, you deserve a special achievement or something. Believe it or not, there's even more I could say about dialogue trees. Writing for games is a unique craft, which is why game companies can't necessarily - as players sometimes suggest - just hire a top fantasy writer to come in and script their games. The techniques that work in one medium don't necessarily translate to another, and game writing in particular is deeply tied to the tools and technology used to create games.

My goal wasn't so much to produce an authoritative text on dialogue trees as to attempt to formalize my own thoughts about it. I know there are many other approaches, some of which may become the norm in the future. I don't pretend to set the standard. If you disagree with anything I said, I welcome your comments.