Mirage
A web-first, AI-native game engine written in Rust.
Role · Solo — architecture, engine core, editor
Language
Rust
Targets
WASM + native
Scripting
Node graph + TS
Mirage is a game engine built on a bet: that the next generation of engines will be authored as much by language models as by people. Every file it touches — scenes, prefabs, assets, project settings — is structured, plain-text, and self-describing, so an LLM can read a scene, understand it, modify it, and generate a new one without a binary format standing in the way.
It targets 2D and 3D through a single unified architecture — 3D-first with a native 2D workflow built in, following Unity's model rather than Unreal's.
Three principles
The whole design falls out of three commitments, and most of the hard decisions were resolved by asking which one was at stake.
- AI as a first-class citizen. No opaque formats. If an agent can't read it and write it back, it doesn't ship.
- Professional power, approachable surface. An archetypal ECS drives the internals for performance, but nobody authors game logic in ECS terms — they use a visual node graph or a restricted TypeScript subset.
- Modular to the bone. Rendering, physics, audio, UI, and scripting are swappable modules. Nothing is welded shut.
The scripting decision
The most interesting architectural problem was scripting, because the two authoring formats people actually want — a visual node graph and text code — usually force an engine to pick a side.
Mirage doesn't. .graph.json and the restricted TypeScript subset are two independent
front-ends that compile to the same runtime IR: CompiledScript, a flat Vec<Op>.
MirageVM, a register-based interpreter in Rust, executes that op vector directly
through a single large match. Neither format is the "real" one and neither is a
transpilation target for the other, so a designer working in nodes and an engineer
working in TypeScript produce artifacts of exactly equal standing.
Stack
| Layer | Choice | Why | | --- | --- | --- | | Core | Rust | Native and WASM from one codebase | | Rendering | wgpu | Vulkan, Metal, DX12, and WebGPU without per-backend code | | ECS | hecs | Lightweight and archetypal — no opinions, maximum control | | Runtime | MirageVM | Register-based interpreter over a flat op vector | | Editor | React + Tailwind, wrapped in Tauri | One UI for web and desktop | | Formats | JSON throughout | Scenes, prefabs, and asset descriptors stay agent-readable |
Status
In active development. The engine core and the scripting pipeline are the parts under construction; the editor shell shares its React UI between the browser build and the Tauri desktop wrapper.