
AI Game Development: One Hard Week Building The Magus
AI game development works when one AI designs, another executes, and a human plays every build on the real phone, but it does not make the hard weeks disappear. This is one hard week building The Magus, a third-person stealth game for iPhone in Unity: twelve builds, a ghost in the test harness, a forge on the wrong beach, and the night the game started to feel like a game.
This is the week in the build of The Magus, my stealth game for iPhone set in the world of my Feeder Series thrillers, with nothing left out. Two AIs did the work, one designing and one executing, and I played every build on the phone and sent back what I saw. Some of what I saw was good. A full mission chain ran end to end for the first time. Some of it was two days lost to a bug that did not exist. If you are thinking about AI game development, or about AI building anything for your business, the week is the honest version of what that looks like.
- The mission chain works: the boy, the apple, the hooded man, the hatch, the tunnels, the fight, the cage, the prisoner, the pirates' hideout. First time, all in one run on the phone.
- Two blocks of work went into a shop that would not close. It closed fine. The test harness cannot end a frame, and the game was waiting for the end of one.
- A colour flash in the tunnels survived three days of plausible fixes. Twenty minutes of measurement named a shader. The measurement was right and the fix was not enough; the cause has company.
- The forge was built as a beach house next to the hideout, then found there was no rock north of the village to dig into. It got its own mound.
- Still open as I write: the discs die below ground on the phone and not in the harness, and the flash. Both have a measurement attached now, not a guess.
Table of Contents
- What Happened This Week, in One Line?
- What Got Built?
- What Was the Bug That Was Never There?
- Why Did the Forge Move Twice?
- AI Game Development: Measure, Then Fix
- What Is Still Open?
- What Did It Cost in Hours and Tokens?
- What Does This Mean If You Are Building Anything?
- Summary
- Frequently Asked Questions
- Sources
- Related Reading
What Happened This Week, in One Line?
Monday the ladders did not work and had not worked for weeks. Wednesday night I walked from the boy at the fire to the pirates' hideout without the game breaking once, fought three Mursi in a tunnel on the way, and wrote to the architect: it is slowly starting to feel like a game.
Between those two sentences sit about a dozen briefs, twelve builds of 2.8 GB each on an 8 GB MacBook Air, and every kind of mistake a build can make. I am going to go through them in order, because the order is the lesson.
What Got Built?
The ladders
Weeks of this. The fix was not clever. The climb offer used to need the pirate to face the ladder within a few degrees, and a phone thumb never faces anything. Now the rule is position: within 1.5 m, on the front side of the ladder, chest clear, and pressing turns him. Rung positions are baked at build time, because reading mesh data at runtime fails on the device while it works in the editor, which is the whole story of phone development in one sentence.
The tail
A hooded man with a sack walks a loop from the market to a hatch in the vegetation. You follow him. He stops and glances back for three seconds every twenty to thirty seconds, and a suspicion meter rises while he looks. Red fails the mission, you wake at the mask vendor, he goes back to his start. Villagers walk in groups of three, and if you walk inside one you blend. A ghost shell on the pirate shows you that you are cloaked. Assassin's Creed, on a phone, built in two days.
The tunnels
The hatch fades you down. Four tunnels run under the island, lit by lantern bearers who see six metres with the lantern and two without. Fights work. The cage holds a kneeling prisoner named Barkoro; free him and a cutscene plays, then he waits for you in the pirates' hideout with two things to say.
The forge
A reptile smith named Skildo sells powder and shot, a sharpened cutlass that adds reach and damage, a leather vest, a smoke pot, a lockpick and rum, and buys your loot at half price. The entrance is a boulder that asks for a word the boy gives you in the opening dialogue. More on where the forge stands below, because it did not stay where it was put.
The small things
Music: a bed that cycles two tracks with two seconds of silence between, and a danger layer that crossfades in on red. Footsteps you can barely hear, which took three briefs to get quiet enough. Chests that open with a lid and a coin bag. Buttons in caps, bigger, padded, nothing within 24 points of the screen edge. Crouch that always stands up again. A hit button that chains swings while held. A stick that keeps driving when your thumb drifts off its ring.

What Was the Bug That Was Never There?
On Tuesday the mask vendor's shop would not close. The test said so: tap the X, the controls stay locked for eight seconds. The builder tried a two-frame release. Still locked. The architect, reading the reports, wrote a brief that said stop guessing and diff it in git, because the shop had closed fine before a certain commit.
Git showed the close path had not changed at all. The release code waited one frame and then for the end of that frame. And the headless test harness, which runs Unity in batch mode with no screen, never ends a frame. The end never comes. On the phone the shop had closed correctly all along.
Two blocks of work, about three hours of machine time and more of mine, spent fixing a bug that only the test could produce. That evening a new law went into the rules file: before a failure is called a bug, rule out the harness; a failure only the harness can produce gets written down as such and proven another way, and never fixed in the game.
The lesson is not that tests are bad. It is that a test environment has its own physics, and if you do not know them you will debug the environment and call it the product.

Why Did the Forge Move Twice?
The brief for the forge said: cut it into a slope left of the wrecked ship, like the dungeon, with a door in a rock face. The builder read "open mode", a setting of the dungeon tool meant for the apron outside, and built a roofed house with pillars on the open sand, ten metres from the hideout. The chat worked. The smith inside was pure white and walking on the spot.
My call, and I said so: the placement rule lived in one brief and the following three only said "the forge room". A rule that is not restated is a rule that drifts. So the next brief carried the placement as numbers: at least eighty metres from the nearest house, a hundred and fifty from the hideout, cut into rock, nothing of the room visible from outside, and a list of ways to fail.
The builder surveyed the island and came back with one line: there is no rock north of the village. Flat sand to the sea. Every face on the island is the dungeon's mound or the village's own hill. So the forge got its own mound, sixteen metres across and seven high, rocks on its faces, a boulder in the mouth, built like the dungeon's. The player has to search for it, which is what I wanted, and the first time I searched I did not find it, because the scene that holds it only loaded within twenty-five metres. That is the next fix. Every one of these is small. Together they are the week.
The white smith, by the way, was the same cause as the next section.
AI Game Development: Measure, Then Fix
The tunnels flashed. Green, then pink, then green, whole frames, only below ground and never in the dungeon next door. Three days of plausible fixes: force every camera to clear to black, convert a non-URP material, re-record the shader variants for mobile. Each one made sense. None of them changed anything.
So the brief stopped asking for fixes and asked for a number: walk six hundred frames in the first tunnel, print the mean colour of every frame, and call a flash any frame whose saturation jumps past a line. Twenty-six of six hundred. And the measurement named the shader on the pirate's own skin, a third-party skin shader that fails to compile on Metal because it uses more than sixteen texture samplers. The build log had reported that error for weeks as "the one known error". Daylight never showed it. Lantern light pushes the material into the variant that breaks.
The fix was obvious once named: every material on that shader goes to the standard pipeline shader with its own textures, and the build's error count went from one to zero for the first time in a month. The white smith turned into a smith.
And the tunnels still flash on the phone. The measurement was right and the cause has company. The next brief, running as I write, bisects by data: ten changes, one at a time, depth texture off, anti-aliasing off, the overlay cameras off, HDR, post-processing, fog, the lanterns, the pirate hidden, the ghost shell, a smoothness cap. Each one measured, each one reverted. Unity's own issue tracker says anti-aliasing together with a depth texture flickers on iOS, and that is first on the list. The point is that the list is a measurement, not a hunch, and the result will be a count. The full hunt that followed is written up in Unity URP Flickering on iPhone.
What Is Still Open?
The discs below ground. On Thursday's build, under the island, the stick works and every button is dead. USE at the cage, CLIMB at the ladder, even the DEV readout. The harness presses the same buttons in the same tunnel and they all answer. So the UI's raycast path dies on the phone and not on the Mac, and the direct touch path lives. The brief now gives the buttons what the stick already has: they read the touchscreen themselves, as a second source beside the UI, deduplicated per touch, off while a menu is open. A blocker, a lost camera or a lost event system cannot silence them again. And every touch now prints what it hit, so the next phone session is a measurement too.
The flash. Above. Count pending.
I am writing this with both unsolved on purpose. A build log that only shows the wins is a sales deck.
What Did It Cost in Hours and Tokens?
Briefs run on a budget: sixty to ninety minutes each, with the build running regardless when the clock is spent. The worst overrun was eighty-five minutes against seventy-five. A build is one to six minutes on the M2. Twelve of them this week.
The most expensive thing was not a model or a build. It was a shell. One of the builder's report lines was appended with a here-document that never got its closing marker, so the shell sat waiting for input for seven hours and forty-five minutes, and the status line said "one shell running" all morning. I waited two hours for a block that had finished at 07:38. The rules file now says: every shell closes in its own step, and the block ends by printing "SHELLS 0".
The second most expensive thing was my own briefs. A placement I did not restate. A proof that loaded the tunnel directly instead of going down the hatch like a player, which is exactly why it never saw the dead buttons. Every rule in that file was paid for.
What Does This Mean If You Are Building Anything?
Swap the words and this is a week on any system. The shop that would not close is the integration test that fails on the staging server and not in production. The flash is the bug report that says "sometimes". The dead buttons are the feature that works on the developer's machine. The stuck shell is the job that says running and is not.
What held the week together was not the models. It was three habits. A written brief with numbers in it, not adjectives. A proof for every item that runs on the real path, the way a customer would hit it. And a rules file that grows by one law every time something goes wrong, so the same thing cannot go wrong twice. I wrote up the same method across three different systems in Building Apps With AI.
If you want that shape of work on your own problem, the hour exists for it: a one hour call, $100. A full Nexus build is $4,999 plus $299 a month, enterprise from $9,999, scoped first. And if the honest answer after the hour is that you do not need me yet, you will hear that too.
Summary
The Magus ran its first full mission chain on the phone this week, from the boy at the fire to the pirates' hideout, and the ladders finally work by a position rule instead of a facing rule. Two blocks were lost to a shop close that worked all along, because the harness cannot end a frame, and that is now a law in the rules file. The forge moved from a beach house to its own mound, because a rule not restated is a rule that drifts. Six hundred measured frames named the pirate's skin shader and took the build to zero errors, but the flash and the dead buttons below ground were still open, each with a measurement attached instead of a guess.
Frequently Asked Questions
What does AI game development look like day to day?
A written brief in the morning with numbered items, a proof for each and a list of ways it may fail. An AI builder executes it inside the Unity project, headless, with the editor closed, then there is a build in the afternoon and a phone session in the evening. The phone's notes become the next morning's brief, and the human decides what the thing is; the AIs never do.
Why two AIs instead of one?
Because an AI that both designs and builds will redesign around whatever it finds hard. One reads the reports and writes the brief and never touches the project. The other executes and never decides. The forge on the beach is what happens when the line between them blurs for three briefs.
Can the AI test its own work?
Only on the real path: synthetic touch through the input system, the real scenes, game time, down the hatch the way a player goes. The week's two worst bugs were a test that passed in the harness and failed on the device, and a test that failed in the harness and had never been wrong on the device. The environment has its own physics.
How much of the week was the AI's fault?
Less than it looks. The ghost bug was the harness, the beach house was my brief, and the stuck shell was the builder's, with the rule that prevents it now written. The AI's share was the ordinary share of any developer having a hard week, with the difference that every mistake becomes a law the same day.
What is the one habit that transfers to a business system?
Measure before you fix. When an AI answer is wrong in production, editing the prompt until it feels better is guessing, while running the same fifty questions before and after and counting what changed is measuring. Three days of guessing against twenty minutes of measuring was the week's arithmetic.
Is the game playable yet?
The first chain is. The forge and its smith are built and the hostage chain, day and night, dogs and bosses are next. It is a development build on one phone, not a store listing.
Sources
- Apple: Metal Feature Set Tables
- First-hand experience: JFK Løvlien's own build notes.
Related Reading
- Unity URP Flickering on iPhone: Three Weeks of Wrong Fixes, Then the Lights Inside Every Flame
- Building an iPhone Game in Unity From My Thrillers: 59 Days In
- Unity Boss Fight on iPhone: Four Days to Build Her, Ten Seconds to Kill Her, and the Five Bugs In Between.
- Building Apps With AI: What One Person Can Actually Ship.
Build it with JFK Løvlien
JFK Løvlien designs and builds pro-level iPhone apps, mobile games, websites and custom AI agents for companies. Start with one focused hour on Zoom and leave with a clear plan.


