Skip to content

The runtime — how the port plays the game ​

Prerequisite: Engine architecture.

The format docs answer one question: what is in the bytes on disk. This section answers the other one: what the engine does with them at runtime — the behaviour that DFET never needed, recovered from TI.EXE and from observing the real game.

The two are kept apart deliberately. A format page stays true as long as the 1996 files don't change; a runtime page describes living code that gets refactored. Runtime detail in a format doc ("how the UI band is drawn", "how a cricket pans") goes stale with every refactor, so the format pages stick to bytes and link here for behaviour.

The pages ​

Read in any order — each names its own prerequisites.

  1. Timing — the heartbeat, loops, crickets & walks — the two time bases, makeloop's one-shot-that-re-arms model, positional ambient sound, actor walks, and the game clock behind the pocketwatch.
  2. The sinking — how mission 4's clock runs — the one level played against a clock, and why that clock counts engine passes rather than seconds: the heartbeat, the conversations, the phase timetable's hold, and the movement bump that makes turning in place cost you the ship.
  3. Stage & UI — flats, overlays and the click order — the StageController: how a stage opens, the overlay stack behind the inventory, and exactly who gets a click first.
  4. Characters — actors & puppets at runtime — walking CST sprites in the world and PUP conversation close-ups: facing math, occlusion, speech pacing, subtitles and choice bevels.
  5. Audio at runtime — channels, banks & volumes — the three playback channels, how a name finds its bank, the two-slot currentsound model, and the volume controls (including one deliberate divergence).
  6. Saving & loading at runtime — what a save snapshot contains, the script-free load that restores the engine from the file rather than re-running the room, and the in-browser saved-games UI with its IndexedDB "file system".
  7. The browser host — the part that is neither format knowledge nor recovered behaviour: the page and the cold boot it starts, the SetViewer navigation state machine, the movie player, input wiring, and the developer toolbar.
  8. The low-memory game — the smaller version of itself the game shipped with: what BOOTFILE's own lowmemory() switches off, why .11K is not 11 kHz, and the one number the port moves to let a player hear it.
  9. Languages & the chooser — one data tree per language, how a bare filename resolves through two selectors (disc and language), the code page a tree's text is in, and the language chooser: this port's own DreamFactory stage, scripts and all.
  10. Rooms in play — DreamFactory 5 — RedJack's rooms: the scripts that do the moving, the camera sprites are drawn through, how big a sprite is, pictures that stand in the room, and the two depth sources that hide a sprite, at a node and on film.
  11. TH mode — Titanic and Dust on a wide display: the room's view alone, with the menu band tucked away until it is wanted.

Where the code lives ​

Paths are relative to engine/src/ — runtime/ is the recovered engine, web/ is the browser layer around it, df/ is the format library (the architecture map has the full inventory). The Page + input row is a game's code rather than the engine's, and is named as such.

SubsystemSourcePage
Heartbeat, loops, crickets, walksruntime/scheduler.ts, runtime/clock.tsTiming
The mission-4 clock and its phase timetableruntime/scheduler.ts (serviceGameClock), runtime/setscripts.ts (openScene/viewChanged)The sinking
Stage layer (STG at runtime)runtime/stage.tsStage & UI
Actors (CST at runtime)runtime/actors.ts, runtime/geometry.tsCharacters
Puppets (PUP at runtime)runtime/puppet.ts, web/puppet-view.tsCharacters
Props (SHP at runtime)runtime/props.tsStage & UI, SHP
Audio channels + bank libraryruntime/audio.tsAudio
The heapsize answer the game's lowmemory() readsruntime/builtins/helpers.tsThe low-memory game
Save/load orchestrationruntime/saveload.ts (.ti), runtime/saveload-v1.ts (.rtd)Saves
Saved-games UI + storageweb/save-browser.ts, web/save-store.ts, taoot/src/save-seed.tsSaves
Navigation + renderingweb/viewer.ts, web/ring-cache.tsBrowser host
The screen everything composites intoweb/screen-presenter.ts, web/screen.tsBrowser host
Movie playbackweb/movie-player.ts, df/mov-pace.ts, df/mov-sound.tsBrowser host, MOV
Page + inputtaoot/src/main.tsBrowser host
The menu band tucked away on a wide displayweb/tylerhartman.tsTH mode
What a launch has to have in handruntime/bootplan.ts, web/host.tsThe boot plan

The interpreter itself — scopes, operators, the event chain — is a language topic and stays in the scripting doc; the full command list is in the builtin reference.

Start with the one everything else leans on: Timing.

Docs licensed GPL-3.0 (the decoder is ported from DFET). Game data © CyberFlix — not included.