← Index · Next →

Babylon Level Kit — Engine (Runtime) Documentation

The runtime half of the kit, current as of engine v0.31.1 · Blender add-on v0.32.0. Not sure where to start? Use Choose your path below. Or open subsystem diagrams for interactive maps, or Search to jump to a topic.

Choose your path

Chapter numbers are for reference — you do not need to read 01 through 14 in order.

I want to…Read this (in order)
Brand new — first level in ~15 minutesQuickstart
Write a behavior with an LLM / MCPLLM Playbook · route_task on bjs-mcp · Scripting context
Write or debug behavior scripts (human)02 — Runtime Basics14 — API Guide05 — Scripting
Understand how a level becomes a running game01 — Architecture (two files, GUIDs) → 04 — Load Pipeline02 — Runtime Basics (what happens each frame).
Hack on engine code or trace a bug01 — Architecture04 — Load Pipeline → pick a feature trace or trace-load for step-by-step source.
See if the kit supports something13 — Feature List → follow the trace link on that row.

Doc types (quick glossary)

Many topics exist in all three forms — the subsystem map table below links them. Contributors: traces and diagrams are wired from PAGE_TOPICS; see BUILDING-DOCS.

What the runtime does

@bjs/engine (packages/engine/) loads the two artifacts Blender exports — level.glb (everything glTF can express) and level.scene.json (everything it can't) — and turns them into a live Level. LevelLoader.Load appends the glb, indexes nodes by GUID, builds an Entity per manifest entry, applies components through small subsystems (physics, lights, cameras, audio, …), then runs your Behavior scripts.

Subsystem map

SubsystemEngine diagramBlender diagramProse
Architecture / two artifactsarchitecture.htmlexport.html01
Runtime loopruntime-loop.html02
Load pipelineload-pipeline.html04
Blender add-onblender-addon.htmlindex.html03
Data model / GUIDarchitecture.htmldata-model.html01
Exportworkflow.htmlexport.html03
Validationworkflow.htmlvalidation.html09
Live Linkworkflow.htmllivelink.html09
Scriptingscripting.htmldata-model.html05
Inputinput.htmlinput-actions.html12
Physicsphysics.htmldata-model.html06
Rendering / scene lookrendering.htmlscene-settings.html07
Audio & animationaudio-animation.htmlexport.html08
UI (2D / 3D / particles)ui.htmldata-model.html11
Prefabs (linked .blend)workflow.htmlPREFABS.html09 · 03
Workflow / toolingworkflow.htmllivelink.html09

The interactive pages

Subsystem diagrams: index.html (engine overview) · architecture.html (two artifacts) · runtime-loop.html (frame timeline) · load-pipeline.html · scripting.html · input.html · physics.html · rendering.html · audio-animation.html · ui.html · workflow.html · blender-addon.html (the editor, from the runtime's point of view).

Code traces (each node is a step; click for the explanation + the actual current TypeScript source): Load · Runtime loop · Lifecycle · Components · Physics · @exposed · Triggers · Constraints · Audio · Input · Live Link · 2D GUI · Particles · MSDF text · 3D GUI · Atmosphere · Lights · Cameras · Shadows · Post-processing (trace-runtime-loop · trace-lifecycle · trace-components · …).

The prose chapters

  1. Architecture — two artifacts, GUID identity, monorepo, data flow
  2. Runtime Basics — app vs kit, bootstrap, frame loop, Babylon hooks
  3. Blender Add-on — the editor half + export pipeline
  4. Load PipelineLevelLoader.Load, the passes, FinalizeLevel
  5. ScriptingEntity, Behavior, @exposed, @inputMap
  6. Physics — bodies, constraints, triggers, right-handed import
  7. Rendering — lights, cameras, shadows, environment, atmosphere, scene look
  8. Audio & Animation — sounds, NLA clips, the skinned-mesh rule
  9. Workflow — Live Link, the validator, Debug Build, tooling, Babylon Launcher
  10. Feature Traces — every feature's Blender → runtime file/function chain
  11. UI — 2D GUI, particles, MSDF text, 3D GUI
  12. Input — Input Actions, stick vs 1D/2D bindings, control type, gamepad, axis half, @inputMap
  13. Feature List — every component, scene setting, and workflow feature in one table
  14. API GuideEntity, Level, Behavior, input, attachments (behavior authors)

Regenerating

npm run docs:build regenerates both sides from the shared shell template (docs/_template/diagram-shell.html) and rebuilds the searchable landing page. npm run docs:trace rebuilds only this folder; it re-extracts every trace's source from packages/engine/. A renamed/deleted symbol fails the build loudly — the anti-rot guard. (The Blender side alone is npm run docs:blender.)

Full build pipeline, file layout, and how to add traces or subsystem diagrams: Building the documentation.