An online RPG platform I'm building with AI agents.
Quest Club is a multiplayer role-playing game platform in the style of RPG Maker, where anyone can build a game and other people can play it together. I designed the system architecture and I'm building it almost entirely with Claude Code, and the project is as much an experiment in how to run AI-driven development as it is a game. At its center is a graph of agent loops: agents build the game in small slices, several at once, automated gates and a second agent check every one, and I keep the judgment calls.




I first built this game in the 2000s. This is a full redesign.
The original work on this game began in the 2000s. This rebuild keeps the idea and replaces everything underneath it. I designed the new architecture myself: one deployable Elixir application on the Erlang VM in place of separate services and a message broker, a process for every running map, JavaScript scripting in a sandbox, and the MCP interface that lets agents build alongside people. The AI agents write much of the code, but the decisions about how the pieces fit, and where the boundaries and safety rules go, are mine.
Agents build the game as a graph of small slices, several at once. Gates and a second agent check every one. I keep the judgment calls.
Quest Club's first paid game was built by agents. The work is split into small slices, and the plan is a graph: each slice says what it needs first and what it changes, so every slice that's ready runs at the same time, each with its own builder agent and its own critic. Inside each slice runs the same loop: build, prove it works with automated gates, have an agent that didn't build it review it, fix, commit. My time goes only to the decisions that need judgment: the direction, the look, and whether it plays well enough to ship.
The plan is a graph
A slice is ready when everything it needs is done and nothing it changes is being changed by a running slice. The first chapters ran one slice at a time; making the plan a graph let independent slices build side by side.
- Each slice declares its edgeswhat it needs first, and what it changes
- Every ready slice startsup to 3 at once, each with its own builder and critic
- Two slices never change the same thing at oncethe second one waits
- After each slice landsthe whole game is played through again
- Before I play a chaptera live bot plays it over the real connection, for every character
- ↻ until every slice is done
Inside every slice: the loop
The builder works through MCP tools and written skills. The gates are automated checks that actually run the game, and the last one is a bot player (below). The critic is a separate agent that reads the spec, the script and the renders, and the slices built beside it, for continuity. A gate that fails three times marks the slice blocked instead of looping forever.
The right model for each role
Each slice has separate roles, so the strongest model is spent on judgment, not on waiting for tools.
The story, scripts, art direction, balance decisions and the orchestrator stay on the strongest model. To keep costs down without losing quality, the critic rereads only the spots it flagged, and the runner passes on only what failed.
Before a person plays it, a bot does
Every other gate runs inside the server, so it can't see what happens between the app and the server. The last gate is a headless bot player: it signs in as a throwaway account and plays over the real connection, like the app, walking, tapping, answering choices and fighting, for every playable character, from start to finish. It reports scenes that fail or repeat, a player left stuck, and walks that never end. It was added after two scenes passed every in-server check and still broke on my phone.
What makes it safe to run in parallel
- Declared boundaries. Each slice lists what it depends on and what it touches, so the plan settles conflicts before the build starts.
- Shared data has one owner. One slice owns each shared table; the others only read it.
- A whole-game check after every merge. Two slices that each pass alone can't quietly break each other.
- The platform holds still while slices build. Engine fixes are batched and released only between builds, never under one.
- The next part is prepared while this one builds. Script, art and music for the next chapter are made in parallel, so its slices start the moment the current chapter is done.
Who does what
- Set the direction and approve the plan
- Sign off the look before anything is built on it
- Play each finished part on my phone while the next one builds
- Approve anything that reaches players
- Planner writes the plan as a graph of slices
- Builders each take one ready slice
- Runners run the gates and report them exactly
- Critics review each slice against its spec
- Orchestrator schedules the graph and brings me only what needs me
- Automated play-throughs from the start
- A bot player that plays live over the network, like the app
- Structural checks on everything built
- Simulations against targets set in the plan
- A separate engine agent fixes the tools when they fall short
Dev, staging, production
Building the product and changing the platform underneath it happen in different places, so a half-finished platform change never lands under work in progress, and nothing reaches players by accident.
- Agents push engine features and fixes, tests first
- Changes often, by design
- A fixed release that changes only when I promote one
- I play each part here on my phone
- Updates in place, previewed and backed up first
- Refuses changes that would break players
What it taught
- Separate the builder from the judge. An agent is confidently wrong about its own work. Every critique found something real, and starting each new builder from the last critique roughly halved the next one.
- Plan the parallel work up front. Running slices side by side only worked once each one declared what it needs and what it touches.
- Every miss becomes a check. Playing on a real device still found what the gates passed, and each find became an automated check, so the next part couldn't repeat it. When two scenes broke only on the phone, the check became a bot that plays live before I do.
- Fix the checks when they fall short. When a check couldn't follow something, the limit went to the engine agent and was usually fixed within the hour. Bending the product to suit the tool was tried once and undone.
- Tune with real play data. My own play logs were the best balance data: they showed the fights real players lose, which the simulations alone missed.
- Spend the strongest model on judgment. Building, reviewing and story decisions need it; running checks and waiting on them don't.
- Give feedback by playing. With feedback from play sessions instead of approvals mid-build, a chapter went from script to finished in about a day.
How the agents' work gets checked.
Getting an agent to write code is simple. Most of the work is in the structure that makes its output trustworthy and repeatable: written rules it reads every session, skills that carry hard-won know-how, tests it can run without me, and an environment where a mistake costs nothing.
Agent instructions as a living spec
The repository carries an AGENTS.md that every session reads first. It holds decisions, not just style: how every feature is checked against three reference models (RPG Maker for how a game works, Roblox for how a platform works, World of Warcraft for how players play together), and the rule that anything a game maker can do must exist in both the editor and the API in the same change.
Parallel agents in isolated worktrees
Several Claude Code sessions work at once, each in its own git worktree on its own feature, such as movement, route commands or per-event state. Each test run gets its own database partition, so parallel agents can't lock each other's rows and fake a flaky failure.
Skills that carry know-how
Eight skills in the repo teach an agent to do a job the way the session that first worked it out did: pixel art, tilesets, maps, story and dialogue, sound, multiplayer story design, and a game-builder skill that orchestrates the others to ship a whole game. A cheaper model can then follow the same procedure.
The skills are served to other agents too
The same files are exposed over MCP, so any connected model can list and load a skill before building. The documentation pages are compiled from those files, so the docs and the agents never disagree.

Agents like Claude can build whole games and stories through MCP.
The engine runs an MCP server with around a hundred tools, so an agent can make a new game from an empty draft: its maps, story, quests and characters. The tools cover everything: create maps, paint tiles, write events and scripts, edit the item, enemy and quest database, upload art and audio, publish a game. The rule is that nothing ships in the editor without the same capability over MCP, and both go through the same validation. So an agent can author live content the way a person does, and players in a running map see the change right away.
- Agents act as an account. A token inherits exactly what its owner may edit, and every tool checks access through the game that the target belongs to.
- Agents can look. Tools render a map and report which cells are walkable, so an agent can check its own layout instead of guessing.
- Agents can test in a copy. A playtest set runs scripts and simulates battles against the agent's own draft character, inside a rolled-back transaction, with stand-ins for anything that would reach real players.

Changes are tested in code and promoted by hand.
- Tests are the main check. A server feature counts as verified when a test plays it through real sockets: join the map, interact, answer dialogs, fight, and assert on what was pushed and saved. The slow simulator is for what a person has to see.
- Draft games stay private. A game is unpublished until its owner says otherwise, and the server refuses everyone else, even with an old token.
- Staging moves only on a promote. A promote builds a release from a tagged commit, runs the full test suite and refuses if it fails, backs up the database, migrates, and checks the server answers before switching over, rolling back if it doesn't. Games are built there, and I play real builds on my phone in a separate staging app before anything is public.
- Production comes last. What holds up on staging ships to the live game server at play.getquestclub.com. The website at getquestclub.com is a separate site.
A harness and evals decide which art ships.
To stop paying per image for game art, I train my own pixel-art models on one home GPU: small LoRAs on Qwen-Image (I started on Stable Diffusion XL), trained only on art made for the games. Training the models is the simpler part. Most of the work is the system around them: a harness that runs every test the same way, and evals that say whether a change helped.

- The harness. Training, generation and cleanup are scripted end to end from job files kept in git. The same prompts and seeds run every round, so two models or two settings compare like for like, and any model can be rebuilt exactly.
- Evals in layers, cheapest first. Frozen test sets the models never train on, automatic checks that reject broken images, a prompt-match score, then three AI critics judging blind against a written rubric.
- I make the final pick. A gold set I rated by hand showed the critics agree with me 60 to 70% of the time. So they narrow the field, and I make the final pick on a review page.
- Measured gains. Switching training data from tile blocks to whole objects took correctly sized results from 10 of 600 to 418 of 432. A pose guide took character layouts from 18 to 64 of 64, with no retraining. The second battler model cut leftover background from 21 of 192 images to 1.
Example results
These are new subjects the model never saw in training, picked by the critics and then by me, shown at their game size or larger.

Monitoring inside and outside the server.
Production is one Linode running the app, PostgreSQL, Caddy and Netdata in Docker. Monitoring stays on the box: Netdata measures it every second and keeps the history there (per second for days, per minute for weeks, per hour for months), its dashboard is reachable only through an SSH tunnel, and nothing is sent to an outside service. One outside check covers what a server can't report about itself: being down.
- The app reports its own numbers. Phoenix and Ecto telemetry, served in Prometheus format on a port only the box can reach: requests by status class and how long they take, socket connections accepted or refused, the time to handle each message from the game client, database query time including the wait for a free connection, error-level log entries, and the Erlang VM's memory, processes and run queue.
- Eleven alerts that email me. Disk space, and the disk filling up within 48 hours. RAM, swap, CPU and CPU steal from noisy neighbors. A container down or failing its health check. The TLS certificate's days left. A backup older than 26 hours. A security update waiting on a reboot. A warning emails once, a critical repeats every 2 hours until it clears, and each alert has a "what to do" entry in the production runbook.
- Tested backups. A nightly database dump, kept for 14 days, only counts once it is complete, compressed and tested. If a night fails, the backup-age alert fires. Weekly disk snapshots sit underneath.
- An outside uptime check. UptimeRobot requests a health endpoint every 5 minutes. It answers OK only when the app can run a database query, so an app whose database is down still counts as down.
- Private logs. One JSON line per event, with player, game and map ids on errors but never message contents or login tokens. Every log is capped so it can't fill the disk, and the access log is kept 14 days.








Every running map is its own process.
The server is Elixir on Phoenix, and it leans on the runtime's strengths. Each running copy of a map is one lightweight process that owns that map's live state: its blocked tiles, who is in it, where they stand, and its events. All changes go through that process, so they apply one at a time, and every client sees them in the same order.
- Server-authoritative movement. A client only asks where to go. The server finds a path around walls and walks the player one tile per step interval, so tapping fast or a modified client can't move anyone faster.
- Shared maps, per-player state. Everyone shares the map and its characters, but each player sees events as their own state makes them: the event page that matches their switches and items. Quest progress and script changes are per player.
- Scripts can't stall the world. Event scripts run in their own processes, so a long cutscene for one player never holds up movement for the others.
- Shared or solo, by setting. A game sets a maximum number of players per map. Unset, everyone shares one copy and sees each other. Set to one, each player gets a private copy of every map, which is how single-player games run on the same engine.
- Idle maps shut down. A map with nobody in it stops itself, and its blocked-tile data is held in memory so a move never touches the database.
- Separate saves per game. One account plays any game, and each game keeps its own character, position, inventory and quests for that account, the way Roblox separates experiences.
Groups of real players (shared instances, split rewards, co-op battles) are designed against World of Warcraft's party model but are not built yet. Battles already run a whole party through one engine, which is where that work will plug in.
The original design scales.
Today Quest Club runs on one machine, and that's enough for launch. The interesting question is what happens when it isn't: thousands of players, and many of them standing on the same map. The answer comes from decisions I made in the original Erlang server, long before any of this was rebuilt: every map is a running process, the server owns every move, and a map's updates go out as one batch. Those three choices mean a map, a player or a battle can live on any machine, so adding machines adds capacity without rewriting the game.
Where it started
The first version was an Erlang server with a Perl backend and clients in Java and JavaScript. Its central idea was that each map runs as its own process.
- A process for every player. Each connection got its own lightweight Erlang process, which signed the player in and then spoke only for them.
- A game loop for every map. Each map with players in it ran its own loop on a fixed tick. Players never moved themselves: they asked, and the map found the path, moved everyone a step and settled who stood where.
- One update per tick. Instead of announcing every step as it happened, the loop sent one small binary packet with everyone's new position. A crowded map cost one message per player per tick, however many people moved.
- Location-independent processes. Live state sat in Mnesia, Erlang's distributed database, which also recorded which process ran each map. Battles, chat and scripting ran as separate services behind a message broker. Nothing assumed the thing it talked to was on the same machine.
What the rebuild kept
The rebuild is one Elixir application on the same virtual machine. It dropped the Perl backend, the message broker and Mnesia, and kept the design they served.
| The original | Today | What changed |
|---|---|---|
| A loop process per map | A process per running copy of a map | Copies add private, solo maps for single-player games |
| A process per TCP connection | A channel process per player over one WebSocket | WebSockets suit phones and proxies |
| A message broker for updates and chat | PubSub built into the runtime | The runtime's own distribution replaces the broker, across machines too |
| Live state in Mnesia | Live state in each map's process, saves in PostgreSQL | One source of truth for saves, tools and analytics |
| Server-side pathing on a tick | Server-side walking, step by step | The tick is the one piece not brought back yet |
Leaving out the tick was a choice for launch: Quest Club's first games are solo, so each map has one player and sending each step is simplest. It's the first thing to bring back for crowded shared maps.
Why it scales
Online games usually hit one of three walls: shared state that everything has to lock, one loop that everything waits on, or a server that has to be rewritten to run on more than one machine. A process per map avoids all three.
- No shared state to lock. A map's process is the only thing that changes that map. A thousand maps are a thousand independent processes, and the runtime spreads them over every core without any code of mine.
- Failures stay small. A crash restarts one map, one battle or one connection. Other players aren't affected.
- Location doesn't matter. Messaging a process on another machine is written exactly like messaging one on the same machine. Moving maps onto more machines is a deployment change, not a new design.
- The client is only a view. The server decides every step, so the app joins a topic and draws what it's told. Connections hold no game state, so any machine can take any player.
- Solo games scale with players. In a single-player game each player has their own copies of the maps, so the load grows with players, never with crowds.
- The one real limit is a packed map. One process does all of that map's work, and announcing every step to everyone in it grows with the square of the crowd. That has known answers, below.
Fully scaled out
Here's how the same application runs across many machines. Every machine runs the same release; what differs is which processes each one hosts. This is the design, not what runs today.
- The edge. A load balancer ends TLS and spreads WebSockets across the nodes. Since connections hold no game state, any node can take any player. If a node goes away, the app reconnects and lands on another.
- The cluster. Nodes find each other by DNS (the library is already in the app). A registry that spans the cluster places each map copy by its key: a shared map goes to whichever node its key points to, and a solo map starts on the node that holds its player's connection, so a single-player game never crosses machines.
- Messages cross machines on their own. A player connected to node 1 can stand in a map that runs on node 2. Their moves go to the map's process, the map broadcasts on its topic, and PubSub hands the update once to each node with players in that map.
- Battles and scripts move too. Battles are their own processes and already save and resume after a restart. Scripts run sandboxed with time and memory limits; at scale a pool caps how many run on a node, and script-heavy work can get nodes of its own.
- Data on its own. PostgreSQL takes the writes (saves when a player leaves a map, quests, purchases) through a connection pooler. Replicas serve what's read far more than written, and every node caches each game's content, which rarely changes. Art, audio and trailers move to object storage behind a CDN.
A crowded map
The single packed map gets the same fixes games at scale use, starting with the one the original design already had.
- Bring back the tick. The map collects moves and sends one batch a few times a second, which suits a turn-based game. The cost becomes one message per player per tick, not one per step per player.
- Send only what's near. A big map is split into regions, each with its own topic, and a player listens to their region and the ones beside it, as World of Warcraft sends players only what's around them.
- Cap each copy. Games already set a maximum number of players per map, one or unlimited. Allowing any number lets a full copy open another one on whichever node has room, as Roblox starts a new server when one fills up, and a group of friends lands in the same copy.
- Take work off the map. Pathfinding and scripts can run beside the map's process instead of inside it, so the map only puts the results in order.
A request, end to end
- The app opens a WebSocket. The load balancer hands it to node 1.
- The player joins a map. The registry says its copy runs on node 2, or starts it there.
- The player taps a tile. Node 1 forwards the walk to the map's process on node 2, which finds the path and steps.
- Each tick the map broadcasts the batch. PubSub delivers it to every node with players in that map, and each pushes it to its sockets.
- When the player leaves, their position is saved to PostgreSQL.
- If node 2 fails, the map restarts on another node from what's saved, and its players' connections rejoin it.
From one machine to many
Each step is taken when something measured says so, not ahead of time. Only the first runs today.
| Stage | What changes | When |
|---|---|---|
| One machine (today) | One release, PostgreSQL and a reverse proxy on one server; solo games | Launch |
| Ready for crowds | The tick, nearby-only updates, any cap per copy. Code only, no new machines | Before the first multiplayer game opens to the public |
| Data apart | Managed PostgreSQL with replicas and a pooler; media on object storage and a CDN | When the database or the disk is the busiest part |
| A cluster | Identical nodes behind a load balancer; registry and PubSub across them | When one machine's cores are full |
| Roles and regions | Nodes for connections, for maps, for scripts; a cluster per region | When players are far apart, or one kind of work crowds out the others |
What it taught
- Design for messages, not machines. Because the original server only ever sent messages to processes, it never mattered where they ran. That's what makes the cluster a deployment change twenty years later.
- A ceiling per map is fine if you can add maps. Rather than making one map run on many cores, cap it and open another copy. Most of the scaling is in having many small independent things.
- Fewer moving parts. The runtime's own distribution replaced the message broker. Every piece left out is one less thing to run, monitor and keep in step.
- The database is what to plan for. On this runtime processes are the cheap part. Writes are the expensive part, so the game saves on leaving a map, batches analytics and caches content.
- Running across machines has costs. When machines lose sight of each other, a map could start twice. One owner per map and durable state in PostgreSQL settle it. Crossing machines also costs a copy of each message, which is why a player's solo maps stay on their own node.
- Leave out what launch doesn't need. Leaving out the tick was right for solo games, because the design still had a place to put it back.
Stack and status.
| Part | Details |
|---|---|
| Server | Elixir on the Erlang VM (OTP), Phoenix and Bandit, PostgreSQL, Docker. Real-time over WebSocket channels. |
| Game scripting | JavaScript in a sandboxed QuickJS runtime, with time and memory limits. |
| iOS client | Swift, SwiftUI and SpriteKit. Plays RPG Maker XP art directly. |
| Map editor | TypeScript, Vite and PixiJS, hosted in the admin site. |
| Agent interface | An MCP server, plus eight skills served to any connected model. |
| Status | Live and under active development. The website is getquestclub.com; the game server, editor and MCP API run separately at play.getquestclub.com. New builds are played on a private staging server first. |
Want to talk about it?
I'm based in Los Angeles and open to product and engineering roles.
therevoltingx@gmail.com