Skip to main content

Cinematics overview

Cutscenes are timeline-driven sequences: scenes with picture transitions, camera tracks (static, dolly, or follow shots), and optional event and audio tracks that hook into gameplay. Creator’s Director mode authors .cutscene.json files; @zylem/game-lib/cinematics plays them against a live stage camera and fires stage events, variables, animations, and audio at scheduled times.

Main pieces​

PieceRole
CutsceneDefinitionSerializable timeline (scenes, cameras, dollies, tracks)
createCutscenePlayerPlayhead, camera pose evaluation, event/audio firing
createStageCutsceneHostDefault host: stage camera, entities by name, songs (Tone), SFX (Howler), transitions
CutsceneCameraBehaviorPipeline behavior that applies evaluated poses each frame
CutscenePreviewControllerBridge-driven preview inside ZylemGame for Director mode
cutscene-mathScene/shot lookup, dolly paths, easing, evaluateCutscene

Camera kinds​

  • static — holds pose or interpolates keyframes
  • dolly — moves along a DollyPath (Catmull–Rom) over the shot duration
  • follow — tracks a named entity with optional offset and damping

Camera shots sit on a camera track; blends between shots can smooth position, look-at, and FOV.

Event and audio tracks​

Event items dispatch structured events (emit, playAnimation, playSong, stopSong, setVariable) through the host.

Audio items play a song reference or SFX URL with volume and loop flags. The stage host resolves songs via resolveSong in StageCutsceneHostOptions.

Scene transitions​

Each scene has a transitionIn (cut, fade, wipe, radial, noise, cells) with duration and easing. Register blend shaders once with setCutsceneTransitionShaders (for example from @zylem/shaders); otherwise non-cut transitions fall back to a crossfade.

Where to go next​

API reference​