FUNDAMENTALS OF GAME DESIGN, SECOND EDITION
Structure of a Dialog Tree
Scripted conversations may be designed using a dialog tree, a branching data structure a little like the branching story tree. In a branching story tree, each branch point, or node, represents a place where the plot divides based on some factor— usually a player decision. In a dialog tree, each node represents a place where a conversation may branch, based on the player's decision about what he wants to say. Unlike a branching story, the arrows in a dialog tree can go backward as well as forward because players sometimes want to repeat parts of their conversations.
Each node contains a menu of exchanges, and each exchange includes one line of dialog available to the player and the NPC's response to that line. From each exchange, an arrow points to the next node in the tree—that is, the menu of dialog options that the player will see next. In a scripted conversation, the computer displays all the dialog options in the current menu to the player, and waits for the player to choose one. When the player makes a selection, the computer plays back the NPC's response, then follows the arrow to the next menu and displays the dialog options there. The conversation passes through menu after menu as the conversation progresses.
In addition to letting the player discuss a variety of topics with a given NPC, the menu system allows the player to choose from a variety of different attitudes in which she says essentially the same thing, enabling her to project herself into the game as, for example, aggressive, deferential, formal, or flippant. The NPC can then respond to each phrase differently, in whatever way his personality dictates. An easygoing character might find a flippant response amusing and may choose to reveal more information to the player, while a powerful character who brooks no nonsense might be offended by wisecracks and refuse to talk to the player any more. (If you take this approach and the NPC's information is vital to the plot,
make sure that either the powerful NPC gets over his snit after a while or there's some other way for the player to obtain the information.)
Figure 7.5 (on the following page) illustrates a brief conversation in which the player is acting as a police detective, interviewing someone who may have witnessed (or possibly committed) a crime. The conversation begins at the first menu, and in that menu the player has a choice of four approaches to the witness: polite, neutral, direct, or accusatory. Each approach produces a response from the witness, which then leads on to another menu of things for the player to say. Each menu has its own name.
In this example, the witness is rather uncouth, but is prepared to help the player as long as the player is not too hostile to him. If the player takes a strongly aggressive approach, the witness demands to see a lawyer, which ends the conversation. In this case, the player will not learn some of the information that the witness has, so the player will either have to re-interview the witness later, or find it out some other way.
Figure 7.5 includes several features that are particularly worth noting:
■ Not all the menus in the figure let the player ask the same question in different tones. Some give the player a choice of questions to ask about different subjects.
The menu "Ask About Evidence," for example, lets the player ask about gunshots, a car, or a man in jogging clothes. If the witness doesn't know anything about one of these subjects, the arrow leads back to the same menu again so the player can ask about a different subject.
■ Although all the witness responses in the menu "About the Car" lead to the same place (the "Follow-Up" menu), each one still provides the player with some different information.
■ Not all questions produce unique answers. In the "Time of Bar Visit" menu, the polite and neutral approaches both elicit the same answer from the witness. This is perfectly allowable if there's no particular reason to differentiate them.
Finally, note that in Figure 7.5, the maximum number of exchanges the player can have, without repetition, is eight. As with branching stories, if the menus continue to branch without folding back, you will soon get a combinatorial explosion of menus. In practice, they frequently converge, or link back to previous menus.
Unfortunately, there is no industry standard system of notation or scripting for designing dialog trees. Instead of creating a diagram with arrows as in Figure 7.5, you may find it easier to write your dialog in a text file, and instead of drawing arrows, simply write "Go to Menu [menu name]" to indicate which menu should follow a given response. If such factors will affect your dialog, you should sit down with your programmers and devise a system of notation that will be easy for you to create and easy for them to understand; they have to understand all the factors and when those factors come into play so they can write the software that actually implements the system.
|
||||||||||
|
||||||||||
|
||||||||||
|
|
|||||||||
|
||||||||||
|
||||||||||
|
Did you hear any shots around that time?
We're trying to trace a tall man in jogging clothes. Did you see him? When you came out, did you see a blue car go by?
That's all we want to know for now.
|
||||||||
|
||||||||
|
||||||||
OBSTRUCTIVE WITNESS
[Direct] You're the prime suspect, unless you convince us otherwise.
[Threatening] If you know who did it, you better talk or we'll charge you.