AIF 101: Dialogue
I'm going to define dialogue as characterization in action. One of the most fundamental ways players interact with npcs is by talking to them. There are many ways this has been done in IF. I'll provide an overview, but http://tads.org/howto/convbkg.htm has several articles on the subject. It is a TADS site, but the first few pages are language independent.
The simplest conversational implementation is a simple TALK command. The player enters TALK TO [character], and this launches whatever the character's dialogue is given the current game state. This allows for minimum interactivity, and greatly simplifies both writing and playing the game. Its largest downside though is that with only one command, conversational puzzles are impossible to implement.
Some games include menu systems, allowing the player at different points to choose from a limited number of dialogue options. This allows for more options than the simplified TALK TO command, but can be difficult to implement, and still confines the player to a fairly linear conversational story line.
Many games make use of an ask/tell system, in which the player can ask characters about topics (ASK [character] ABOUT [topic]), or tell them about them. This offers the basic conversational functionality, and allows for the player to mine information from the other characters. It is, at the moment, the most powerful and versatile option.
What you choose depends mostly on your game and your needs. If you are using the TALK TO method, all you need decide is what every speaking NPC will be saying at any given point in the game. Minor NPCs may only have one line of dialogue to repeat throughout the game. More complicated characters might change their lines dependant on the game state.
When designing a menu based system, it would be easiest to draw out conversation trees. What dialogue option results in what response, at different points in the game.
I've worked mostly with ask/tell systems myself, so I'll focus for the moment on those. I find that when planning a character's conversation, I work best away from the computer screen with an old fashioned pad of paper and a pencil. First, I make a list of general topics that all characters in the game are likely to know about. These include other characters, the player, events, places, things, whatever. Then, I go through each character and make a conversational web... I write each topic down, and summarize more or less what the character's response to being asked or told about said subject might be. If this offers up additional conversational topics for that character, I'll draw a line from that topic to a secondary topic.
This can be hard to describe, so here's a crude ASCII diagram.
TOPIC 1 --- SUBTOPIC 1
| SUBTOPIC 2
So, for our hypothetical game in progress, we work up a list of general topics.
- The Player
- The Princess
- The Dragon
- The Prince
- The King
- ... etc other characters
- Our Kingdom
- The Princess's Kingdom
- The Castle
- The Port Town
- ...etc other places
- The Ball
- The Kidnapping
- The Marriage
- ...etc other events
Let us assume that we are developing the Prince as a character. We take the first general topic, the Player, and start a web. We decide that the Prince will say the player's an okay sort, but that he should consider retirement. Our web would look something like
PLAYER --- RETIREMENT
This gives us a subtopic for the prince, the concept of retirement. We decide that if the player asks about retirement, the prince will consider it an excellent idea.
Eventually, when you're done with your list, you can figure out the specifics of the dialogue. I like to type all mine up in a word processor for the advantages spell check gives me. Here's an example of the Prince's Dialogue:
"You have served my father well," the prince speaks, "and your deeds are renowned throughout the kingdom. You certainly have earned a nice, quiet, retirement."
The Prince perks up at mention of your potential retirement. "Given the matter some thought have you? It is for the best... you're not getting any younger."
Of course, new conversational topics will arise as you continue planning your game out, and your beta testers will indubitably have suggestions for topics you may have missed.
© 2004 J Freebase - Updated 07/12/2004