comp-minds research
Research blog·

Cellular Weight-Space Programming: 3,207 Numbers Run a 3D First Person Shooter

AuthorArash Moaddel PhD
The agent that wrote the weightsClaude Fable 5.2 (Anthropic), in Claude Code

Walk down a shaded corridor, step up to a door and watch it open, turn to face a red enemy that is coming for you, and shoot before it bites. Everything you see and everything that happens is computed by one small neural network of just 3,207 non-zero numbers, run identically in each of the 3,584 cells of a 64 × 56 sheet: the game rules and the 3D picture alike. The page writes seven key bits into every cell and copies three colour channels to the canvas. It has no player position, no map, no collision test and no renderer. An AI agent programmed the network's weights directly in weight space, with no training, no data and no gradient descent: cellular weight-space programming. They are the only non-zero entries among the 168,038 numbers in the weight file, and every one of them belongs to a named part of the program: a clock, key memory, movement, doors, enemies that hunt you along shortest paths, a line of fire, health, and a renderer that draws a perspective corridor whose light falls off over four depths. We are not aware of a neural cellular automaton that is a playable first-person game, or of a 3D view drawn inside any cellular automaton, before this one.

Figure 1. The game, running in your browser. Click the picture to load it, then play with W / S (forward, back), A / D (step sideways), Q / E (turn 90°) and F (fire); the arrow keys and space work too, and P pauses. The buttons under the game do the same on a touch screen, and step the automaton one step or one tick at a time. The top 64 × 40 cells are the screen. The 16 × 16 block under it is the level, drawn by its own cells: walls grey, doors blue, you green, enemies red, and the cells of your line of fire dark green. The five red pips at the left are your health; a bite turns the screen red for a moment. Switch Map: off for the screen alone. The readout under the game (HP, heading, enemies, open doors, the clock) is read from the cells' state and never written back. Every frame is the network's own output, two steps per animation frame by default.

"Can it run Doom?" is one of computing's longest-running jokes. Since id Software released Doom's source code in 1997, people have ported it to calculators, played it on the screen of a pregnancy test and shown it on a 32 × 48 display made of E. coli cells[1,2]. Neural networks have joined in: GameNGen simulates DOOM inside a diffusion model at 20 frames per second, after training on tens of millions of recorded frames[3]. This article gives a different kind of answer. Nothing here runs Doom's code, and nothing was trained. It is a small Doom-style corridor shooter, closer in its mechanics to Wolfenstein 3D[4] than to Doom[5], rebuilt from nothing as the rule of a cellular automaton.

A neural network is a program whose instructions are numbers, and those numbers are almost always found by gradient descent. A new line of work, which its authors call weight-space programming, asks language-model agents to write the numbers instead[6–8]. Setting weights by analysis is much older than that: the first model neurons were designed to compute logic[9], recurrent networks with suitable weights are universal[10], compilers turn short programs into transformer weights[11,12], and looped transformers have been constructed to run general programs[13]. What agent-written networks have done so far, though, is solve puzzles: they read an input, run to an answer and stop. A game is a different kind of program. It takes new input at every step, keeps its state for as long as you play, and has to draw a picture at every step.

A cellular automaton is a grid of cells that all apply the same small rule, again and again, using only what their neighbours hold. Any such rule can be written exactly as a small convolutional network[14], and a neural cellular automaton is one whose rule is that network, normally trained by gradient descent[15]. The rule here has the usual neural-cellular-automaton shape: a 3 × 3 convolution, a ReLU, a 1 × 1 layer, another ReLU and a final 1 × 1 layer, whose output is added to the cell's state. It has one addition, a second 3 × 3 kernel dilated by four cells[16], so that news can cross the sheet quickly. An AI agent, Claude in Claude Code, programmed every weight directly: no training, no data, no gradient. We call this cellular weight-space programming: an AI agent writes the weights of a neural cellular automaton's rule directly, so that one small rule, repeated in every cell, carries out the whole program. It is the cellular counterpart of weight-space programming[6] and of its looped form[8], and the name is for how the network is made, not for a new algorithm. It wrote a short Python program, doom3d.py, that sets each unit's weights through a few small helper functions, and exported the result to the weight file your browser is running.

3,207non-zero weights and biases, of 168,038 numbers
3,584cells, every one running the same network
26steps per game tick, about 0.2 s in the browser
0frames of gameplay, training steps or gradients

1.What you are playing

The whole game is one sheet of 64 × 56 cells. The top 64 × 40 cells are the screen, one cell per pixel. Under it, centred, a 16 × 16 block of cells is the level itself: each map square is one cell, and that cell holds whether it is floor, wall or door, and whether the player or an enemy is standing on it. The level is a small maze of one-cell corridors with 117 open squares. You start in the bottom-left corner facing north, with five health points. Three enemies wait in it, and four door cells block some of the corridors. The rest of the bottom strip holds the health pips and black filler.

Every cell carries 84 numbers, its channels. Figure 2 shows where they go. Twenty-one of them the network never writes: a constant channel, the thirteen channels of the starting picture that say where each pixel sits in the perspective view and where the walls of the level are, and the seven key channels. Those seven are the page's only way into the game. While you hold W, the page sets channel KW to 1 in every one of the 3,584 cells, and that is all it does with your keyboard.

Left: the 64 by 56 sheet, the screen at the top showing a corridor with a red enemy, and under it the health pips and the 16 by 16 map block. Right: the number of channels in each of nine groups.
Figure 2. One sheet, two jobs. Left: a frame of the sheet, with the 64 × 40 screen outlined in teal, the 16 × 16 map block in yellow and the health pips in red. Right: the 84 channels each cell carries, in nine groups. The largest group, 29 channels, is the report that tells every pixel what lies ahead (section 3).

Because every cell receives the same keys and starts with the same clock, heading and health, every cell keeps its own identical copy of these shared registers, without ever exchanging them with its neighbours. The fifteen shared registers hold the key memory, the clock, the enemies' phase, the heading (four one-hot channels) and the health and pain counters. The map cells hold the moving parts of the world: the player bit, enemy bits, open-door flags, the line of fire and the flood that guides the enemies. The screen cells hold what each pixel shows. Figure 3 lets you look at any of them.

GroupChannelsWhat it holdsWritten by the network?
screen layout10where this pixel sits in the perspective picture (depth bands, left or right, side-wall wedge, enemy sprite), fog, gun and muzzle masks, pip slotsno, part of the starting picture
map layout3the level: map block, floor, door cellsno, part of the starting picture
keys7KW KA KS KD KQ KE KF, 1 while heldno, the page writes them
shared registers15key memory, clock, enemy phase, heading, HP, pain; the same in every cellyes
map state12player, enemies, open doors, line of fire, bite, the reach flood and its four pointersyes
report29what is ahead, left and right at depths 0–3, and a bite bit, spread over the whole sheetyes
pixel latch4what this pixel shows: wall shade, door shade, enemy, darknessyes
colour3R, G, B, the only channels the page drawsyes
Figure 3. The sheet, cell by cell. A recorded state from the chase in section 5, on the step just before the pixels latch a new picture. Hover over any cell: a screen pixel shows its perspective numbers and what it latched, a map cell shows wall, floor, door, player or enemy and its flood pointer, and a cell in the bottom strip shows its pip slot. Pick any of the 84 channels to see it as a heat map with its range and the parts of the program that write it, or click a group in the bar to jump to it.

2.Inside one cell, in 3D

Before reading the program, here is the network it lives in. Figure 4 draws the weight file as a network you can walk around: the 3 × 3 neighbourhood and the dilated kernel gathered from the sheet, the two hidden layers, and the update added back to the cell, with every non-zero weight drawn as a wire. Click any unit to read what it computes.

Figure 4. One cell's network. Drawn from the weights: the cell's 84 channels, its neighbours' channels through the 3 × 3 kernel and the kernel dilated by four cells, 276 first-layer and 247 second-layer units, and the 83 channel updates. Drag to orbit, scroll to zoom, click a node for a plain-language explanation. It loads three.js from a CDN when you click. Open it full screen ↗.

The network has room for 352 first-layer and 288 second-layer units, and the program uses 276 and 247. Of the 276, 149 look only at the cell's own channels. 127 also read neighbouring cells through the 3 × 3 kernel: 98 of them only direct neighbours, the other 29 all eight, and those 29 also read cells four steps away through the dilated kernel. They are the ones that carry the report across the sheet. Every cell runs all of them at every step, whether it is a pixel, a map square or filler. What makes a pixel behave like a pixel is only what it holds: a map cell's screen-layout channels are zero, so every rendering unit stays silent there, and a pixel's map channels are zero, so no player can ever walk onto it.

Four small gadgets

The program never states a weight matrix. It states units, through a small set of helper functions in asm.py, and each call writes the weights of one unit. Treating channels that hold 0 or 1 as bits, three gadgets do almost all the work, and all three are threshold units of the kind McCulloch and Pitts designed in 1943[9], built from ReLUs:

inv(q) = 1 − q NOT AND(a, b, c) = ReLU(a + b + c − 2) 1 only if all three are 1 step(x, lo) = ReLU(x − lo) − ReLU(x − lo − 1) 0 when x ≤ lo, 1 when x ≥ lo + 1 out(ch, q, w): add w · ReLU(q) to the update of channel ch

A first-layer unit is ReLU of a weighted sum over the 3 × 3 neighbourhood (plus, for 29 units, the dilated one). A second-layer unit is an AND or a sum of first-layer units. An out adds that unit, times a weight, to one channel. That is a thin assembler, not a compiler: there is no high-level language underneath, as there is in RASP and Tracr[11,12]. The agent decided which units to write and what each one means.

3.How a picture gets drawn: depth bands and lighting

Wolfenstein 3D drew its grid-map levels by casting one ray per screen column[17,18]. The automaton cannot do that: no pixel can see the map, and nothing can loop over columns. It splits the problem in two instead. The map cells near the player say what is in front of them, the news spreads to every cell, and every pixel then decides, alone, what it would show if that news were true.

Every pixel knows where it is in a corridor. The starting picture stores five numbers in each screen cell. They describe a fixed picture of a corridor four cells deep, made of four nested wall planes, centred on the screen, with half-sizes of 24, 12, 8 and 6 pixels. SXB counts how many of the planes the pixel lies inside horizontally, and YB vertically. LEFT says which half of the screen it is in. DIAG marks the wedges between the planes' corners where side walls appear, and ENR says inside which depths' enemy sprite the pixel falls. These numbers never change. They are the perspective, stored once in the picture rather than computed in the weights.

The cells ahead of the player say what they see. The player's map cell and the three open cells straight ahead of it (the chain B1 B2 B3, which is also the line of fire) are depths 0 to 3. Each one reports seven bits: is there a wall, a closed door or an enemy right ahead of it, and is its left or its right side open or a door. That makes 28 report bits, plus one for a bite. From count 4 to count 23 of each tick these bits flood over the whole sheet, one cell per step through the 3 × 3 kernel and four cells per step through the dilated one. They reach all 3,584 cells by count 19. Without the dilated kernel a tick would need 68 steps instead of 26.

On the latch count, every pixel decides. On count 24 every pixel combines the report with its five numbers. If the first solid thing is at depth k and the pixel lies inside plane k, it is a front-facing wall, door or the black space around an enemy, shaded for depth k. If it lies in band k on the side wedge, with nothing solid before depth k, it is a side wall, or a side door, or, if that side is open, the wall seen through the opening. Inside the sprite for depth k it is the enemy. If nothing solid is reported at any depth, the middle of the screen is darkness: the corridor goes on beyond the four cells the view can see.

Figure 5. Perspective and shading, stored in the pixels and lit by the weights. Left: the four nested wall planes stored in the screen cells, drawn with the FRONT, SIDE or RECESS brightness the weights give them; switch between the three modes and hover a pixel for its SXB, YB and wedge values and its brightness. Middle: the three brightness arrays against depth. Right: the automaton's own frames, with an enemy at depths 3 to 0 and a closed door at depths 3 to 1.

The lighting is a shader written in weights. Each latched shade is a brightness, and the brightness depends on which way the surface faces and how far away it is. A wall facing you is brightest, a side wall at the same depth a little darker, and a wall seen through a side opening darker again, and all three fall off with distance. Floor and ceiling are fogged: their brightness rises from the horizon towards the edges of the screen, from values stored per pixel. On every step, not only on the latch count, the colour channels are rebuilt from scratch: the shade times the wall's sandy colour, the door's blue or the enemy's red, the fog where nothing covers it, then the gun on top, the muzzle flash while F is held, the health pips, and the red pain and death tints.

DepthPlane half-sizeFRONTSIDERECESS
0, the cell right ahead24 px0.950.800.60
112 px0.700.580.45
28 px0.500.420.33
3, the farthest6 px0.360.300.25

The pixel rules, from doom3d.py, read almost as they are described. For each depth k, a front wall is the report bit FW at depth k, inside plane k in both directions, on the latch count; a side wall is band k, the right half, the wedge, nothing solid in front, and that side neither open nor a door:

sq = (inX[k], inY[k], latch) out('WSH', AND(V('FW', k), *sq), FRONT[k]) # wall facing you out('DSH', AND(V('FD', k), *sq), FRONT[k]) # door facing you base = (band[k], side, diag, clear[k], latch) out('WSH', AND(*base, inv(V(o, k)), inv(V(dch, k))), SIDE[k]) # side wall out('WSH', AND(*base, V(o, k), inY[k]), RECESS[k]) # wall behind a side opening

The last argument of out is the brightness: one weight in the third layer. The lighting model of the whole game is those twelve numbers and the fog gradients.

4.The clock: one tick in 26 steps

A cell sees only its neighbours, so anything the whole sheet has to know takes time to spread. The program therefore runs on a clock. Every cell counts CLK from 0 to 25 and starts again, and since every cell starts at 0 and adds 1 per step, they all agree. The 26 counts are a schedule:

CountsWhat happens
0–13the reach flood spreads from the player through open floor, up to 14 cells, and each cell keeps a pointer to where it came from (section 5)
4–23the player's cell and the chain ahead say the report, and the report bits flood the sheet
24the latch: every pixel turns the report into wall, door, enemy or darkness
25the tick: the world moves. The heading turns, the player steps, doors open or close, the shot lands, and on every third tick the enemies step and bite

A key you tap in the middle of a period is not lost. Each key has a shared memory register that switches on while the key is held and stays on until the tick that uses it, then clears. The clock itself is five lines:

tick = step(me('CLK'), T-2) # the last count: the world moves late = step(me('CLK'), T-3) latch = total(late, scale(tick, -1.0)) # the count before: pixels read the report out('CLK', inv(tick)) # +1 on every count but the last out('CLK', total(raw('CLK'), scale(inv(tick), -(T+4.0))), -1.0) # on the last, back to 0
Figure 6. One period, step by step. Recorded on a tick in which the player walks forward. The lanes show when each part of the program is active: keys remembered, the reach flood, the report being said, the report flooding, the latch and the tick. Press play or drag the step to see the screen after that step and the cells that hold a report bit; it covers all 3,584 cells by count 19. The sentence under it says what that count does.

In the browser the page runs two steps per animation frame by default, so at 60 frames per second a tick, one player action, takes about 0.22 s, and an enemy moves about every 0.65 s. The demo's README gives 6.8 ms per step in Chromium with TensorFlow.js[19]. In NumPy on a laptop, a step takes a median of 34 ms, close to 0.9 s per tick.

5.The world rules: moving, doors, enemies, the shot and your health

All the rules act on the map cells, on the tick, with 3 × 3 rules. No cell knows where the player is. A cell only knows whether the player is on it or on one of its four neighbours, and that is enough.

Moving and turning

Q and E rotate the four heading channels, the same in every cell. To move, each map cell asks: is the player on my neighbour in the direction opposite to the move, and am I passable, meaning open floor, not a closed door and no enemy on me? If so, the player bit appears here. The cell the player stood on runs the mirror-image test and clears its bit. W beats S, S beats A, and A beats D, so two keys never move the player twice. Walking into a wall does nothing, because no cell accepts the player.

Doors that open as you approach

A door cell is open while the player stands on it or next to it, or an enemy stands in it, and it is recomputed on every tick, so it closes behind you once you have passed. The rule is two lines:

near = step({(0,0,'PL'): 1, (0,0,'EN'): 1, **{(dy,dx,'PL'): 1 for dy,dx in DIRS}}, 0) out('DO', AND(raw('DO'), tick), -1.0); out('DO', AND(raw('MD'), near, tick))

Walking towards a door you see it closed, in blue, at depths 3, 2 and 1. One tick after you reach the cell in front of it, it is gone and the corridor continues.

Enemies that hunt you

On counts 0 to 13 of every period a flood spreads from the player's cell through open floor, one cell per step, so it reaches every square within 14 steps of walking. A cell that the flood reaches remembers, in one of four pointer channels, the neighbour it first arrived from. That is breadth-first search without a queue[20], Lee's wavefront router[21] with its back-pointers, and the same idea as the breadth-first neural cellular automata Earle and colleagues constructed[22]: the pointers are the search's parent links, so following them from any reached cell leads to the player by a shortest route. On every third tick an enemy steps to the cell its pointer names. An enemy within 14 cells therefore walks the shortest way to you, one farther away stands still, and because the flood does not enter a closed door, none can come through one.

comes = n.u1({(od[0],od[1],'EN'): 1.0, (od[0],od[1],'P%d' % d): 1.0}, -1.0) # an enemy next door points at me out('EN', AND(comes, pass_self, inv(PL), tickE)) # it arrives here out('EN', AND(EN, cango, tickE), -1.0) # and leaves where it was

The line of fire and the shot

The open cells straight ahead of the player, up to three, carry the chain B1 B2 B3: each switches on if the cell behind it holds the player or the previous link. The same chain gives the renderer its depths. Holding F on the player's tick removes an enemy standing at the end of the chain, so you can hit an enemy up to four cells away with nothing between. The gun's muzzle flashes yellow while F is held. The shot is not taken on the enemies' tick, one tick in three, so it can take two ticks to land.

Bites, health and pain

On the enemies' tick, an enemy next to the player bites: the player's cell sets a bite bit, which floods over the sheet like a report bit. When it arrives, at the next latch, every cell lowers its shared HP by one and sets a pain counter to 20, which falls by one per step and tints the screen red as it does. The pips at the bottom left are a template of five slots in the starting picture, and a pip stays lit while HP is at least its slot number. At HP 0 the screen turns red and every action is switched off, because every movement rule includes the test "HP above 0".

Figure 7. Recorded play. Two scripted routes, run through the same weights in NumPy. Chase (73 ticks): the player walks to the long east corridor, two enemies come down it, one bites, the player shoots it, and the other bites until the player dies. Door (22 ticks): up to the door at (6, 6), seen closed at depths 3, 2 and 1, open when the player is next to it, walk through and turn. Drag the slider or press play. Beside each frame is a map drawn from the same state, with walls, doors, the player's arrow, the enemies, the reach flood with its pointers and the line of fire. On the shot tick a button shows the frame from the middle of the period, with the muzzle flash.
Figure 8. The chase. The walking distance from each of the three enemies to the player at every tick of the chase route (measured by the page with breadth-first search, only to plot it), the shot and the player's HP. Once inside the reach flood, an enemy closes one cell every third tick. The first bite comes at tick 45 and the shot removes that enemy at tick 46. The second enemy bites at ticks 60, 63, 66 and 69: five bites from five HP to none. The third stays nine cells away for the rest of the run, held back by the closed door at (13, 12). Hover a tick to see the flood and its pointers on the map.

These routes and the tests in the demo's folder are scripted: walking, strafing, turning, the door, the chase, a bite, a shot and death, in NumPy and again in Chromium with TensorFlow.js. In two further checks, an enemy placed four cells north of the player walked south one cell every third tick and took HP from 5 to 4 on its first bite, and holding F with an enemy directly ahead removed it. The page's split evaluation of the network matches the dense tensors in NumPy to within 1.2 × 10−7 over 52 steps, with the same result at the tick.

6.All 3,207 weights

Because every unit was written for a reason, every non-zero weight can be assigned to the part of the program that wrote it. The game logic, the seven parts from the clock to the doors, takes 1,026 of the 3,207. The renderer takes the rest, 2,181: the report that tells the pixels what is ahead, the pixel rules and shader, the HUD and the map's own colours. Two thirds of the network draws the picture.

PartNon-zeroWhat it does
clock48the period-26 counter every cell keeps, and the enemies' every-third-tick counter
keys120remembers each key from the moment it is held until the tick that uses it
movement441heading (Q and E turn) and the player bit stepping to a free neighbour (W A S D)
reach144the flood from the player through open cells, 14 cells, and the pointer each cell keeps
enemies141an enemy follows its pointer every third tick, merges with another, and bites the player next to it
line of fire105the chain B1 B2 B3 ahead of the player, and F removing the enemy at its end
doors27a door is open while the player is on it or next to it, or an enemy stands in it
report1,296what is ahead, left and right at depths 0–3, said by the player's cell and the chain, flooded to every cell (232 of these are the dilated kernel)
screen776each pixel turns the report into wall, door, enemy or darkness on the latch count; fog and colours
HUD70the gun, the muzzle flash, the health pips, HP going down, the pain and death tints
map drawing39the map block's own colours: walls, floor, doors, the player, enemies, the line of fire
Figure 9. How empty the network is. Left: non-zero against all numbers in each tensor of the weight file (the page evaluates the first layer in three pieces: own cell Wc, neighbours Wn, dilated Wd), on a log scale. Right: the 3,207 split by program part. Hover for unit and weight counts. The non-zero weights take only 51 distinct values; 1,453 of them are +1 and 1,488 are −1.

The count needs one note. The demo's own README says 2,975 non-zero weights, because its counting function leaves out the 232 weights of the dilated kernel; with them the total is 3,207, biases included. Written as one dense network with the same units, both 3 × 3 kernels over all 84 channels, it would hold 506,591 numbers, of which 0.63% are non-zero. Skipping the zeros, a cell costs 2,855 multiply-adds per step; the pieces the page actually multiplies cost 167,432.

7.Against neural game engines

The idea of a neural network that is a game is not new, and the best-known examples are learned. World Models taught an agent inside a learned dream of a VizDoom scenario[23,24]. GameGAN learned to produce the next screen of Pac-Man from frames and key presses[25]. GameNGen runs DOOM in a diffusion model[3], DIAMOND runs Counter-Strike[26], Genie generates playable worlds from images and text[27–29], Oasis a Minecraft-like world[30], Muse the Xbox game Bleeding Edge[31,32], and Matrix-Game Minecraft[33]. The table sets them against this automaton on the axes where they differ most.

SystemGameHow it was builtSizeMemory and exactness
GameNGen[3]DOOMa reinforcement-learning agent's play recorded, 70M examples used; trained on 128 TPU-v5eStable Diffusion v1.4, augmented"a little over 3 seconds of history"; "not an exact simulation"; 20 frames/s on one TPU
DIAMOND[26]Counter-Strike: GO, Dust II87 hours of human play; 12 days on one RTX 4090381Mlearned, approximate
Oasis[30]Minecraft-liketraining data not stated on the project page500Mgenerated frame by frame, 20 frames/s
Muse / WHAM[32]Bleeding Edgeover 1 billion images and controller actions, over 7 years of play1.6Blearned, approximate
Genie 2, Genie 3[28,29]generated 3D worldsa large-scale video dataset (Genie 2); not stated (Genie 3)not statedconsistent "for up to a minute" (Genie 2), "for a few minutes" (Genie 3)
Matrix-Game[33]Minecraftover 2,700 h unlabelled and 1,000 h action-labelled play17Blearned, approximate
This automatonDoom-style corridor shooterprogrammed directly by an AI agent; no data, no training3,207 non-zerothe rules are the weights: positions, heading, HP and doors live in named channels and last as long as you play
How small is 3,207?

The learned game engines whose sizes are published range from 381 million to 17 billion parameters. This automaton runs its game with 3,207 non-zero weights and biases, out of 168,038 numbers in its weight file.

≈119,000×fewer than DIAMOND's Counter-Strike model, 381M[26]
≈500,000×fewer than Muse, 1.6B[32]
≈5.3M×fewer than Matrix-Game, 17B[33]
This automatonnon-zero, programmed
3,207
This automatonall numbers in the file
168,038
Looped WSP, smallestagent-written, mazes [8]
928
Looped WSPagent-written, mazes [8]
19,936
DIAMONDCounter-Strike [26]
381M
OasisMinecraft-like [30]
500M
MuseBleeding Edge [32]
1.6B
Genie2D worlds [27]
11B
Matrix-GameMinecraft [33]
17B
101001k10k100k1M10M100M1B10B100B

Log scale: each tick is ten times the last. Teal: this work. Orange: the agent-written looped transformer for mazes, shown for scale against another programmed network (its smallest version is smaller than this one; it solves a puzzle, not a game). Grey: learned game engines. This is a contrast of size and of kind, not a head-to-head result: those models produce rich, open-ended pictures learned from footage, and this is a 64 × 40 grid crawler with one fixed level.

What the comparison does and does not say. The learned engines are approximate because they learn a game from footage, and their state lives implicitly in pixels and a short window of past frames: GameNGen sees a little over three seconds of history[3], and Genie 3 stays consistent for a few minutes[29]. Here there is nothing to approximate. The rules are the weights, and the state lives in named channels for as long as you play. But "trained means approximate" is not true in general. Bamford and Lucas's Neural Game Engine, a convolutional network trained on pixels, learned the forward models of several deterministic grid games perfectly and generalised to level sizes it had not seen[34]. The right contrast is narrower: the large neural engines for 3D games are trained on large amounts of footage and are approximate; this one is programmed, exact and tiny, and it gives up nearly everything they do well. The field is also moving towards this kind of split. Matrix-Game 4.0 separates game execution from visual generation, with a lightweight engine holding the state and running the rules and a video model only for rendering[35]. Its answer to unreliable rules is to put them back into explicit code. The automaton keeps both the rules and the renderer inside one small network.

Where else this sits

Games inside cellular automata. Cellular automata have been universal computers since von Neumann[36], and Conway's Game of Life[37] can compute anything a computer can[38,39]. The closest precedent for a playable game that is a cellular automaton is the Quest for Tetris: a Tetris-playing computer in Life, 2,940,928 × 10,295,296 cells, built through metapixels, logic gates, a processor, an assembler and a compiler[40]. There, the rule is fixed and the program is a vast starting pattern that emulates a computer. Here, the rule is the program, and the game rules act directly on the map cells, with no emulated processor in between, on a sheet of 3,584 cells. The starting picture still carries data, the level and the perspective layout, much as a Life pattern carries its program. A shared clock and a sheet-wide broadcast in lockstep cells are, in effect, a systolic design[41,42].

Neural cellular automata and games. Trained neural cellular automata have been used as a mechanic inside a conventional game engine[43] and as players of games such as Pong[44]. In both, the automaton sits inside or across from a game. Here, the automaton is the game. Small convolutional networks that can represent Life exactly often fail to learn it from data unless they are made much larger[45], a reminder that a rule being representable does not make it easy to learn; nothing here tests whether this one could be trained.

Weight-space programming. The agent-written networks so far, including Looped Weight-Space Programming's maze-solving transformer with 928 to 19,936 weights[8], map an input to an answer and stop. This network takes input at every step, keeps a game's state across thousands of steps and draws a frame at every step, with a dozen interacting subsystems in one rule. Its size, 3,207 non-zero numbers, is of the same order as the smallest of those models. The same method, cellular weight-space programming, also gives a maze solver that finds every shortest path with 115 non-zero numbers[47].

A test bed for interpretability. Interpretability research tries to recover the algorithm a trained network runs, and compiled models with known circuits serve as test beds for it[12,46]. This network is such a model of an unusual kind, interactive, stateful and drawing its own output, and every unit in it is named in doom3d.py. Any method that claims to find "the enemy's pathfinding" or "the wall shader" in a network can be checked against it.

8.Limits

Conclusion

A playable first-person shooter in one cellular-automaton rule.By cellular weight-space programming, an AI agent programmed the weights of a neural cellular automaton directly, with no training, no data and no gradient, and the automaton is the game: 3,584 cells, each running the same network, do the movement, collisions, doors, enemy pathfinding, shooting, health and the 3D picture.
A renderer made of cells.With no ray casting, the cells around the player report what lies ahead, the report floods the sheet in under 26 steps, and every pixel lights itself from a stored perspective layout, with brightness falling off over four depths and differing for front walls, side walls and recesses.
Enemies that search.A breadth-first flood from the player leaves a pointer in every reachable cell, and the enemies walk the pointers: a shortest-path chase written in 285 weights (reach and enemies).
3,207 numbers, every one with a job.Two thirds of them draw the picture. Against learned game engines of 381 million to 17 billion parameters, it gives up their rich, learned visuals for exact rules, persistent state and a program that can be read.

What's next

The obvious extensions are a second level, a wider view and free movement between cells, each of which needs new layout channels or new rules. The other direction is training: the same graph trained by gradient descent on recorded play, including training that starts from the programmed weights, would show whether a learned network keeps or loses the structure that this one was given.

Citation

If you use this work, please cite it as follows.

@misc{moaddel2026fps,
  title  = {{Cellular Weight-Space Programming: 3,207 Numbers Run a 3D First Person Shooter}},
  author = {Moaddel, Arash},
  year   = {2026},
  month  = nov,
  note   = {Article, ibiLAB, Copenhagen}
}

References

  1. It runs Doom. Wikipedia (accessed 24 November 2026). en.wikipedia.org/wiki/It_runs_Doom
  2. id Software. DOOM open source release. GitHub repository id-Software/DOOM (source released 23 December 1997). github.com/id-Software/DOOM
  3. Valevski, D., Leviathan, Y., Arar, M. & Fruchter, S. Diffusion models are real-time game engines. Preprint at arXiv:2408.14837 (2024); ICLR 2025.
  4. Wolfenstein 3D. Wikipedia (accessed 24 November 2026). en.wikipedia.org/wiki/Wolfenstein_3D
  5. Doom (1993 video game). Wikipedia (accessed 24 November 2026). en.wikipedia.org/wiki/Doom_(1993_video_game)
  6. Takehi, R., Teoh, J., Zhang, A. & Khattab, O. Sparks of weight-space programming: LLMs can natively read & write neural network weights. Blog post, MIT CSAIL, 2 November 2026. rikiyat.github.io/blog/weight-space-programming
  7. Singh, C. Weight-space programming from scratch on simple tasks. Web report, 2 November 2026. csinva.io
  8. Elsayed, A., Heakl, A., Shaker, A., Khan, F., Khan, S. & Claude Opus 5.5. Looped weight-space programming: LLM-written transformers for long algorithmic reasoning. Blog post, MBZUAI, 23 November 2026. mbzuai-oryx.github.io/LoopedWSP
  9. McCulloch, W. S. & Pitts, W. A logical calculus of the ideas immanent in nervous activity. Bull. Math. Biophys. 5, 115–133 (1943). doi:10.1007/BF02478259
  10. Siegelmann, H. T. & Sontag, E. D. On the computational power of neural nets. J. Comput. Syst. Sci. 50, 132–150 (1995). doi:10.1006/jcss.1995.1013
  11. Weiss, G., Goldberg, Y. & Yahav, E. Thinking like transformers. Preprint at arXiv:2106.06981 (2021).
  12. Lindner, D. et al. Tracr: compiled transformers as a laboratory for interpretability. Preprint at arXiv:2301.05062 (2023).
  13. Giannou, A., Rajput, S., Sohn, J., Lee, K., Lee, J. D. & Papailiopoulos, D. Looped transformers as programmable computers. Preprint at arXiv:2301.13196 (2023).
  14. Gilpin, W. Cellular automata as convolutional neural networks. Phys. Rev. E 100, 032402 (2019). doi:10.1103/PhysRevE.100.032402
  15. Mordvintsev, A., Randazzo, E., Niklasson, E. & Levin, M. Growing neural cellular automata. Distill 5, e23 (2020). doi:10.23915/distill.00023
  16. Yu, F. & Koltun, V. Multi-scale context aggregation by dilated convolutions. Preprint at arXiv:1511.07122 (2015); ICLR 2016.
  17. Roth, S. D. Ray casting for modeling solids. Comput. Graph. Image Process. 18, 109–144 (1982). doi:10.1016/0146-664X(82)90169-1
  18. Sanglard, F. Game Engine Black Book: Wolfenstein 3D, 2nd edn (self-published, 2018). fabiensanglard.net/gebbwolf3d
  19. Smilkov, D. et al. TensorFlow.js: machine learning for the web and beyond. Preprint at arXiv:1901.05350 (2019).
  20. Moore, E. F. The shortest path through a maze. In Proc. Int. Symp. on the Theory of Switching, Part II (Annals of the Computation Laboratory of Harvard University 30), 285–292 (Harvard Univ. Press, 1959).
  21. Lee, C. Y. An algorithm for path connections and its applications. IRE Trans. Electron. Comput. EC-10, 346–365 (1961). doi:10.1109/TEC.1961.5219222
  22. Earle, S., Yildiz, O., Togelius, J. & Hegde, C. Pathfinding neural cellular automata. Preprint at arXiv:2301.06820 (2023).
  23. Ha, D. & Schmidhuber, J. World models. Preprint at arXiv:1803.10122 (2018); interactive version at worldmodels.github.io.
  24. Kempka, M., Wydmuch, M., Runc, G., Toczek, J. & Jaśkowski, W. ViZDoom: a Doom-based AI research platform for visual reinforcement learning. Preprint at arXiv:1605.02097 (2016).
  25. Kim, S. W., Zhou, Y., Philion, J., Torralba, A. & Fidler, S. Learning to simulate dynamic environments with GameGAN. Preprint at arXiv:2005.12126 (2020); CVPR 2020.
  26. Alonso, E., Jelley, A., Micheli, V., Kanervisto, A., Storkey, A., Pearce, T. & Fleuret, F. Diffusion for world modeling: visual details matter in Atari. Preprint at arXiv:2405.12399 (2024); project page diamond-wm.github.io.
  27. Bruce, J., Dennis, M., Edwards, A., Parker-Holder, J. et al. Genie: generative interactive environments. Preprint at arXiv:2402.15391 (2024).
  28. Parker-Holder, J., Ball, P., Bruce, J. et al. Genie 2: a large-scale foundation world model. Blog post, Google DeepMind, 4 December 2024. deepmind.google
  29. Parker-Holder, J. & Fruchter, S. Genie 3: a new frontier for world models. Blog post, Google DeepMind, 5 August 2025. deepmind.google
  30. Decart, Quevedo, J., McIntyre, Q., Campbell, S., Chen, X. & Wachen, R. Oasis: a universe in a transformer. Project page, Decart and Etched, 31 October 2024. oasis-model.github.io
  31. Kanervisto, A. et al. World and human action models towards gameplay ideation. Nature 638, 656–663 (2025). doi:10.1038/s41586-025-08600-3
  32. Hofmann, K. Introducing Muse: our first generative AI model designed for gameplay ideation. Microsoft Research blog, 19 February 2025. microsoft.com/en-us/research/blog
  33. Zhang, Y. et al. Matrix-Game: interactive world foundation model. Preprint at arXiv:2506.18701 (2025).
  34. Bamford, C. & Lucas, S. Neural game engine: accurate learning of generalizable forward models from pixels. Preprint at arXiv:2003.10520 (2020).
  35. Zhang, J. et al. Matrix-Game 4.0: harnessing video models for real-time playable game worlds. Preprint at arXiv:2610.27999 (2026).
  36. von Neumann, J. Theory of Self-Reproducing Automata (ed. Burks, A. W.) (University of Illinois Press, 1966).
  37. Gardner, M. Mathematical games. Sci. Am. 223(4), 120–123 (1970). doi:10.1038/scientificamerican1070-120
  38. Berlekamp, E. R., Conway, J. H. & Guy, R. K. Winning Ways for Your Mathematical Plays, Vol. 4, 2nd edn (A K Peters/CRC Press, 2004). doi:10.1201/9780429487309
  39. Rendell, P. Turing universality of the Game of Life. In Collision-Based Computing (ed. Adamatzky, A.), 513–539 (Springer, 2002). doi:10.1007/978-1-4471-0129-1_18
  40. PhiNotPi, El'endia Starman, K Zhang, Blue et al. (Code Golf Stack Exchange users). Answer to "Build a working game of Tetris in Conway's Game of Life" (question by Joe Z., 18 June 2013; answer posted 14 September 2017). codegolf.stackexchange.com/questions/11880
  41. Kung, H. T. Why systolic architectures? Computer 15(1), 37–46 (1982). doi:10.1109/MC.1982.1653825
  42. Toffoli, T. & Margolus, N. Cellular Automata Machines: A New Environment for Modeling (MIT Press, 1987). doi:10.7551/mitpress/1763.001.0001
  43. Sato, H., Lund, T., Yoshida, T. & Masumori, A. Automata Quest: NCAs as a video game life mechanic. Preprint at arXiv:2309.14364 (2023).
  44. Whitaker, J. Teaching neural cellular automata to play games. Blog post, 13 May 2026. johnowhitaker.dev/misc/nca_games.html
  45. Springer, J. M. & Kenyon, G. T. It's hard for neural networks to learn the Game of Life. Preprint at arXiv:2009.01398 (2020).
  46. Gupta, R., Arcuschin, I., Kwa, T. & Garriga-Alonso, A. InterpBench: semi-synthetic transformers for evaluating mechanistic interpretability techniques. Preprint at arXiv:2407.14494 (2024).
  47. Moaddel, A. Cellular weight-space programming: 115 numbers find every shortest path in any maze. Article, ibiLAB, Copenhagen, 24 November 2026.