6. Choreography
Choreography is the single architecture path for authored beats: story staging, movement, gestures, camera nudges, dialogue-triggered moments, and small expressive actions.
Do not create a parallel scene or beat system.
Concept Model
Section titled “Concept Model”flowchart TB sequence[Sequence] trigger[Trigger] steps[Ordered steps] beats[Parallel beats inside a step] intents[BeatIntent values] runtime[Runtime apply layer] commands[GameCommand values]
trigger --> sequence sequence --> steps steps --> beats beats --> intents intents --> runtime beats --> commands commands --> runtimeIn plain language:
- a trigger starts a sequence
- a sequence runs steps in order
- each step can contain beats that happen together
- pure code produces intents
- runtime code applies those intents to live actors, camera, dialogue, or commands
Pure Engine And Runtime Apply Layer
Section titled “Pure Engine And Runtime Apply Layer”flowchart LR data[Assets/Data/choreography.toml<br/>Assets/Data/scenes/*.toml] engine[src/game/choreography.rs<br/>pure state machine] intents[BeatIntent] commands[GameCommand] apply[src/runtime/choreography.rs] world[Live actors, camera, state]
data --> engine engine --> intents engine --> commands intents --> apply commands --> apply apply --> worldThe split matters. The engine can be validated and previewed without Macroquad. The runtime decides how those intents affect textures, positions, camera, and live state.
Scene Projects
Section titled “Scene Projects”Scene files live under:
Assets/Data/scenes/*.tomlEach scene can declare sequences. Scene-qualified ids allow larger story arcs to chain across files.
flowchart LR sceneA[vale_meeting.toml] seqA[vale_meeting:intro] seqB[vale_meeting:depart] sceneB[vale_departure.toml] seqC[vale_departure:arrive]
sceneA --> seqA --> seqB seqB --> sceneB --> seqCInvocation Sources
Section titled “Invocation Sources”Sequences can start from multiple places:
flowchart TB time[time/mode trigger] event[game event trigger] dialogue[dialogue play_sequence] lua[Lua echo_warrior.play_sequence] chain[on_sequence_finished] engine[choreography engine]
time --> engine event --> engine dialogue --> engine lua --> engine chain --> engineThis lets content authors connect story, combat, and tiny motion beats without new Rust verbs.
Tooling
Section titled “Tooling”src/bin/choreo.rs is the contract CLI:
flowchart LR toml[TOML scenes] validate[choreo validate] convert[choreo convert] schema[choreo schema] preview[choreo preview] graph[choreo graph] gui[future authoring tools]
toml --> validate toml --> convert toml --> preview toml --> graph schema --> gui convert --> gui preview --> gui graph --> guiUseful commands:
cargo run --bin choreo -- validate Assets/Data/scenescargo run --bin choreo -- schema --out choreography.schema.jsoncargo run --bin choreo -- preview Assets/Data/scenes/example_scene.toml introcargo run --bin choreo -- graph Assets/Data/scenes --jsonChange Rule
Section titled “Change Rule”If you need a new authored beat:
- add it to the choreography schema/model
- make the pure engine emit an intent or
GameCommand - make the runtime apply layer handle it
- validate it in
choreoandmod_check - document it for modders
Do not wire a one-off cue directly into runtime unless it is truly runtime-only and not authored content.