The engine
An engine written as documents.
Press Start is a game engine written in Rust, with an AI agent as its first user. Every system is a document plus a plugin, checked before the app exists, and every feature can fail a test.
How it works
How a game is made here.
- 01Write the scene as data.A scene is a base plus patches. A field is set by name, never by a click.
- 02Check it before it runs.Every document is validated before the app exists. A refusal names the value and the fix.
- 03Run it on a fixed tick.A tick is the same tick on every run, driven by a recorded input tape.
- 04Look with numbers, then pixels.Ask for the state and its checksum, capture the frame, compare it with its golden.
use press_start_test_app::{advance, fixed_step_app};
#[derive(Resource, Default)]
struct TickCount(u64);
fn count_ticks(mut count: ResMut<TickCount>) {
count.0 += 1;
}
#[test]
fn three_fixed_steps_a_frame_are_thirty_after_ten_frames() {
let mut app = fixed_step_app(3);
app.init_resource::<TickCount>();
app.add_systems(FixedUpdate, count_ticks);
app.update(); // priming: Startup runs, zero fixed steps
assert_eq!(app.world().resource::<TickCount>().0, 0);
advance(&mut app, 10);
assert_eq!(app.world().resource::<TickCount>().0, 30);
}
Five strengths
Five things it does differently.
- Same seed, same gameOne seed, a fixed tick and no clock, so a replay is exact.
- Every core, one answerSystems run in parallel and conflicts are ordered, so the answer never moves.
- Held to a referenceEach part is measured against the tool the industry already trusts.
- The game answers backQuery, command, capture, control: four verbs for your own AI.
- Your codeA game is a normal Rust codebase, and it is yours.
In the box
What a game needs, in the box.
89 engine crates, in families. Each system is a document plus a plugin: the document holds the data and its rules, the plugin puts it in the app.
- Scenesdocuments, prefabs, patches
- Assetsmeshes, textures, materials, glTF
- Renderingshaders, sprites, terrain
- Physicsbodies, colliders, materials
- Characterscontrollers, animation, rigs
- Camerarigs and shake
- Inputactions, bindings, one input funnel
- Interfacelayouts, menus, localisation
- Audioevents and buses
- Effectsparticles
- Navigation and AInavmesh, crowds, behaviour trees
- Save and networksave slots, networking as a document
The engine in numbers
- 89engine crates
- 103features built, of 404
- 71reference tools
- 189accepted goldens
synced from the engine at commit c998685