Agentic DOOM · engine
The engine behind Agentic DOOM
Agentic DOOM runs on its own engine. It is written in Rust from the DOOM file formats, compiled to WebAssembly and drawn with WebGL2. Every monster in it is a declared state machine under a contract, and a small trained decision model runs inside the engine. All of it runs in the browser tab.
Play it at agentarena.caV agent view · F possible futures · J System One
01Written from the file formats
The engine reads DOOM's WAD data directly. It is not a C engine compiled for the browser: the map reader, the BSP renderer with DOOM's palette and light, and the simulation at DOOM's 35 tics a second are its own code. A modified level can be written back out as a standard PWAD, which other DOOM engines open.
02Small, and whole in the tab
The deployed build is static files: 889 KB of WebAssembly for the engine, its agents and System One, 99 KB of JavaScript, and 10.3 MB of compressed game data (Freedoom). The game, the contracts, the possible futures and System One all run in the browser. No server computes any of it.
03Monsters under contract
Every monster is a declared state machine. Each action one proposes is checked against its class's contract, a descriptor the engine reads as data, before the tic it would run in, and is granted or refused. Every decision goes into a ledger chained with SHA-256, and the admission rules and the chain match the Agentic Datasets reference.
04Every choice can be played forward
F holds the world at the next choice a monster makes, plays each of its options forward three seconds, eight times, on a copy of the world, and draws where each one leads and how much damage it does to the player. F again lets the game go on.
05A trained decision model inside the engine
System One (experimental, off until J) is a linear model over 51 features, compiled into the engine. Where a monster's contract leaves more than one choice, it scores the choices and picks one when it is confident enough. Otherwise the script picks, and the contract still grants or refuses every action. It also picks for a monster that has lost sight of the player, from what that monster remembers: when and where it last saw the player, whether its way ahead is clear, whether it is following a wall, and how far it has moved lately.
The rules and their bars were written and hashed before anything was labeled, trained or played. Each training decision came from games played under the same rule, with each choice held for ten seconds and played forward. On the nine maps of episode 4, held out from training, with 1,800 one-minute runs per arm against the script:
- A monster out of the player's sight got nowhere in 37.2% of five-second windows, against 58.4% under the script.
- The challenge stays: 982.3 damage to the player per run, against the script's 1,003.8, inside the bar set in advance. No prohibited action was executed.
- System One made the pick in 85.8% of the 194,254 decisions taken out of the player's sight.
- In the browser it makes the same pick as natively on all 196,026 decisions kept from the held-out runs.
06Two views of one world
V switches between the normal view and the agent view. The agent view draws the same geometry and the same light as streams of glyphs, each taken from the texture at that spot, and labels every monster, through walls, with its state and its last decision.