AI NewsProductivityReported

Kyle Kukshtel on making a game legible to a coding agent

Game developer Kyle Kukshtel wrote up his talk on turning a game into a harness a coding agent can read, change and verify on its own.

AI News

Editorial3 min read

LinkedInX

Why it mattersCoding agents handle web apps well and most other software badly, and the gap closes with four patterns a team can add to its own codebase.

A coding agent that writes a Svelte web app in an hour fails the moment it has to touch a game. Kyle Kukshtel, a game programmer of fifteen years, argues the fix lies in how the game itself is written, and he names four patterns that make a game legible to the agent. His long post "Your Game Is A Harness", adapted from his talk at Indie Rodeo in Calgary, reached 168 points on Hacker News.

Kukshtel's claim is that most of a game is not code, which is the one thing an agent can read. Models, scenes, UI state, timing, assets: all opaque. He calls the fix a harness, a set of patterns that make the game legible to the agent and let the agent change state, run it and verify the result in one tight loop.

The four patterns

Seed every random call from one source. The thirtieth call to the random generator is then the same number every time, and the agent can reproduce a bug from a seed instead of guessing what the player did.

Save and load from day one, with every game object stored as one struct type. Kukshtel uses a Thing type with a shared isAlive flag and an enum for what kind of thing it is. One type means one deserialiser, no chain of parent classes to follow, and the agent knows where every change lands. He points at the Dreams team's talks on the same pattern.

Keep static data outside the game binary. Values a designer would touch (walk speed, attack damage) live in a file the game reads at launch, so changing a number needs no compile. He is building his own tool, Depot, for this; teams also use Google Sheets or custom editors.

Diff two screenshots with odiff, a free command-line image diff tool. odiff returns a similarity number ("85% similar") and a diff image. The agent reads the number and uses it as the eval target over each turn. A screenshot alone confuses the model, Kukshtel writes, because the whole image becomes context the model has to filter.

The loop

Pair the patterns with the command pattern, in which the game's actions are serialisable objects a central class applies to state. The agent then puppets the game by writing commands and replaying them, without recompiling. Kukshtel pushes this further: a game should split its simulation into its own library, so the agent can run the simulation in isolation and verify it without loading scenes, sounds or models. For profiling, he recommends samply, which prints its capture to text an agent can read, instead of a visual profiler built for human eyes.

Combined, Kukshtel writes, "an agentic turn can run through this whole loop in seconds". He does not give a before and after number for his own game.

The post ends with a caveat. Kukshtel is shipping a small project without any of this scaffolding; the patterns are aimed at larger games where an agent runs thousands of turns, and the extra engineering cost makes sense only at that scale.

For a team that builds anything opaque to an agent, which is most non-web software, the method generalises. A coding agent runs only as fast as the test-and-fix loop a team gives it. That loop is a product of the codebase itself, with the patterns above as a starting point.

Source

Your Game Is A Harness, Kyle Kukshtel. Hacker News discussion.

Reported byKyle Kukshtel

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX
Start a project