ECS Architecture
Entity-component-system that scales from a few dozen to thousands of entities. Change detection, hierarchy, and event batching built in — so you focus on gameplay, not plumbing.
DownDraft is a TypeScript app engine that runs your code on a native runtime — winit + wgpu under Bun, Node, or Deno. Real desktop windows, not a browser. A typed-DI module system, a permission-tiered plugin/mod loader, and a built-in MCP server for AI-assisted development.
Quick Start
Bootstrap a project with the DownDraft CLI — templates, configs, and dev server all set up for you.
bunx @downdraft/cli new my-app Capabilities
Entity-component-system that scales from a few dozen to thousands of entities. Change detection, hierarchy, and event batching built in — so you focus on gameplay, not plumbing.
Deferred pipeline with shadows, post-processing, and a render graph with automatic resource aliasing. Ships with html-ui — Blitz HTML/CSS rasterized in a worker and composited in-process — plus an offscreen-rendered surface mode for world-space UI.
User-authored plugins and mods load at runtime from plugins/ — worker-js, WASM, QuickJS, and asset-pack formats behind tiered permissions. Engine features compose separately through a typed-DI module system.
Built-in MCP server exposes scene editing, entity spawning, asset management, and debugging over JSON-RPC — usable by AI assistants or any MCP client.
Rapier3D-powered physics with character controllers, collision detection, and multi-realm support behind a backend-agnostic API surface.
Spatial audio powered by Kira (Rust FFI) with a full mixer, effects chain, and 3D listener tracking.
Architecture
DownDraft pairs a deferred WebGPU render pipeline with a modular plugin ecosystem in a single native process — Bun, Node, or Deno for the JS runtime, winit for windowing, wgpu for the GPU. Zero-copy SharedArrayBuffer keeps data flowing between threads with no serialization overhead.
Runtime
DownDraft apps run as a single process driving a real OS window and the GPU directly — Bun by default, with Node and Deno supported. The platform is a Rust library your code calls into, not a shell around it.
Windowing, rendering, assets, and the MCP server all live in one process. Talking to the platform is a plain function call — nothing crosses a process boundary, so nothing gets serialized, copied, or awaited on a channel.
The simulation runs in a dedicated worker thread with SharedArrayBuffer, so heavy app logic never blocks rendering. Workers can even share the GPU device and encode command buffers in parallel.
Apps ship as one executable plus a Rust library — tens of megabytes for Bun-compiled builds (Node-embedded builds are roughly double), with low baseline memory. What your GPU draws is exactly what your code asked for.
Render Pipeline
Everything — simulation, rendering, and UI — runs inside one native process. The host owns the window and GPU device; workers handle simulation over SharedArrayBuffer. Frames go straight to the screen.
Single-threaded scheduling for the ECS in a dedicated worker thread, with multicore work dispatched over SharedArrayBuffer — no locks, no serialization.
wgpu drives the scene — compute shaders, explicit resource binding, and a Bevy-style render graph with automatic resource aliasing. Translated to Vulkan, Metal, or D3D12 depending on platform.
html-ui documents (Blitz HTML/CSS) rasterized in a dedicated worker and drawn straight onto the frame for HUDs, menus, panels, and the docked devtools UI.
Offscreen UI rendered to a GPU texture via the native-osr module, imported into the render graph and drawn as geometry — for panels that need to exist inside the 3D scene.
One frame, one process — simulation, scene, and interface presented together on the native window. Built-in devtools and tracing profile any of it.
Status
DownDraft grew out of the engine work for To The Ocean and is now being built as a standalone engine. Architecture decisions are still being made in the open — feedback shapes what ships.