Skip to content

DSL Scene Specification

CinematicEngine uses a declarative YAML-based Domain-Specific Language (DSL) to define cutscenes. The DSL is designed to be human-readable, modular, and strictly validated at load time by SceneDtoValidator and SnakeYamlSceneParser.


🏗️ Root Scene Structure

Every scene file represents a unified timeline sequence and can define actor staging, concurrent tracks, and metadata:

id: "castle_siege_intro"
duration: 300 # Total sequence length in game ticks (20 ticks = 1s)
metadata:
title: "Castle Siege Dramatic Intro"
author: "BuildTeam"
description: "Epic camera swoop over the castle walls with staged actors."
# Optional actor staging (virtual entities or clones)
actors:
- id: "hero"
type: "self_clone"
initial_position: [120.0, 64.0, 50.0]
initial_yaw: 0.0
initial_equipment:
main_hand: "DIAMOND_SWORD"
tracks:
- type: "camera"
# ... camera track configuration ...
- type: "actor_motion"
# ... continuous actor motion path ...
- type: "actor_action"
# ... poses, combat actions, and equipment ...
- type: "effect"
# ... synchronized particles and audio cues ...

Top-Level Properties

FieldTypeRequiredDescription
idstringYesUnique identifier for the scene (used in commands such as /cine play <id>).
durationintegerYesTotal duration of the scene in game ticks (must be positive, e.g. 200 = 10s).
actorslistNoDeclaration of staged actors (virtual, self_clone, persistent).
metadatamapNoArbitrary key-value metadata (e.g. title, author, version).
trackslistYesCollection of concurrent tracks executing on the unified timeline.

🎭 Actor Staging Declaration (actors)

When a cinematic requires dynamic characters, they are declared in the actors: header:

actors:
- id: "villain"
type: "virtual" # "virtual", "self_clone", or "persistent"
skin: "DarkSorcerer" # Mojang player name or skin UUID
initial_position: [100.0, 64.0, 50.0]
initial_yaw: 180.0
initial_pitch: 0.0
initial_equipment:
main_hand: "NETHERITE_SWORD"
helmet: "NETHERITE_HELMET"
FieldTypeRequiredDescription
idstringYesUnique identifier for the actor in this scene.
typestringNovirtual (default), self_clone, or persistent.
skinstringNoSkin profile name or UUID for virtual actors.
initial_position[x, y, z]YesWorld coordinates where the actor spawns.
initial_yawfloatNoInitial horizontal rotation in degrees (default 0.0).
initial_pitchfloatNoInitial vertical pitch in degrees (default 0.0).
initial_equipmentmapNoInitial equipment map (main_hand, off_hand, armor).

🛤️ Supported Track Types (tracks)

CinematicEngine provides specialized tracks for each subsystem:

Type (type)RolePrimary Purpose
cameraContinuousCamera movement and orientation (splines, rigs, and look-at).
actor_motionContinuousActor position trajectories (LERP or splines with tangent heading).
actor_actionDiscretePoses (CROUCHING), combat actions (SWING), item usage, and equipment swaps.
effectDiscreteBukkit particle emissions and positional sound effects.
actorContinuous (Legacy)Simple legacy single-track actor movement from earlier versions.

🎯 Keyframe Specification

Keyframes dictate property values at specific ticks:

keyframes:
- tick: 0
position: [100.0, 64.0, 100.0]
yaw: -90.0
pitch: 15.0
fov: 70.0
interpolation: "ease_in_out"

Keyframe Fields by Track Type:

FieldTypeSupported TracksDescription
tickintegerAllTimeline position in game ticks (0 <= tick <= duration).
position[x, y, z]camera, actor_motion, actorWorld coordinates as a 3-element numeric list.
yaw / pitchfloatcamera, actor_motion, actorOrientation rotation angles in degrees.
fovfloatcameraField of View in degrees (default 70.0).
interpolationstringcamera, actor_motionTransition curve (linear, ease_in_out).
posestringactor_actionEntity body pose (STANDING, CROUCHING, etc.).
actionstringactor_actionCombat animation (SWING_MAIN_HAND, HURT, etc.).
item_usagestringactor_actionUsage stance (BLOCKING, BOW_PULL, etc.).
equipmentmapactor_actionArmor and hand slots modified at this tick.
particlemapeffectParticle definition triggered at this tick.
soundmapeffectSound effect definition triggered at this tick.

🛡️ Validation Rules (SceneDtoValidator)

When /cine reload or scene initialization runs, the engine applies rigorous validation rules:

  1. Actor Staging Consistency:
    • Actor IDs declared under actors: must be unique.
    • Every actor must provide valid 3-element initial_position coordinates.
    • Tracks of type actor_motion and actor_action must define a valid actor_id.
  2. Chronological Consistency:
    • tick must be >= 0 and <= duration.
    • Keyframes are sorted by ascending tick automatically during mapping.
  3. Coordinate Validation:
    • position, initial_position, and target vectors must be numeric lists containing exactly 3 values: [x, y, z].
  4. Camera Track Requirements:
    • A camera track requires at least 2 keyframes to define a path.
    • Accepts look_at / look-at modes: fixed, static, actor, or forward.
    • The actor mode requires target_actor (or target-actor).