Skip to content

Overview

This section describes the engine’s internals: the model each subsystem imposes on a game, how that subsystem behaves, and why it is shaped that way. It states the model and the guarantees; the exact surface is at APIs and the idioms are at Usage.

Each subsystem resolves one part of a browser game that is the same in every browser game, and the model it imposes is what makes a build’s behavior reproducible across runs and examinable from outside. Two properties run through every page. A game reaches the engine only through the scoped api handed to the function it is in, and everything the engine observes it broadcasts as an event a caller subscribes to.

A third property is particular to 3D. The picture is a retained scene the engine owns and the game populates, drawn through an engine-owned camera the game poses, with a 2D screen layer composited over it for the readouts every game needs. The state carries the simulation alone, and the three objects a game builds live beside it rather than in it.

PageCovers
FrameThe loop, simulated time, the clock behind delta time, pacing, and the order of one frame across the two surfaces.
ViewportThe fixed logical design size, the letterboxed fit over both canvases, the renderer’s viewport and scissor, the measurement seam, and the per-frame resync.
RenderingThe retained scene, the two surfaces and the compositing that joins them, the engine-owned camera, shadows, and why three objects stay out of the state.
Camera and ViewThe three spaces, posing the camera from render and reading it from update, picking with a ray, projecting a point, and the listener.
InputNamed actions over bindings, magnitudes and edges, the pointer, and the 3D touch layout catalogue with its analog sticks.
AudioSynthesized and file-backed cues, positional playback from the camera, the first-interaction unlock, and the cue events.
AssetsThe single asset root, path resolution, textures and glTF models as templates, and the load events.
DiagnosticsNamed sources, reading them back, the renderer’s counts, and the overlay drawn on the screen layer in device space.
Debug SurfaceThe object initialize returns beside the state, whose poses and readings a build is driven and read through from code.
RecordingA recording as a video of the frames the engine drew, what a frame is and when it is taken, simulated-time timestamps and keyframes, the bracket and the frame bound, arming around a section, and two recordings scrubbed in step.