Ludion

Open source, MIT or Apache-2.0. Pre-1.0.

A game engine built for AI agents to drive.

Ludion is a 3D engine in Rust where an agent can change a game, run it, and prove the change worked, without anyone looking at a screen. People work through an editor that speaks the same protocol the agent does.

Side view of the platformer at night: the tin mouse at the edge of a lantern-lit platform, facing a gap to the next one.

These games exist to push the engine, not to ship, and they look like it. What matters is how they got here.

One written brief each. Nobody steering.

Each game started as a document, not a conversation. From there to the first playable build, no person stepped in.

  1. A person and an agent write the brief

    Game design, look, rules, level, and how the agent will check its own work without seeing the screen. It is settled in one question-and-answer session. The platformer’s brief is under two thousand words.

  2. Agents build the game unattended

    They expand the brief into a design document and a plan, then write the code, the levels and the tests, verifying each step through the loop described below.

  3. The game pushes back on the engine

    A game may not work around a missing feature. It files a request and moves to other work, and the engine grows. These four games have had more than a hundred requests shipped.

Excerpts from the platformer’s brief

Theme and look

  • Hero: a clockwork mouse made as a tin toy: a lithographed tin shell with rivets, felt ears and a wind-up key in its back.
  • Mood: the factory after hours. It is dark, lit by pools of warm tungsten work lamps and spot lights, with glowing emissives. Lit surfaces double as readability cues.

How the agent verifies without looking

  • Route replays: committed scripted-input routes that must finish the level and each section.
  • Tests assert outcomes, never committed hashes: the goal or section end is reached, deaths = 0, cogs ≥ N, crates broken.
  • Goldens at key camera points, each blessed per pinned OS.

Engine relationship

  • No workarounds. If something is a feature a modern game engine is expected to ship, the game pauses the piece that needs it, files a request and moves to unblocked work. Emulating the feature in game code is forbidden.
Side view of the platformer: the tin mouse on dark platforms among crates, lit by warm lanterns.
Tests
About 250
Rust written
About 18,000 lines
Engine requests shipped
39
Human changes so far
Post effects tuned by hand

The excerpt is verbatim. A frame from the same game opens this page.

Change, check, prove. No screen required.

Most engines answer to a person at a monitor. Ludion answers in text an agent can read: compiler errors, structured diagnostics, state hashes, and image comparisons that say where a picture broke.

Change

Scenes and tunables are plain text with one canonical form. An agent's edit, a hand edit and a gizmo drag in the editor all produce the same small diff.

  scenes/main.yaml     - name: ball-glow      components:        PointLight:-         intensity: 1.2+         intensity: 1.6          range: 8.0

The first test of this was one line: "make a Breakout clone with dynamic lighting". A fresh agent went from an empty folder to a passing suite in about twelve minutes with no help. It also found the gap: a first render has nothing to compare against, so the agent still has to look at that one itself. Read the record of that run

One core. Everything else is a client.

Six ideas hold the engine together.

One protocol for every client

Every capability is a typed command on one layer. The CLI, the MCP adapter and the editor are thin clients of it. Nothing ships in the editor unless it already exists as a command, so anything a person can do, an agent can do.

Text is the source of truth

Scenes, materials and tilemaps are structured text with a stable order. Every edit is a reviewable diff.

  range: 8.0- intensity: 1.2+ intensity: 1.6

Deterministic by tier

The simulation is bit-exact everywhere. Images are compared perceptually, and byte for byte on two pinned machines.

Windows, x86eeed6beffc866257
macOS, ARMeeed6beffc866257

Errors are the interface

The bar is rustc's. Every diagnostic has a code, a path into the document, and a suggestion, and the same shape reaches every client.

{"id": 3, "error": {"code": "L3002",  "message": "`entity.spwn` is not a method this protocol version defines",  "path": "/method",  "help": "nearest known method is `entity.spawn`"}}

The docs are the prompt

No model was trained on a new engine. So the documentation ships inside the binary, written for agents, one topic at a time.

$ ludion docs physics$ ludion docs replays$ ludion explain L1014

The same eyes

The engine renders offscreen and streams frames over the protocol. The editor's viewport and the agent's screenshot are the same endpoint, so a person can attach and watch.

A sandstone ossuary hall with stone arches and a glowing cyan door, rendered by the engine.

Eight decisions, and what each one costs

None of this is free.

Rust is the only programmable layer

No scripting language. Designers describe behaviour, the agent writes Rust, and tunable values live in text files.

Cost A designer cannot script alone, and every behaviour change pays a compile.

The editor is a client, never the authority

It uses the same protocol as the agent. The dispatcher is one exhaustive match, so a command without a handler does not compile.

Cost Editor features wait for the protocol. No shortcuts for the GUI.

One thread owns the world

Every read and write goes through one command queue and applies at a frame boundary. The world is never shared behind a lock.

Cost No client gets an instant answer. Every query is at least a frame away.

Hot reload is recompile and restart

The engine snapshots its state, the game rebuilds, and the new process restores the snapshot.

Cost Slower than patching code in place, and components must survive a snapshot migration.

Sim code gives up conveniences

No standard hash maps, no system clock, no ad-hoc threads. Parallel work goes through one job system whose results do not depend on thread count.

Cost Ordinary Rust habits are compile errors in game code.

Approved images belong to two machines

Byte-exact comparisons run only on the pinned GPUs. Anywhere else they are a printed skip, not a failure.

Cost A contributor without that hardware cannot approve a new image.

Flaky tests are top-priority bugs

An agent will chase a phantom failure for hours, so a test that fails one run in fifty is treated as an outage.

Cost Time goes into the test bench that could go into features.

A game before a system

Every renderer feature has to appear in a game someone is building before it gets built.

Cost Networking, most of audio and ray tracing are deliberately absent.

More frames

From the same four games and from the engine's own render tests.

A curtain of cyan bullets sweeping across a horizontal bullet-hell level. A wooden pier with a red press gantry looming over it, from the 3D platformer. A white and cyan explosion flash filling the view in the arena shooter. Side view of platforms and crates lit by hanging lanterns, from the 3D platformer. An engine render test showing the full post-processing stack applied to a scene. A goblin flying into a market stall in the physics siege game. An engine render test of an interior room lit by indirect light. An engine render test of a row of physically based material samples. An engine physics test: a pile of rigid bodies settled on the ground.

Rendered headless. The engine tiles are compared on every test run.

Where it stands

The engine is written by AI coding agents under human direction, and the commit history says so.

Works today

  • Windows and macOS as equal targets
  • iOS: games export to an Xcode project and run on an iPhone
  • PBR materials, shadows, indirect light, reflections, particles, post effects
  • Physics, navigation, animation, voxel models, sprites, screen UI
  • A visual editor in Tauri and React
  • Record and replay of whole play sessions

Not there

  • A stable API or wire protocol
  • A crates.io release; projects depend on a checkout
  • Supported Linux builds
  • Networking, scripting language, ray tracing, consoles
  • Any plan to out-feature Bevy or Godot

Worth reading

Run it

You need Rust 1.94 and a clone of the repository. Without --window a game runs headless and serves its scene over a local WebSocket, which is the default.

View on GitHub
cargo run -p breakout -- --scene games/breakout/scenes/main.yaml --windowcargo test -p breakoutcargo run -p ludion-cli -- docs getting-started