Open Story FoundationAn open format for interactive stories.

You write the story. Every engine reads it.

OSF is an open, plain-text format for dialogues, characters and translations, with a strict schema and a validator. Any engine or tool can read it, so nobody has to write another exporter.

Spec status: v1

osf — zsh

~/story $ osf validate the-last-lighthouse

the-last-lighthouse/arc_1_war/01_intro_scene.osf:24:13: error: OSF113 Node node_03, Option node_03_option_01: next: node "node_05" does not exist in Dialogue 01_intro_scene; did you mean "node_01"?

the-last-lighthouse/arc_1_war/01_intro_scene.osf:33:3: warning: OSF900 Node node_04 in Dialogue 01_intro_scene is never reached

the-last-lighthouse/story.osf:11:10: warning: OSF901 Jpn: 16 of 16 texts untranslated (not enforced)

1 error, 2 warnings.

Written by people. Checked by the validator. Read by every engine.

arc_1_war/01_intro_scene.osf.osf
Versions {
  language = "1"

  story    = "v1"
  dialogue = "v1"
  i18n     = "v1"
}

Dialogue 01_intro_scene {
  Node node_03 {
    speaker: protagonist
    text: "Am I dreaming?"

    Option node_03_option_01 {
      text: "Yes, you are."
      set: { is_dreaming: true }
      next: node_04
    }

    Option node_03_option_02 {
      text: "No. Fool"
      next: Dialogue.02_shadows_speak
    }
  }
}
example-yaml/…/01_intro_scene.yamlOSF resource
apiVersion: dialogue/v1
kind: Dialogue
data:
  id: 01_intro_scene
  nodes:
    node_03:
      content:
        speaker: Character.protagonist
        text: Am I dreaming?
      options:
        node_03_option_01:
          set:
            is_dreaming: true
          next: node_04
          content:
            text: Yes, you are.
        node_03_option_02:
          next: Dialogue.02_shadows_speak
          content:
            text: No. Fool
  • Unity
  • Unreal
  • Godot
  • Your engine
  • Your tool
One file, read by any engine or tool that supports OSF. osf convert writes the resources as JSON or YAML, and a game engine reads them directly.

The problem

Every team rebuilds the same plumbing.

01

Every tool invents its own format.

Studios can’t move content between tools without a rewrite.

02

Every engine needs its own exporter.

The same integration work is repeated by every vendor, for every engine.

03

Studios fear lock-in.

So they hesitate to adopt new tools, including yours.

How OSF works

Two open layers. Write one, ship the other.

People write the .osf language, a brace-based syntax like Terraform’s HCL. It compiles to OSF resources: one YAML file per resource with apiVersion, kind and data, like Kubernetes manifests, described by a JSON Schema. A tool only has to read and write one of the two layers to interoperate.

Plain text, strict schema.

Readable by people, diffable in Git, parseable by machines. Write .osf in VS Code with the Open Story Format extension for highlighting, folding and comment toggling. YAML resources get completion and validation in VS Code, JetBrains and Neovim through the JSON Schema.

git diff
@@ arc_1_war/01_intro_scene.osf @@
     Option node_03_option_02 {
-      text: "No. Fool"
+      text: "No, fool."
       next: Dialogue.02_shadows_speak
     }

Versioned plugins.

Every resource’s apiVersion is <plugin>/<version>. One Versions block pins them all, so an upgrade is a one-line change, and a compiler that doesn’t support a listed version stops instead of guessing.

versions.osf
Versions {
  language = "1"  // version of this syntax

  story    = "v1"  // built in: Story, Character, Document, Variable
  dialogue = "v1"  // built in: Dialogue
  i18n     = "v1"  // plugin: I18n settings and Locale blocks
}

Translations built in.

Every text has a stable key. Translations live in one folder per language. Per language, choose whether a missing line is an error or falls back to the source.

story.osf
I18n {
  source = Eng
  Locale Rus "Russian" { enforce = true }
  Locale Jpn "Japanese"
}
keyEngsourceRusenforce = trueJpnfalls back
Dialogue.01_intro_scene.nodes.node_01.content.textWhere am I?Где я?→ Where am I?
Dialogue.01_intro_scene.nodes.node_03.options.node_03_option_01.content.textYes, you are.Да, спишь.→ Yes, you are.
Dialogue.01_intro_scene.nodes.node_04.content.textStrangeСтранно→ Strange

Validate, format, build.

CLI ready

One CLI checks schema, references, variable types and translations, formats files for clean diffs, converts .osf to OSF JSON or YAML resources, and plays a story in the terminal. Install it on macOS, Linux or Windows.

terminal
$ osf validate example
example/arc_1_war/01_intro_scene.osf:24:13: error: OSF113 Node node_03, Option node_03_option_01: next: node "node_05" does not exist in Dialogue 01_intro_scene; did you mean "node_01"?
example/arc_1_war/01_intro_scene.osf:33:3: warning: OSF900 Node node_04 in Dialogue 01_intro_scene is never reached
example/story.osf:11:10: warning: OSF901 Jpn: 16 of 16 texts untranslated (not enforced)

1 error, 2 warnings.

$ osf convert example      # after fixing the typo
example/story.osf:11:10: warning: OSF901 Jpn: 16 of 16 texts untranslated (not enforced)
Wrote json: 14 files in example-json (2 dialogues, 2 characters, 1 document, 1 variable, 16 texts).

Why join

Support OSF once. Grow with everyone who does.

This is an invitation, not a sale. One shared format grows everyone’s market, and nobody has to build it alone.

Your users keep their stories.

Studios adopt your tool without migrating content, and can leave without fear, which makes them more willing to come in.

Write one importer, not ten.

Support OSF once and read content written in every other OSF tool.

Grow without forking.

OSF is split into versioned plugins (story, dialogue, i18n), so the format grows by adding a plugin or a version, and files written for an earlier one keep their meaning.

Shape what comes next.

Version 1 leaves some things out on purpose: grammatical agreement (gender, plural, case) in references, inline media in text, and richer Document content. Members help decide what a later plugin version adds.

Get listed as OSF compatible.

Once your tool’s output passes validation, it appears on the members page.

Build it with us.Join the foundation →

Why plain text

Writing is the creative part. The plumbing shouldn’t be.

A writer’s job is the scene, the choice and the line that lands. Not exporters, not broken links, not a missing translation found a week before launch.

OSF keeps the story as plain text with a strict schema, in your own Git repo. The validator catches the broken reference, the unreachable node, the wrong variable type and the missing translation. Every change is reviewed like any other pull request, and the story stays yours.

“The words are yours. The format just carries them.”

Already built on OSF

One file, opened in two editors.

01_intro_scene.osf · Visual Studio Code
01_intro_scene.osf
1Dialogue 01_intro_scene {2  Node node_01 {3    speaker: protagonist4    title: "..."5    text: "Where am I?"6    next: node_027  }89  Node node_02 {10    text: "Total Darkness surrounds you."11    next: node_0312  }1314  Node node_03 {15    speaker: protagonist16    text: """17      What is it all about?18      Am I dreaming?19    """20    ...
01_intro_scene · LoreHub
node_01protagonistWhere am I?node_02narrationTotal Darkness…node_03protagonistWhat is it all about?Am I dreaming?Yes, you are.No. Foolnode_04StrangeDialogue02_shadows_speakset is_dreaming
The same 01_intro_scene.osf in VS Code (code only, with the Open Story Format extension for syntax highlighting) and in LoreHub (visual node editor).

How to join

Four steps to OSF compatible.

  1. 1

    Read the spec and the JSON Schema.

    docs/spec.md and schema/osf-v1.schema.json. The format is small: Story, Character, Document, Variable and Dialogue, plus the i18n plugin.

  2. 2

    Add OSF import and export.

    To your tool or engine. Read and write OSF YAML resources, the .osf language, or both.

  3. 3

    Validate against the example project.

    Run osf validate on your output and on example/ from the spec repository.

  4. 4

    Tell us.

    Send the form below and get listed as compatible.

Join the foundation

Tell us what you’re building.

Engine teams and narrative tool makers welcome. We read every request and reply by email.

Or write to hello@openstoryfoundation.com

FAQ

Questions tool makers ask.

Who owns OSF?

OSF is an open project started by Lostwood Games, the makers of LoreHub, inviting other tools to co-govern the spec.

What license is it under?

MIT. The license covers the specification, the JSON Schema, the examples and the osf CLI in the open-story-foundation repository. The Open Story Format extension for VS Code is MIT as well.

Is it stable?

Version 1 of the format is out, and the osf CLI is at 0.6.0. Each release adds to the format without changing what earlier files mean, so a project that an earlier osf accepts stays valid. A project pins every plugin version, and osf stops on a version it doesn’t support instead of guessing.

Do I have to use LoreHub?

No. LoreHub is the first visual editor built on OSF, and one implementation among the ones we hope to list here. Any editor that reads and writes the format works.

Can I add my own features?

Not as a third-party plugin yet. The format is built from plugins (story, dialogue and i18n are plugins themselves), but this version of osf only knows those, and an unknown plugin is an error (OSF102). Tell us what you need and it can become a plugin version.

What does it cost to join?

Membership terms are not set yet. Write to hello@openstoryfoundation.com and tell us what you are building.

Is there a CLI I can install?

Yes. On macOS or Linux run curl -fsSL https://openstoryfoundation.com/install.sh | sh. For Windows and manual downloads, see Install.

Is there editor support?

Yes. Install the Open Story Format extension from the VS Code Marketplace, or run code --install-extension lostwood.osf. It highlights the whole .osf language as of OSF 0.6.0 and adds folding, bracket matching and comment toggling. Checking, formatting and playing a story is done by the osf CLI.