Skip to content

Overview

This section states how a build writes its code against Structured 3D: the shape of a build, the worked examples, and the idioms the engine expects. Every example here is game-side code.

The engine ships its own documentation inside its package. Seeding copies that directory into the run workspace at engine/, and the rendered prompt names the engine and points the build at it, so a model builds against the same contract this section states.

The build supplies a GameDefinition: a game instance class, a level registry, and the level the engine opens first. A level names the game mode to run and the actors placed in it. The engine builds a world from that description and drives it.

Opening a level awaits the level’s load, then constructs the game mode, the game state, and the declared actors. Every declared actor’s beginPlay runs in spawn order once all of them exist, and the game mode’s beginPlay runs last. Each frame the engine ticks the controllers, then the actors and their components, then the timers, then the collision pass, then the game mode, and renders the result: the world pass through the camera, and the screen layer over it.

The game instance is the one framework object that outlives a level transition, so a value that must survive travel lives there and a value scoped to one match lives on the game state. The instance’s initialize is where the action bindings, the cue definitions, the instance’s assets, and its diagnostic sources are declared, and it returns the debug surface a caller drives the build through.

PageCovers
Creating the EngineThe design size, the options createEngine takes, the peer dependency on three, the screen layer, sizing the canvas from CSS, choosing a clock, booting, and teardown.
Levels and WorldsRegistering levels, placing actors with 3D transforms, loading what a level needs, opening one from play, and what crosses a transition.
Game ModesWriting a mode’s rules, moving the match through its phases, adding players and bots, and carrying figures on the game state.
Actors and ComponentsWriting an actor, attaching components, moving and turning with the math helpers, mounting a component on an offset, tagging, finding peers, and destroying.
Controllers and PawnsReading a dual-stick layout in a player controller, driving a pawn with a move and a look intent, and running the same pawn from an AI controller.
RenderingAttaching mesh and light components, ordering them by layer, the render modes, the screen layer, and drawing directly.
Models and AnimationLoading a glTF model, placing it with a ModelComponent, playing its clips, and driving a named node.
CollisionDeclaring volumetric colliders, channels and responses, applying a response from the engine’s events, and the queries and raycasts.
Audio and AssetsDefining and loading cues, playing them from a tick with and without a position, and loading images, textures, and models under the asset root.
DiagnosticsRegistering instance and world sources and choosing what a case’s checks can read.
Debug SurfaceDeclaring the surface type, writing its poses and readings as methods over the live world, returning it from initialize, and driving it through engine.debug.