Skip to main content

Module cinematic

Module cinematic 

Source
Expand description

Cinematic files: a list of shots and when each starts, over a length of time (ticket 1113; game ADR-0060). The engine reads the file’s frame and checks its times; what a shot shows is the game’s own (S), checked by the game (ShotCheck) and played by shuyi_ui::cinematic.

(
    id: "title",
    length: Music("title"),     // or Seconds(10.0)
    shots: [
        (at: 0.0, shot: Pan(from: (4, 9), to: (12, 3.5))),
        (at: 6.0, shot: Logo),
    ],
)
  • at is seconds from the start. A shot lasts until the next one’s at; the last until the end. Shots cut: there is no fade.
  • length is Music(cue), the cue’s length_ms in the audio manifest (so the file never repeats a number the manifest owns), or Seconds(n) for a cinematic on no track.
  • actions (optional) are lists by name that shots may share: what a game’s actors act out, say. The game says what a list is (P) and checks them with its shots.
  • Unknown fields are refused. Times are kept in whole milliseconds, so a checked cinematic holds no floats and can be compared with Eq.

As a format (ADR-0007), CinematicRon reads a file as written (CinematicFile); check then checks it against the game’s music and shots.

Structs§

CinematicDef
One cinematic: its shots, in order, over a length of time.
CinematicFile
A cinematic file as written, before any check: S is a shot and P a list of actions as the game writes them (() for a game whose shots share none).
CinematicRon
The cinematic file (cinematic, .ron) of a game whose shots are S and shared lists P, read as parse says: as written, before any check. check checks it, with the cinematic’s file stem (AssetPath::stem), the music and the game’s shots.
ShotDef
A shot and when it starts.
TimedShot
A shot as written, and when it starts.

Enums§

Length
How long a cinematic is, as its file says.

Constants§

MAX_SECONDS
The longest a cinematic that states its own length may be, in seconds.

Traits§

ShotCheck
How a game checks its shots S, one file at a time; it may keep what it learns from one shot for the next (a shared list it checked).

Functions§

check
Checks cinematic raw, read from file, whose name without its extension is stem, with the music cues of audio and the game’s checks of its shots. Reports every problem, in order:
from_source
Reads and checks cinematic source (parse, then check), for a game whose shots share no actions.
millis
seconds in whole milliseconds, or None if it isn’t a time: not a number, below 0, or past what a u32 holds.
parse
Reads cinematic source (errors attributed to file) without checking it: a game whose shots share actions makes its ShotCheck from them, then calls check.
seconds
ms in seconds, for a message.