Wiki Based Dialog System

From IFWiki

An important part of interactive fiction is talking to NPC's. One possible "WikiWay" of creating the dialogs is the following:

A dialog is organized as a tree where each node represents a possible thing the player can say to the NPC (the root node of the tree would actually represent that the player walks up to the NPC). Each node will also contain the response of the NPC. For example:

  • Walk up to Homer. Homer: Hello, there.
    • Where is Moe's tavern? Homer: Just two blocks south from here.
      • How much does a Guinness cost there? Homer: Don't know, I never drink that stuff.
      • How much does a Duff cost there? Homer: 3 bucks, man.
      • OK, that's enough about Moe's tavern for now. Homer: Alright. end topic
    • I'm afraid Bart has caused some trouble in school. Homer: D'oh.
    • Goodbye Homer. Homer: Bye. end dialog

So, the nodes have some basic control elements (end topic and end dialog). Eventually one can introduce more complex controls, like dialogs that affect your inventory. For example, you can only ask Moe for a Duff if you have 3 dollars to give him, and after you ask him, the beer will be added to your inventory (of course, dealing with money will involve using some scripting language with basic arithmetic/control flow, so that's probably something for programming savvy authors).

Editing: A user-friendly way to do that would be to implement something like CoolJS (plus some "write-lock" mechanism to synchronize editing).

Side note: even an IF story should have some cool dialogs between NPC's. These would be much easier to manage/edit since they have a simple linear structure.