How to engineer an AI harness for game development
57 points by kkukshtel 5 hours ago | 22 comments

bob1029 3 hours ago
> I stand by a lot of what I’ve said, but am in the process of shipping a project where I’ve also used none of this. I think the scale I’m targeting here is really larger projects.

The author appears to be on track to learn an important lesson about LLMs and art. LLMs have completely solved the coding side of game development. But this was never the hard part. Not even close.

The fixed randomness and determinism thing sounds great on paper (all of this does), but in reality this is an extremely confining way to build a video game. Ensuring you maintain determinism across many platforms is where things get super nasty.

If you want a turnkey AI game development experience, why not double down on diffusion? This sidesteps virtually all of the tooling and integration concerns. There is no game engine to integrate with if you use a diffusion model.

reply
pton_xd 3 hours ago
> LLMs have completely solved the coding side of game development.

This is not quite true. Currently you still need to give them guidance on what type of architecture would best work for your game, or after many iterations on gameplay you'll end up with terrible performance and a complete mess of a codebase. I expect that will be solved sooner rather than later, though.

reply
LogicFailsMe 2 hours ago
Indeed, not even wrong. And it will whiff on the most basic gameplay issues. But it is still genuinely impressive how fast it can build a pretty but unplayable unfun thing out of nothing. And that's after many rounds of planning with it as it proceeds to ignore all that planning just because it can.

PS no, I am not interested in your alternative harness that will supposedly 100% trust me bro fix all these issues

reply
kkukshtel 11 minutes ago
hello, author here!

It's definitely not my intention to try and describe ways for making game development be more turnkey. I'm more trying to directly address ways to make non-one-shot (read: actual) game development be more tenable when an agent is involved.

reply
glimshe 3 hours ago
I partially agree. Coding is not the hardest part for a large portion of indie games. You can in theory build an AI-coded game that sells well if you have the right art and gameplay.

But many top games have complex engines and online services that require technical mastery beyond the current AI capabilities. For those genres, engineering is a huge barrier of entry.

For a not so extreme example, you won't vibe code Cyberpunk 2077 while just taking care of art and gameplay ideas. Gosh, humans could barely pull that one off!

reply
rrradical 2 hours ago
> The fixed randomness and determinism thing sounds great on paper (all of this does), but in reality this is an extremely confining way to build a video game. Ensuring you maintain determinism across many platforms is where things get super nasty.

Why 'nasty'? I agree it's a problem to solve, but you just use a fixed-point math library and it's fine. Determinism is freeing, not confining. It allows you to do things like rollback netcode, replays and easy debugging. You can't just say that 'reality' happens to be what you in particular are used to.

reply
avaer 2 hours ago
> Why 'nasty'? I agree it's a problem to solve, but you just use a fixed-point math library and it's fine.

Assuming the agent didn't put in a native nondeterministic trig function deep in the code instead of using the library one, it's an easy mistake to make and hard to debug in a big game. It won't even show unless you have a robust CI matrix. It can indeed be "nasty" to maintain.

Also determinism might work for simulation state, but shader/gfx differences across platforms can be really nasty and a library can't save you. Not even something like WebGPU. Also if you're doing any sort residency streaming dependent on GPU timings trying to make that deterministic will be a nightmare.

reply
mypalmike 53 minutes ago
Unless the GPU output is feeding back into the game loop simulation, there’s no nightmare.

I’ve worked on games with intentional determinism, and it’s a very valuable tool. A playtester can hand a dev a recording of the game inputs (including clock) for whatever bug they encountered, and the dev can fast forward to the exact point and repro it 100%. The amount of time saved chasing down difficult bugs is enormous.

reply
wccrawford 2 hours ago
I think it's more generous to say it's not the only hard part. It's certainly very, very hard for a lot of people.
reply
simonw 3 hours ago
> Ensuring you maintain determinism across many platforms is where things get super nasty.

I learned that one the other day - I've been building a little RTS game with a replay mechanism, and replays in Safari broke where they worked in Chrome. Opus 5.5 fixed it by replacing calls to things like Math.sin() and Math.cos() with its own deterministic functions: https://gist.github.com/simonw/7df96ed7296c69b70a9990102cae0...

reply
dogsbarkdogsbyt 3 hours ago
[flagged]
reply
YesBox 35 minutes ago
> [I give a small introduction to myself and my own work, that I’m omitting here, as you’re on my website]

kkukshtel: You should keep that info, with links, even if its links to your site. Dont burden the reader.

Edit: I read the first half of the article then skimmed the rest (I dont use LLMs outside of occasional searches).

I've been a gamedev for five years. I have a hunch LLMs will not take over game development because of the necessity to control many, many small details to shape a great experience for the player, and because some parts of development cannot be described with words.

Small details: My hunch is when it comes time to polish and fine tune all the moving parts, this process will remain much faster to do by hand. It will be faster to update a specific field or line of code and test/iterate than to prompt your way through that process (the last 20% of the work takes 80% of the time)

Describing without words: An artist with a vision can only bring that vision to life with body movements. It is not possible to communicate all the details that go into a great piece of art with words. The colors, lines, shapes, positioning, specific emotions, history... is beyond spoken language.

reply
kkukshtel 9 minutes ago
I honestly didn't except this to get traction on HN so I'm updating the blog post now. I just read some recent post too that was like "mistakes technical blogs make" that I think brought up this same point yet here I am! Thanks for the tip.
reply
mawadev 36 minutes ago
I started coding because of gamedev, seeing this and potentially having some agents take care of the coding part is a blessing. I doubt this works as advertised but imagine iterating on stuff with a couple prompts and you can alt tab back into blender or libresprite. Very cool, lets put economics and employment aside
reply
theptip 2 hours ago
This matches what I came up with on a small project. The biggest ones being screenshots and separated simulation.

Meta level, just push your agent to make things more legible, it’ll figure it out.

One other observation, remember that your agent is infinitely patient. So prompts like “build an interactive design doc with videos of each game mechanic in the style of Factorio dev diaries” can make reviewing changes easier. The general idea, all the small QoL dev tools that you don’t have time for, you can just spawn a side agent to build; if they are orthogonal to your main thread you can just progress them in the background.

One thing I think game dev has not (AFAIK) invested as much in is observability. There’s a lot of perf instrumentation available in debug builds, but things like measuring DPS, health, etc as an exported metric time series I have not seen before. I think agents will benefit from this disproportionately more than humans, eg for inspecting progression curves and balance.

reply
gcampos 2 hours ago
A lot of the points the author made about game dev with AI are things that I notice in my experience as well. That is why me and a friend started to work on https://folly.gg an AI game maker that internalizes several of these learnings.
reply
roger23 3 hours ago
I was able to get a decent FPS out of around 40k lines (excluding tooling). Tooling consisted mostly of level editing and asset conversion which I tried to keep out of the main code-base.
reply
wslh 21 minutes ago
I recommend to also take a look at Godogen[1][2] which includes other insights as well. I also tried it to produce 2D animations of fairy tales.

[1] https://github.com/htdt/godogen

[2] https://hn.algolia.com/?q=godogen

reply
Kuyawa 2 hours ago
"LLMs are Bad At Games"

Oh no they're not. I built dozens of small games for the web and five games in Swift and they're spectacular, getting better since day one. Not like Call of Duty but just fun and bug-free enough to play them every day

reply
polotics 38 minutes ago
keyword here is "small" maybe?
reply
yonaguska 47 minutes ago
did you build games before the advent of llms?
reply
avaer 2 hours ago
AI can definitely do all aspects of game development now, but this advice seems to mostly apply to small indie titles or experiments.

For example, the Thing approach is reasonable for a small game, but it's a dead end for a performance budget or layered subsystems. In a reasonably sized 3D game, iterating and copying 30 subsystems of 1000's of Things is impossible to do in frame time, the only fix is a total rewrite of literally everyThing. That's why there's ECS, SOA, etc. which needs a different kind of harness.

Also, art completely dominates the production cycle of modern games, which (even if AI generated) needs its own category of harness not mentioned here. And AI can be very good at optimizing, but samply won't diagnose your overdraw, and GPU needs its own ablation and attribution.

For the time being there's no panacea and we still need "game developers", though the bar for prototypes (and certain genres) is lowered.

reply
kkukshtel 8 minutes ago
"Thing" style systems are very common in AAA. I link to the interview with the Dreams (Media Molecule) team where they describe a system very much like this. ECS is also not mutually exclusive here.
reply