Documentation menu

Introduction

Concept

Dialogue node structure

A dialogue is a set of nodes. One node is one line of the story, and it contains:

  • Content: what is shown. The text, the speaker who says it, and an optional title that replaces the speaker’s name.
  • Options: the choices the player can pick from, if any.
  • Flow: where the story goes next. next on the node, or next on each option, optionally branching on variables or going back to an earlier node’s options.
  • State: variables the node or option sets, and the conditions an option requires before it is shown: variable values, or what was already played, with alternatives joined by or.
OSF.osf source
scene.osf
Dialogue scene {
  Node ask {
    speaker: stranger           // content: who speaks
    text: "Are you dreaming?"   // content: what is said
    set: { is_dreaming: true }  // state: set when the node starts

    Option say_yes {  // option: a player choice
      text: "Yes."
      next: answer  // flow: where the choice leads
    }

    Option say_no {
      text: "No."                       // no next: the dialogue ends
      requires: { is_dreaming: false }  // state: shown only when this matches
    }
  }

  Node answer {
    speaker: stranger
    text: "Then wake up."
  }
}
scene.yaml
apiVersion: dialogue/v1
kind: Dialogue
data:
  id: scene
  startNode: ask
  nodes:
    ask:
      set: # state: set when the node starts
        is_dreaming: true
      content:
        speaker: Character.stranger # content: who speaks
        text: Are you dreaming? # content: what is said
      options:
        say_yes: # option: a player choice
          next: answer # flow: where the choice leads
          content:
            text: Yes.
        say_no:
          requires: # state: shown only when this matches
            is_dreaming: false
          content:
            text: No. # no next: the dialogue ends
    answer:
      content:
        speaker: Character.stranger
        text: Then wake up.

In OSF terms these are the Node, Option, Content, Links and Variable pages of the format reference. How a player runs them is defined once, in Playing a dialogue.

Around the dialogues

A project also has one Story, the Characters who speak, and Documents for the places, items and lore that the text refers to.

Scene context

Context such as the background, camera angle, music or animation is not part of OSF v1. See Metadata for where this stands.