Introduction
Open Story Format
This is the documentation for the Open Story Format (OSF), an open format for interactive stories: dialogues, characters, documents, variables and their translations.
OSF has two layers. A tool only has to read or write one of them to work with every other OSF tool.
| Layer | Who uses it | What it looks like |
|---|---|---|
.osf language | Writers and designers, by hand | Brace-based blocks, like Terraform’s HCL. Whitespace never matters. |
| OSF resources | Engines, tools and validators | One file per resource with apiVersion, kind and data, like a Kubernetes manifest. Written as YAML or JSON and described by a JSON Schema. |
osf convert turns a project from any of the three forms into any other: .osf into JSON (the default) or YAML resources, and resources back into .osf for writers. Every page in these docs shows the .osf source first, and the YAML and JSON it converts to next to it.
Dialogue 01_intro_scene {
Node node_01 {
speaker: protagonist
text: "Where am I?"
next: node_02
}
Node node_02 {
speaker: stranger
text: "Somewhere you should not be."
}
}osf convertapiVersion: dialogue/v1
kind: Dialogue
data:
id: 01_intro_scene
startNode: node_01
nodes:
node_01:
next: node_02
content:
speaker: Character.protagonist
text: Where am I?
node_02:
content:
speaker: Character.stranger
text: Somewhere you should not be.Independent of any engine
The format is independent of any game engine, game or genre, so the same story can be loaded into Unity, Unreal, Godot or your own engine. If you are building an RPG with dialogue in it, you can read OSF with a small loader and keep your existing code.
There is no engine-specific output format. osf convert writes the OSF resources shown in these docs as JSON or YAML, and a game engine reads them directly.
Status
This is version 1 of the format. The full specification is docs/spec.md, the language is docs/language.md, every error code is listed in docs/diagnostics.md, and the machine-readable JSON Schema describes every resource file. All of them live in the open-story-foundation repository. The osf CLI used in these docs is v0.6.0; each release adds to the format without changing what earlier files mean, as listed in the changelog.