GameForge (An autonomous game studio run by AI agents)
Describe a 2D game in plain words. Nine AI agents design it, draw it, write its code, play it, and refuse to ship it if it isn't what you asked for.

Most "AI makes games" demos stop at a chat window that pastes code back to you. You still copy it somewhere, run it, find out it's broken, and paste the error back in. The AI wrote code, but you are still the build system, the QA team and the project manager.
I wanted to see what it takes to remove the human from that loop. So I built GameForge: a small game studio where every job is done by a specialised agent. You describe a 2D game, and the agents design it, draw it, write its code, build it, play it in a real browser, and compare the result with what you asked for.
Code: github.com/rohitisvibing/gamefactory
The nine employees
Product / Spec: turns the request into a spec, including a list of concrete must-haves.
Game Architect: plans the scenes and modules for this particular game.
Game Designer: rules, entities, controls, levels, screens, and the list of images the game needs.
Art Director: the visual style, and a prompt for every image.
Asset Generator: generates each image, cuts out its background, fits and validates it.
Gameplay Engineer: writes the game's entire source code and tests it in a sandbox.
Assembly: combines code and art into a type-checked production build.
QA & Playtest: plays the build, then compares it with the request.
Release: packages builds that QA has passed.
Art and code are produced in parallel and meet at Assembly. You can watch it live: every task, artifact, tool call and log appears in a control room as it happens, and you can close the tab while the work carries on.
Writing a whole game
The smallest engine I could get away with
Games share only a thin kit on top of Phaser 3: starting up, loading images, buttons, sound effects, saving, and a bridge QA can read. It contains no gameplay. A written contract tells each game what to expose, such as its score, its controls, and its pause and end screens, so one QA bot can play games it has never seen.
One file at a time
Ask a model for a whole game in one reply and it runs out of room. So the Gameplay Engineer:
plans the files and the interfaces between them;
writes one file per call, seeing only the files it depends on;
type-checks, unit-tests, builds and plays the game with placeholder art;
repairs failures with small find-and-replace edits.
Finished files are checkpointed, so a retry doesn't pay for them twice, and the shared context is cached.
Art that fits
The designer decides which images the game needs, and Gemini draws them. The model gives me opaque pictures, so sprites are drawn on a magenta backdrop and cut out locally. Each image is fitted to its designed size and validated, and one that fails validation is redrawn.
QA that asks whether it's the right game
"Does it run?" is the easy question. The one that matters is: is this the game that was ordered?
Generated code only ever runs in a throwaway container with no network, capped CPU and memory, and no Linux capabilities. There, QA:
type-checks the code and runs any unit tests;
plays the production build in a real browser, using the controls the game declares;
checks pause, level complete, victory, game over, phone layout and console errors;
shows Claude the screenshots, the source and the original request.
Every must-have has to be confirmed on screen or in the code. If one is missing, or the review didn't happen, the build doesn't ship.
When QA rejects a build, the orchestrator sends each bug to the agent that owns it, rebuilds and tests again. The number of loops is capped. When they run out, the project fails instead of shipping something else.
A game, start to finish
"A cozy grid puzzle: an 8x8 board of seed tiles in five flower types. Drag a tile onto a neighbour to swap them; lines of 3 or more bloom and disappear… Fill the bloom meter before you run out of moves. Watercolor cottage-garden look. 3 levels."
From that came Garden Merge: a watercolor match-3 with its own board logic, chain scoring, bloom meter and three levels, in 1,778 lines of TypeScript written by Claude, with 11 images drawn by Gemini.
QA rejected one build because the meter frame was flat magenta, and the next because the flower grid overlapped its wooden frame. The fourth build passed all 18 checks, with all 12 must-haves confirmed and a review score of 8 out of 10. It cost an estimated $2.44.
It wasn't fully hands-off. I resumed the run several times and chose two of the image fixes myself. The final code repair was the agent's own.
GameForge has also written a side-scrolling platformer, Lantern Knight, from a description: a pixel-art knight in a haunted castle, in 1,554 lines of its own code. That one still needs art fixes and a run through the full QA gate.
What real models taught me
A killed process looks like a bug. Builds kept dying with no error message, and the system paid Claude to fix code that wasn't broken. Claude's notes admitted it was guessing. The real cause was exit code 137: the Docker VM was out of memory. Five of six test builds were killed at 6 GB. At 8 GB, all eight succeeded. Killed builds are now retried and never sent to the model.
A budget cap can leak. Parallel tasks weren't being counted, and failed calls were recorded as free. One run showed $0.56 when its own call log said $1.50. The cap now reads that log and reserves the worst-case cost before each call.
Transparent sprites are their own project. Cutting subjects out of a magenta backdrop left pink halos, then magenta windows, then nearly erased a lavender flower.
Prompts leak too. A background once arrived with game pieces and a spaceship painted into it. The model had done what it was told: my code had pasted the whole art style into the background prompt.
The part nobody demos: the harness
An agent is mostly not the prompt. It's everything around it.
Context by reference. Agents don't chat. They read and write versioned artifacts, so you can see which version of the spec a build used.
Tool permissions. Each agent can use only the tools its role needs, and every call is logged with secrets redacted.
Budgets and timeouts, checked before every model call.
Structured outputs, validated and re-prompted with the errors when they fail.
Provenance. Every artifact says whether it came from AI, code, a build or a person.
Durable orchestration without Temporal
I wanted jobs to survive a closed browser, an API restart, or a worker dying mid-task. The usual answer is Temporal. I chose a smaller one: Postgres is the queue.
Workers claim tasks with
SELECT … FOR UPDATE SKIP LOCKED, so two can never take the same one.Each claim is a lease kept alive by a heartbeat. If a worker dies, another picks the task up.
Every state change is written to an events table and broadcast with
NOTIFY, so a reconnecting browser resumes where it left off.
I tested it by killing a container in the middle of a playtest. About 90 seconds later another worker took over and finished the job.
By the numbers
Agents: 9
Models: Claude Sonnet 5.5 for design, code and review, and Gemini (
gemini-nano-banana-2.1) for artChecks on Garden Merge's release build: 18
Automated tests: 31 unit and 5 integration, including a full pipeline run with a scripted model
Default spending cap per game: $5, with costs estimated from a price table
Releases are local previews, labelled as not public.
Stack
Backend: Python 3.13, FastAPI, SQLAlchemy, PostgreSQL, Pydantic, Pillow, the Anthropic SDK and the Gemini API
Games: Phaser 3, TypeScript, Vite, Vitest
QA: Playwright and Chromium in an isolated container, plus visual review by Claude
Frontend: Next.js 16, React 19, Tailwind 4, shadcn/ui
Infrastructure: Docker Compose and S3-compatible storage
Once agents exchange artifacts instead of chat messages, and an orchestrator decides what happens next, a pile of prompts starts behaving like a production line. But a production line is worth no more than its final inspection. It isn't enough to check that the product works. You have to check that it's the product somebody ordered.

