Thursday, February 3, 2011

Dialogue Trees: From roots to branches

RPGs come in many forms, but almost all of them have one design element in common - the dialogue tree. This method of constructing conversations has been around for a long time, and while it's reviled by some and mocked by others, no one has yet come up with anything better. Even the dialogue wheel used in Bioware games is just a shiny interface hiding the same underlying structure. It brings to mind what Churchill said about democracy being the worst form of government, except for all the others that have been tried.

Yes, that just happened. I quoted Churchill on a blog about video games.

With dialogue trees being ubiquitous in RPGs, I thought it would be worthwhile to spend some time discussing their structure and some best practices for creating them. Much of what I'll say represents solid RPG standard, which I've learned either through playing the games or from following the standards set forth by Ossian Studios. Other points - perhaps the more contentious ones - are based on my personal experience writing RPG conversations over the years.

I can't cover everything in one post, so let's break this up into three parts. In this first part, I'll focus on PC responses, which create much of the "branching" in dialogue trees. Specifically, I'll talk about the different types of PC responses and how to approach each.

But first, it has to be done: I have to step back a define a few terms that are essential for any discussion of dialogue trees. Experienced modders are welcome to skip ahead.
  • Conversation Editor: An editor, usually part of a larger toolset, that is used for creating conversations.
  • Node: The most basic element of a conversation, which appears as a line in the conversation editor. The node is assigned to a speaker - either the PC or an NPC. Note that it may consist of more than one sentence, so it's not accurate to refer to this as a "line of dialogue."
  • Branch: A node and all its subordinate (lower) nodes. 
  • Link: Rather than have their own subordinates, some nodes may link to existing nodes. 
A conversation branch displayed in the Dragon Age: Origins conversation editor, with one node highlighted
Three types of PC responses
To make it easier to talk about PC responses in the abstract, I've divided them into three different types: Roleplaying, Action, and Investigation. Responses don't always fall neatly into one of these categories, but neither are the lines between them arbitrarily drawn. Each type of response serves a different purpose and has its own pitfalls and best practices.

    Roleplaying Responses
    Roleplaying Responses are options that don't have a direct impact on the course of the game, but merely allow the player to express his or her PC's personality. These sorts of options tend to be common, as they provide a "cheap" way for the player to interact. In other words, while Roleplaying Responses are highly valued by players, they don't create a lot of extra work for the developer.

    An example of what I mean by "Roleplaying Responses." Which option you select has no bearing on the plot.
    When writing Roleplaying Responses, try to accommodate a range of personality types without resorting to stereotypes. It's important to include dialogue that reflects personalities that are: altruistic, mercenary, flippant, violent, egotistical, etc. However, it's more important not to force the player into making a selection that runs contrary to the unique personality he or she has conceived for the PC.

    To avoid this, it's a good idea include at least one "escape hatch" in each set of Roleplaying Responses. An escape hatch is an unobjectionable "vanilla" response that moves the conversation along without forcing the player to express an opinion that would be out of character. It could mean simply telling the NPC to "Go on" or even having the option to [Say nothing].

    Action Responses
    Unlike the other types of responses, Action Responses have an actual impact on the course of the game. Some may involve the use of skills like Persuade or Intimidate to solve a quest. Others may represent alternative actions, like the choice to let a surrendering foe live or die.

    A set of four Action Responses (with some roleplaying mixed in). Which option you choose effects how the game plays out.
    Action Responses may describe the actual action they represent using a special format such as brackets. Alternatively, they may be actual lines of dialogue to be spoken by the PC (as in the example above). In any case, the most important thing to remember about Action Responses is there should be no surprises for the player. The NPC node leading into the options should make it clear that the decision is meaningful in game terms, and not just a roleplaying choice. Equally important, the text of each option should accurately reflect what will happen if the PC chooses it.

    The line between Action and Roleplaying Responses isn't always clear. In fact, making a choice between different courses of action is roleplaying, and therefore the dialogue options you create for them may sometimes look much like Roleplaying Responses. However, in writing these options, be careful not to assume too much about the PC's motivations. A player may want to let that surrendering foe live not because the PC is a nonviolent sort, but because he identifies with his (brash and deliciously evil) enemy, or for any number of other reasons that are hard to anticipate. As with Roleplaying Responses, it's a good idea to include some options that aren't tied to any personality type.

    Investigation Responses
    Investigation Responses are options - typically in the form of questions - that the player selects to learn additional details about quests, NPCs, and the game world in general. Investigation Responses should only be used for non-critical information (that is, information that's not required to complete the task at hand). While you can, technically, force the player to ask a question by making it the only option, this is bad form. Instead of forcing the player's hand this way, restructure the tree so the NPC automatically reveals the key bits of information.

    A branch of Investigation Responses. The grayed nodes are links.
    Since Investigation Responses don't represent an either/or decision between options, they often use links to allow the PC to ask all the questions about a particular topic (as in the above example). This can lead to immersion-breaking repetition, as player may (inadvertently or not) select the same option twice. Although veteran RPG players have gotten used to this awkward situation, you can avoid it by disabling options the player has already selected. You can usually do this with scripting or via a "Display Once" setting in the conversation editor.

    One final point about Investigation Options: When using links to allow the player to ask multiple questions, you should make it clear which option "breaks out of the loop." Players might get annoyed if they miss out on a chance to ask a question because they unknowingly clicked on an option that ended the conversation.

    Well, I think that's more than enough on PC responses for now. In my next article, I'll talk more about the technical details, standards, and miscellanea of constructing dialogue trees.