Your Game Is a Harness: Engineering AI Harnesses for Game Development
LLMs fail at game development not because models are weak at code, but because games contain large amounts of state that is not code and therefore is not legible to a model. That is the central claim of "Your Game Is a Harness," a blogified version of a 45-minute talk that game developer Kyle Kukshtel gave at Indie Rodeo in Calgary, published on his blog k-hole in October 2026. The essay's answer is architectural: make the game deterministic, make its data external, make its state changeable through serializable commands, and isolate its simulation from its engine — at which point the game itself becomes the harness an agent needs.
Why LLMs are bad at games
LLMs are bad at games because a game is not fully representable as code, and models can only reason about what they can read. Kukshtel, who describes himself as a game programmer of nearly 15 years, notes that he found LLMs close to universally capable on web stacks — he built a moodboarding site called mood.site largely by pasting code into ChatGPT — but that "any time I tried to use an LLM for a game-y thing, it would fall over."
He offers two explanations. First, training data: there are far more high-quality open-source web projects than open-source games, so the web stack is better represented. Second, and more structurally important, games contain "a lot of stuff in them that isn't code" — assets, scenes, tuning values, and authored content that cannot be expressed as source text. The one-shot Three.js game demos that LLMs handle well work precisely because everything in them is code: boxy primitives instead of authored assets, procedural layout instead of hand-tuned scenes.
"This is to say that, structurally, LLMs are bad at reading games. At least in their default state."
Kukshtel frames the fix as a context problem rather than a capability problem: "getting LLMs to work well with games is a context problem, not something that is intrinsically linked to how games or LLMs 'are'."
Context engineering and context pollution
Every LLM call breaks into a system prompt, an assistant prompt, and a user prompt, and every prior message in a session is resubmitted with each new message. Kukshtel compares this to a playground game where each turn requires restating everything everyone said before. The practical consequence is that bad material early in a session keeps informing later work — a failure mode he calls context pollution.
Context engineering, in his framing, asks "how can we get the best information into the context, with as little pollution as possible." He cites a blog post by Drew Breunig, "How Contexts Fail and How to Fix Them," for a fuller treatment. The relevant point for game development is that anything an agent cannot read — a scene file, a tuned value in an editor, a visual state — is either absent from context or present as noise.
What a harness is, and what it does not solve
A harness is a set of patterns an agent is meant to follow in response to a loosely defined input. Claude Code is a harness; harnesses can be extended, distilled, or abstracted for a specific domain. Kukshtel notes there has been a lot of activity building harnesses for different kinds of software work, tying in browser iteration, telemetry, profiling, and full SDLC tasks like filing tickets and writing documents.
What none of them do well, he argues, is talk to your game. "Your game is a bit of a black box, and most of what's visible to an LLM is only the code-as-written, which as we talked about before, isn't really enough." A harness alone does not solve the problem that games are not just code; the game itself has to be made addressable.
Make the game legible: the concrete techniques
Fixed randomness
Seed all randomness from a single source at game start, and route every non-deterministic call through it. Kukshtel's argument is that if your code calls a random float in 30 places, a seeded source guarantees the 30th call produces the same value every run, so almost any game state can be recreated exactly. He recommends adopting this constraint before writing the first line of code, because retrofitting determinism late in production "would likely require fundamental changes to your game in the 11th hour."
Screenshots are not enough — you need image diffing
Most engines have a built-in screenshot API, and Kukshtel recommends adding toggles for UI layers and gameplay layers so an agent can isolate the layer it is working on. But he is explicit that handing a model a before/after screenshot pair usually fails: even multimodal models struggle to identify what changed and whether the change moved toward the goal. The rest of the frame is context pollution — the model processes the entire image, not just the region you care about.
His fix is to diff the images the way you would diff code. He recommends odiff, a free command-line image-diffing tool that produces a visual diff image and a quantitative similarity value such as "85% similar." That number gives an agent a stable evaluation baseline it can try to improve across turns, turning screenshot comparison into a measurable inner loop.
Deterministic state and save/load from day one
Saving and loading is the practical test of how close a game is to deterministic state, and Kukshtel argues it must be built at the start rather than treated as a late feature. "Saving and loading, when leveraged at the VERY start of a game and programmed in conjunction with, can be a development superpower that has a near innumerable list of benefits."
Thing-driven development
Kukshtel's architectural recommendation is to treat every object in the game as the same type — he suggests calling it Thing. A tree is a mesh plus a collider; a dog is a mesh, a collider, and movement. From the code's perspective they are the same kind of object, distinguished only by an enum value and a set of stat fields such as attackDamage, walkSpeed, and boatSpeed, plus a shared isAlive flag.
The argument for this is agent legibility. "With a single object type, there is no ambiguity. AI knows exactly where to make changes, every time." With a hundred classes, an agent must load all of them and their relationships into context and then guess whether to extend a class, morph a type, or add a new one. A single type also makes serialization trivial: one way in, one way out, with no polymorphic deserialization or inheritance trees to reconcile. A game becomes a list of Things, and saving is writing that list through one path.
Kukshtel credits prior art, pointing to Wookash podcast episodes with the creators of Dreams, who described a similar system.
Addressable state and the command pattern
If every change targets one object type, changes can be captured as serializable command objects rather than loose function calls, following the Command Pattern. A processing class applies commands to objects instead of code mutating them directly.
The payoff is reproduction. Given a starting state and a recorded command stream, you can replay exactly what a player did — or what an agent did — without re-deriving it. Commands can also be authored outside the game, in a text editor or by an agent, and played back against a running instance with no compilation step. "Commands give the AI (and you), a typed interface to interact with your game, effectively making it 'puppet-able'."
Keep data outside the game
Kukshtel treats static operational data — the values that describe how things are, like attackDamage or walkSpeed — as something that should live outside the codebase and be deserialized at load time, not compiled in. Changing a value then requires no build, and no editor access. He describes this as the workflow used on the game Cantata, where roughly seven non-programmers on the team were given builds plus a custom data editor called Depot, and iterated on content without him cutting new builds. He is now turning Depot into a standalone product at depot-editor.com. Other teams use Google Sheets or custom internal tools, such as the content pipeline Riot Games has written about.
Standalone simulation (blackbox architecture)
Kukshtel's largest structural recommendation is to move the game's simulation out of the engine entirely, into its own library or DLL, with the engine communicating with it through commands and receiving updated state back. The engine is deliberately "dumb": if the simulation says an object moved, the engine moves it, no questions asked.
This indirection buys three things. Networked play becomes easier because the game already consumes states and diffs from an external source. Testing becomes possible without an engine at all, using plain language tooling. And anything — a network peer, a test harness, or an agent — can send commands to the same core. Kukshtel calls this "Blackbox Game Architecture" and cites a Roguelike Celebration talk by Brian Cronin about Monster Train, plus a Game Data Podcast conversation with the team behind Solium Infernum.
Impact assessment and profiling
To know whether a change had the intended effect, Kukshtel points at performance profiling as the most universal case. Traditional profilers are built for human eyes — call stacks and flame graphs — and he says agents do not use them well. What agents do use well is text. He recommends samply, a free profiler that can dump capture output to the console, which an agent can read and act on. He notes Unity is also working on making its profiler more agent-readable.
The full loop
Combining these techniques produces a cycle an agent can run in seconds: set deterministic input parameters, modify state through structured commands that avoid compilation, verify the change in isolation, and check impact through diffs and profiling output. Because the loop is cheap, it can run on every change rather than only on changes that seem important. Kukshtel's conclusion is the title of the talk: the game is the harness.
The author's own caveats
Kukshtel adds a postscript noting that he is shipping a project that uses none of these techniques, because the project is small enough not to need them. He frames the approach as suited to larger projects. He also states plainly that the essay is 100% human-written, from slides only, in response to readers who assume he uses AI to write.
What practitioners pushed back on
The Hacker News discussion surfaced several counterpoints worth weighing against the essay.
The Thing approach may not survive performance budgets. Commenter avaer argues the single-object-type design is "reasonable for a small game, but it's a dead end for a performance budget or layered subsystems," because iterating and copying thousands of Things across dozens of subsystems cannot fit in frame time. That, they say, is why ECS and struct-of-arrays exist, and those need a different kind of harness. They also note that art dominates modern game production cycles and needs its own category of harness, and that samply will not diagnose overdraw — GPU work needs separate ablation and attribution.
Determinism can be confining. Commenter bob1029 writes that the determinism advice "sounds great on paper (all of this does), but in reality this is an extremely confining way to build a video game," adding that maintaining determinism across many platforms is where it gets nasty. They also argue LLMs have solved the coding side of game development, which "was never the hard part," and suggest diffusion models sidestep engine integration entirely.
Polish and non-verbal craft may stay manual. Commenter YesBox, a five-year game developer, predicts LLMs will not take over game development because of the number of small details that shape a good player experience and because some parts of development cannot be described in words. "The last 20% of the work takes 80% of the time," they write, and hand-editing a field will likely stay faster than prompting.
Model performance is inconsistent in ways that are hard to explain. Commenter andai reports that frontier models could not add a feature to a simple Pong game without breaking something else, while a request to build an entire game roughly 100x more complicated was one-shotted cleanly. They speculate about in-distribution behavior without resolving it.
The advice is largely rediscovered software engineering. Commenter marcus_holohan describes the essay as "a tour through 'decouple your entities 101'," and hatthew observes that "it took inventing AI for people to start caring about good software engineering practices (debuggability, iteration speed, reliability, etc.)." KolibriFly makes the same point: "building good architecture for agents just ends up mirroring time-tested software engineering practices."
Agents can instrument a game themselves. Commenter TeMPOraL describes using Claude Code to get a 1997 PC game running on modern hardware, then gradually decompiling it, extending a shimmed DirectX DLL to run it headlessly, mapping memory addresses and game logic scripts, and producing level guides with screenshots. Their conclusion: "just let LLMs instrument your game and figure it out on its own."
Observability is an underused lever. Commenter theptip, who arrived at similar conclusions on a small project, highlights screenshots and separated simulation as the biggest wins, and adds that game development has underinvested in observability — exporting metrics like DPS and health as time series rather than only profiling in debug builds. They expect agents to benefit from that disproportionately, for inspecting progression curves and balance. They also note that agents are infinitely patient, so prompts like "build an interactive design doc with videos of each game mechanic" become practical.
Practitioners are building adjacent tooling. Commenter vanyle wrote an automated testing system that takes screenshots and simulates input, then published a guide on working with agents in the Vectarine engine. Commenter gcampos points to folly.gg, an AI game maker that internalizes several of the essay's lessons. Commenter armcat reports that rapid iteration on graphics assets and sprites was the biggest unlock, and links a Codex demo and a personal AI game studio tool. Commenter nicman23 describes using a harness of adb plus profiling changes and frame dumps to take the Eden emulator from crashing to roughly 20–30 fps on Breath of the Wild on a Pixel 10.
One dissenting framing on expertise. Commenter transitorykris highlights a passage in the essay where Kukshtel admits he judges LLM output as good in Svelte because he is less expert there, and bad in games because he is expert. They call it "a specific form of gell-mann amnesia" — catching bad assumptions in your own domain while having to trust the model more where you have little expertise.
The practical takeaway
The essay's argument is that agent capability on games is bounded by how much of the game an agent can read and verify, not by model quality. Seeded randomness, external data, serializable commands, and an engine-independent simulation core are all pre-existing game engineering practices; what is new is that they double as the interface an agent needs. The counterarguments from practitioners are equally concrete: the single-object-type model collides with performance budgets at scale, determinism is expensive to maintain across platforms, and the parts of game development that resist verbal description — polish, feel, and authored art — remain the least likely to be automated.
Sources
Related
- Dispatch
- Dispatch
- Dispatch