Branching Dialog Editor - skytreader/PyGame-Objects GitHub Wiki

Note: This is a work-in-progress, not concrete documentation.

Branching dialog files are meant to be readable by both programmers and non-programmers who may work on a game's dialog alike.

Definitions and assumptions

This assumes that the player is represented in the game by an avatar regardless of perspective. We also assume that in initiating conversations the player is a silent protagonist (i.e., in no conversation will the player ever be the first party to actually say a string of dialogue). This is neatly patterned after Skyrim.

A string of dialog or dialog string is a sequence of non-empty lines. The start of the first line of a string of dialog may contain keywords but the rest should be taken as pure dialog. The example below shows two strings of dialog.

Baba yetu, yetu uliye
Mbinguni yetu, yetu amina!
Baba yetu yetu uliye
M jina lako e litukuzwe.

Utupe leo chakula chetu
Tunachohitaji, utusamehe
Makosa yetu, hey!
Kama nasi tunavyowasamehe
Waliotukosea usitutie
Katika majaribu, lakini
Utuokoe, na yule, muovu e milele!

Structure

A branching dialog file is composed of one or more sections. A section is structures as follows:

[section_label]
<option>

<reply>

result1, result2, ...

Where:

  • section_label contains alphanumeric characters, underscores, dots, and dashes.
  • <option> and <reply> is a string of dialogue. By convention the option always comes from the player.
  • result1, result2, ... are the labels of the possible sections to which the conversation can branch of to. No matter how many possible branches this may lead to, or the length of the labels used, this will only span a single line.

The section END is a special section that terminates the whole conversation. No section may have that label.

The first section should always be the special section labeled START. Unlike ordinary sections, this may only have at most one string of dialogue following it or none at all. If the string of dialogue is present, this will be taken as the response to the player's interaction with the character.

Features

Debugger

Should fail if:

  1. a section label was used but not specified.
  2. START and END sections are not present.
  3. START has two dialog strings.

Note that if there are no sections other than START then it is a one-off dialog, not a conversation. The first condition above should be thoroughly checked for this.

Should warn about:

  1. unreachable sections.

Issues/To figure out

Consider these points but they may be left-out.

  1. If we are gunning for Skyrim-style conversations, recall that a Skyrim conversation may have multiple options for beginning a conversation.
  2. Conversation may depend not just on a pre-planned tree of possibilities but also on in-game status: the player's skills, the state of some mission, etc.
⚠️ **GitHub.com Fallback** ⚠️