Log inGet started
Package

film.module

Newest version

README.md

film

The shared constants and the film clock for DEADLIGHT. Every slice of the demo reads this module and nothing restates its numbers.

It holds three things:

  • The timing spine — the 14 shots, their durations and their windows. Film.SHOTS, Film.shotAt(t), Film.window(n), Film.movementAt(t). Durations live here and nowhere else.
  • The world contract — the shared coordinate frame (Film.WORLD), the named entities each slice owns (Film.NAMES), the submersible's contracted path (Film.SUB_PATH / Film.subPoseAt(t)), the anchor fallbacks that let the film play while it is still being built (Film.ANCHORS), the palette (Film.PALETTE) and the water's optics (Film.WATER).
  • The clock — a fixed 1/24 s step advanced once per RENDERED frame by deadlight.FilmDirector, never from wall time. 2,256 rendered frames is exactly the 94-second film, every time.
local Film = require("deadlight.film")
Film.restart()              -- t := 0, every slice resets, playing := true
Film.seek(48.0)             -- deterministic scrub to a moment
Film.status()               -- where the film is and who has joined it

Film.register("abyss", {    -- join from your own component's awake()
    reset = function()          end,
    tick  = function(t, dt)     end,
    shot  = function(n, tLocal) end,
})

Handlers run inside pcall, so one slice erroring cannot stop the film for the others. Registering a name twice replaces its handlers.