(How we work)All articles

The software factory behind Redline 2

An orchestrator to rule them all, except the human.

Redline, and what comes next

Redline is our space shooter about riding reactor heat. Firing heats the reactor, and heat makes the guns stronger. At 100% you have one second to release a nova that clears the screen, or the reactor melts down. Every ship, enemy and sound is drawn and synthesised in code. There are no art or sound files in it at all.

Redline in the redline: the Plasma Stream beam firing up the screen at 93% heat, with a 79 combo and a ×16 multiplier. A nova in Redline: an orange shockwave ring sweeps the screen and enemies shatter around the dark ship. A capital ship in Redline with two glowing weak points and three turrets, while the player's ship fires a five-way spread.
Redline, the first game.

Redline 2 keeps that core and builds a story campaign around it. The headline is four ships that each kill in their own way: guns, a swipe that cuts, a line you loop around enemies, and orbiting cells. They were the first thing we built, on purpose, because they were the riskiest idea. The first version was tested on the phone and rejected the same day: the new ships all fired the same guns, and the game felt like Redline 1. The second version passed.

The story went the same way. The first version had portraits and dialogue boxes, and after playing it we were neither excited nor curious. So it was replaced by The Last Convoy, told like a game intro movie, with a camera and a narrator instead of talking heads. Nine hundred and twelve ships flee a dying star. Something follows them out of the dark and takes ships. It follows heat, so forty-one volunteers fly with no governor on their reactors, hot enough to be followed instead. The movie is built in 3D from code, like everything else in the game.

A frame from the intro movie: a fighter leaves the lit, red hangar of a large ribbed carrier ship. The subtitle reads: We asked for volunteers to fly without governors. A frame from the intro movie: a wing of fighters with bright engines flies through a pale glow, with many more ships behind them. The subtitle reads: Forty-one said yes. The Redline 2 intro movie's title card: REDLINE 2, The Last Convoy, in front of a glowing red star. The header reads Vesper Evacuation, day 12, 731 ships.
Three frames from the intro movie, captured on the phone.

That leaves most of the game: six acts with new hazards, enemies, bosses, rescue missions and a lot of narration. That is a lot of work for a small studio, so we built a software factory for it.

Why a game needs a different factory

Our first software factory adds features to a bookkeeping app. There, four agents review every change, and a person steps in for anything that touches the data. A game breaks that model in one place. Code can be reviewed, but whether a boss is fun or a wave is too hard can only be found out by playing it. The only real test is a person with the phone.

So everything in this factory is built around that one human step. It has to be rare, batched and well prepared. Here is what the game itself told us:

  • One phone, one install. A new test build replaces the last one, so we test a batch of changes at a time, not one change per build.
  • A few big files. Almost every change touches the same handful of files. Agents are not the limit on how much runs in parallel. Files are.
  • Feel is numbers. “Too hard” is usually a value in the game's config, which a tuning panel in the game can change, so it becomes a small tuning item, not a rewrite.
  • Some checks cost money. The full mission check runs on a paid macOS runner. An agent never starts it, only we do.

The factory

An idea, or a phase of the build plan, becomes a short spec. Small specs go straight into the queue, and we read the bigger ones first. From the queue, up to three builders work at the same time, each in its own copy of the repo. Before an agent judges anything, scripts check that the change only touched the files the spec named, that the game data still decodes, that it builds, and that the mission check compiles. The gates are scripts, so running them costs no tokens.

A flow chart. An idea or a phase of the plan goes to the spec-writer, which writes a small spec. A person reads the bigger specs, while small ones go straight to Ready. A scheduler starts up to three builders at once, each in its own worktree, as long as they don't touch the same files. Their work goes through gates run as scripts. A red gate sends it back to the builder. When green, a verifier reads the diff against the spec, and a fail also goes back to the builder. Passed items go to the integrator, which makes one release candidate and one build. A person plays it on the phone and marks each item pass, fail or tune. Fail or tune becomes a new small item back in Ready. Then a person types the approval, and the release candidate is merged to main.
The factory. The three dark steps are the only places a person is needed.

An item that passed goes onto an integration branch at once, so the items after it are built on top of it. When an act's worth is there, the integrator makes one release candidate: one build to install, and a checklist made from the specs' device checks, in the order that is fastest to play. Next to each point are the numbers to turn in the tuning panel if it feels wrong.

Each item gets its own branch and its own folder. When a builder starts, the orchestrator runs one command, git worktree add -b factory/<id> .factory/wt/<id> next: a new branch made from the integration branch, checked out in a folder of its own under .factory/wt/. The builder works and commits only there, so three builders never step on each other, and each folder holds exactly what one item changed. Five of the folders from Act 3:

  • .factory/wt/F-021: flare fronts, a warning line and then a band of heat that sweeps down the screen.
  • .factory/wt/F-026: rescue pods that run out of warmth are really lost.
  • .factory/wt/F-027: enemy waves can be marked hard, and the easiest setting skips them.
  • .factory/wt/F-028: two rescue missions get a gunship and lancers on the harder settings.
  • .factory/wt/F-031: the boss's weak points stay open only a short while after each front.

When an item passes, its branch goes onto the integration branch, which has a folder of its own too, .factory/wt/next. The item folders stay until we delete them. An agent never does.

  1. Stage: every stage

    Agent: /factorythe orchestrator, a skill

    No model Writes: the state in specs/<id>.md, never code
  2. Stage: spec

    Agent: spec-writer

    Model: opus Writes: the spec text: criteria, files, device checks
  3. Stage: build

    Agent: builder

    Model: sonnet Writes: code in its own worktree
  4. Stage: gates

    Agent: tester

    Model: sonnet Writes: gates.sh and the checks
  5. Stage: verify

    Agent: verifierlow effort, fresh context

    Model: sonnet Writes: pass, or a numbered list of failures
  6. Stage: release

    Agent: integrator

    Model: sonnet Writes: rc/RC-n.md, the test build
The line-up. The strongest model only writes specs, because a vague spec is the most expensive mistake in the line.

Keeping it cheap

The rules are simple. Scripts run before agents, and the verifier only starts on green. Each builder sees its spec and the files it lists, not the whole game, and every item starts in a fresh context with its state in files. Three builders at most, two retries, and then the item stops and turns red on the board instead of looping. A local board shows every item, which agent has it and how much it has used, so we can see what it costs and turn the limits up or down. The first two rounds, from the first spec to the merge, took nine agent runs and about 292,000 tokens. An act of seven missions, follow-ups included, takes 17 to 33 runs and between 0.49 and 1.15 million tokens, most of it in the builders.

DayAgent runsTool callsTokensAbout
2026-11-1621262731k$2.04
2026-11-1731543969k$2.12
2026-11-18264611,061k$2.84
2026-11-19781,1202,613k$6.71
2026-11-20435041,275k$3.77
Five days1992,8906,649k$17.48
Agent runs per day, from the board. The dollar column is a rough estimate: the spec-writer's tokens priced at Opus's list input price of $4 per million, every other agent's at Sonnet's $2. Output tokens cost five times more and cached input much less, so the real bill can differ either way.

The phone is the gate

We install the release candidate, play the checklist and mark each item pass, fail or tune, with a note in our own words. Those words go unchanged into the follow-up spec, so the builder reads what we felt with the phone in our hands, not an agent's summary of it.

The very first item showed why. It was the intro movie's sound, and it passed every gate and the verifier. On the phone, the booms were sharper than in the prototype, where they had been “more damped and dark”, and now “a bit too high pitch”. The verdict was tune. The follow-up spec opened with those words, word for word, and nine minutes later there was a new build to install. That one passed.

Agents can read the code. Only a person can tell if it is fun.

If one item in a batch fails, nothing is pulled out. The note becomes a small follow-up item, built on top of the batch, and the next release candidate replaces the last one on the phone, with the checks we had not got to yet. And nothing reaches main until a person types /factory approve RC-n in the session. A hook enforces that, not an instruction to the agents: the hook writes a one-time token for exactly that commit, and the merge script refuses to run without it. A click on the board or an agent's report is information, never approval.

A terminal. The orchestrator reports that Act 4, The Graveyard, is built: all eight items are on the integration branch, and the build passed its three checks, compiled only, with nothing run on a phone yet. Under How the round went: seven of eight items passed review on the first try, one failed once and was fixed on the first retry, no item was blocked, and the round took 19 agent runs and about 755k tokens. A list of what is in the act follows. Then /factory rc is typed, the integrator agent starts in the background to cut RC-10, and the orchestrator says it will give the IPA path and the checklist when it is done.
The end of the Act 4 round: the orchestrator's report, then /factory rc hands the batch to the integrator for the next release candidate. Nothing has run on a phone yet; that comes next. Tap to see it full size.

The agents do

  • write the specs and the checklists
  • build in parallel, one copy of the repo each
  • check every diff against its spec
  • cut the release candidate and the build

A person owns

  • the medium and large specs
  • playing the game, and the verdict
  • the paid mission check
  • the approval, and every push

The first rounds

The pilot was a single item, the intro movie's sound. It went from an idea to a build on the phone in under twenty minutes. With the tune round above, that made two release candidates. Then we typed the approval, and main moved forward. Every gate was green on the first try, and nothing was blocked.

The first real round was the story of Act 1. The spec-writer split it into eight items, each with the files it touches and the items it waits for. The two small ones, with no files in common, started at once, next to the tester fixing one of its own checks.

A terminal. Three background agents are launched: a builder for F-001, the campaign split, a builder for F-006, the rescue goal model, and a tester fixing the decode check for missing portraits. A status list below shows all three running, twelve seconds in.
Three agents at work in parallel, each in its own copy of the repo. Tap to see it full size.

Both builders hit a red gate on their first try, and both fixed it on the retry. The campaign split, pure housekeeping so that later acts can be worked on side by side, was checked by a script: the campaign before and after was identical, all 25,906 bytes of it. The rest of the round follows its dependencies, one item after the other, because they share the story files.

The factory board, a dark dashboard. The top bar shows one of three builders in use, the current release candidate RC-2, no build slots taken, and today's totals of 18 runs, 236 tool calls and 640k tokens. Three cards wait in Specced, their titles blurred to keep the story, one item is in Building with a builder on it, and three items are in Queued, two of them marked with one retry. Each card lists its size, the items it needs and the files it touches.
The board in the middle of the Act 1 round. The queued items wait for the next release candidate, and so for the phone. The blur is to not spoil the game story.

Act 1 went to the phone in two release candidates, four items and then three. Every item passed on the first play, and both were merged within a day of being cut.

Six acts in five days

Act 2, Cold Water, is where the phone earned its place. It brings a new ship that tows survival pods out of comets, past a dashed home line at the bottom of the screen. Seven items got through the gates and the reviews. Then we played it. One mission was too hard even on the easiest setting, with “too many gunships and swarmers around the pods”. And the home line sat so low that dragging a pod across it pulled our thumb into the iPhone's home gesture, which shrank the game window. No script and no review would have found that one.

Both became tune verdicts and two small follow-up items: fewer enemies near the pods, and the line moved up, with the whole tow counted home once the ship crosses it. The spec offered a line at 22% of the screen. We chose 18% instead, and the spec was changed to say so. The next release candidate replaced the last one on the phone, all of Act 2 passed, and it was merged.

The phone also tested the factory. Verdicts saved on the board from the phone were filed under the wrong item, and a second save for the same item overwrote the first, so a note was lost and we typed it again. Now the board keeps one save per mission page and asks which item a verdict is for when a mission has several.

Act 3, Flare Run, went through the line in one evening: seven items and one failed review, over a missing backslash in an error message, fixed on the first retry. The next day we played it. Four items passed, but the new rescue missions and the boss were too easy on the harder settings, where a skilled player would “just ace the level in seconds”. And one rule never fired: a pod could never be lost, because the code that should lose it only looked at pods that were still warm. Six follow-up items went into the next release candidate the same day, with more enemies on the harder settings only and a shorter window to hit the boss. All 22 checks passed, and Act 3 was merged.

Act 4, The Graveyard, was specced and built the same evening Act 3 was merged: eight items, with darkness, drifting wrecks and a new kind of rescue. This time the spec-writer was told what the phone had taught us. The harder settings got an early threat, so no mission can be won before it arrives, and every new way to lose something got a device check that makes it happen. One item failed review once and was fixed on the first retry. On the phone all 36 checks passed on the first play, and Act 4 was merged.

Act 5, The Cradle, followed the same evening: seven items, protected decks you must not set off a nova next to, and a choice of ship on some missions. Every item passed its gates and its review on the first try, and on the phone all 32 checks passed. At about half a million tokens it was the cheapest act so far, with the earlier acts' lessons written into its spec.

Act 6, The Gate, ends the story. It was specced the same evening: six items, a heat floor that keeps the reactor warm, a last mission held in the redline inside the glowing heart of a gate, and an ending we first planned as a dialogue scene and then turned into a short movie with the dialogue running in it. On the phone four items passed and two were tune. The choice of ship only showed when a mission was opened from the campaign menu, and “the user needs to know that a level could be played with a different ship”. And the end movie was skipped when replayed scenes were turned off. Two follow-ups fixed that, and the next release candidate found one more gap: after losing a mission and touching to retry, the choice of ship never showed, because the retry started the run in the same touch. One more follow-up, three release candidates in all, and the last act was merged.

In five days the factory ran 199 agent runs on about 6.6 million tokens, and the game is complete. Not one item was blocked.

What only the phone saw

We build on a Windows PC. There is no iPhone on the line and no simulator to script, so device testing cannot be automated: the gates can compile the game, read its campaign files and fly its missions with a bot, but none of them ever looks at the screen. Some things that went wrong were therefore green all the way to the phone.

The mission failed screen of Act 2, mission 5. The objective reads: Two stores, six pods. Tow at least 4 home. The counter at the top reads Pods home 4/4. At the bottom, the three buttons Menu, Hangar and Easier reach both edges of the screen. The briefing screen of Act 3, mission 5. The title, Close Enough to Touch, is wider than the screen: its first and last letters are cut off at the edges. The scene that ends Act 5. The text in the middle reads: 24,630 brought home. The counter in the bottom corner reads: Brought home 20 264. The rest of the text is blurred.
Three screens from the phone. The build was green for every one of them. The blur on the last one is ours, to keep the story.
  • A row of buttons wider than the screen. After three failed attempts a mission offers one try a level easier. That adds a third button to the bottom row, and on the phone the row reaches both edges of the screen.
  • A level too hard to win. The same screen is the end of another lost attempt at Act 2, mission 5: six pods in the fog, four of them to tow home, with gunships firing in. The build was green, but on the phone the mission was too hard to win even on Story, the easiest level.
  • A title that does not fit. The mission is called Close Enough to Touch. On the briefing screen it is not close enough: the first and last letters fall off the edges.
  • Two numbers for the same thing. The scene that ends Act 5 says 24,630 were brought home. The counter in the corner of the same screen says 20 264. The line is written for a perfect campaign, and the counter shows what we had really brought home.

None of these is a crash, and the code behind each one does what its spec says. They are only wrong when you look at them, and looking is the one job on the line that is still ours.

The short version

  • Play is the test. The factory is built around smooth testing on the phone with checklists.
  • Batches, not builds. One release candidate, one install, one checklist.
  • Files set the pace. Two items run together only if they touch different files.
  • Three at a time. Up to three items build in parallel, each on its own branch in its own folder. So far two have run side by side at most.
  • Our words, verbatim. A failed test becomes the next spec as written.
  • A typed yes. Only a person approves a merge, and a hook makes sure of it.

(Your turn)Curious how this could work for your product?

Tell us what you want to build.

hello@digitalavenue.se

A few lines is plenty. We will ask the rest.

All articles