↓ Skip to main content

Five Days to a Playable Strategy Loop (and Keeping the Code From Imploding)

Author
David Watson
Terraforming enterprise clouds by day, terraforming worlds by night. With an unhealthy urge to over-engineer both.

On Sunday evening I sat down and played a full match of my Godot 4 space strategy game from start to finish for the first time. A rival AI expanded across the outer planets, an incoming space hazard forced me to scramble point defences, and half my outposts browned out mid-battle because I hadn’t built enough local power generation.

Five days of coding earlier, none of that existed together as a real game loop.

In my previous post, I walked through how I pair Matt Pocock’s workflow skills with GodotPrompter. This week was the first real stress test of that setup—and the honest takeaway is that moving fast with AI is easy; stopping the codebase from collapsing under its own weight by Day 3 is the actual job.


How the Five Days Actually Played Out
#

5-day AI-assisted strategy game sprint timeline showing feature waves on Days 1 to 4 and stabilisation, refactoring, and benchmarking on Days 3 to 5

Day 1 — Making It a Game: Up until now I mostly had planets, orbits, and building placement. Day 1 was about giving the player something to fight over: factions, territory capture, recycling buildings for salvage, temporary combat boosts, a win-condition megaproject, and splitting the HUD into cleaner palettes.

Day 2 — Hazards, UI Experiments & Live Tuning: Moons were adding too much micromanagement, so I folded them into planetary bonus modifiers instead. I also got tired of fighting layout bugs inside the live HUD, spun up a throwaway 2-column UI prototype, and promoted it into production once it felt right. By the evening I had a live Tuning Deck modal for tweaking numbers mid-match, plus incoming space hazards and defensive interceptors.

Day 3 — The Debt Came Due: By mid-week the root simulation script had blown past 2,700 lines, and my test suite had grown fast enough that I didn’t fully trust it anymore. I forced myself to stop adding features, audited 21 test files (which immediately turned up three real bugs), and ran a first refactoring pass pulling eight subsystems out into their own scripts. Once the ground felt solid again, I added point-defence grids, spent an hour iterating on orbital barrier VFX, wired up remote hacking and a rival AI, and sketched out a radial controller menu.

Day 4 — Replacing the Economy Mid-Flight: The old banked-energy pool was boring to play—you just hoarded a big number and forgot about it. Replacing it with a live local power network (where lower-priority buildings automatically brown out when demand beats supply, cushioned by battery buffers) immediately made expansion feel much tenser. Right after that, I started a second cleanup pass: deleting the old energy pool completely, replacing untyped building dictionaries with a typed slot state machine, and ripping out hundreds of dynamic root lookups.

Day 5 — Deleting Stuff & Benchmarking: The quietest day, and probably the most satisfying. I unified planets and stations behind a shared base class, deleted 110 pass-through wrapper functions and 9 dead prototype files, and ran an interleaved benchmark pass that cut warm UI refresh time by more than half.


What Stopped the Project Turning Into Soup
#

Moving that fast with coding agents feels great right up until the AI starts contradicting yesterday’s design. A few simple habits saved me all week:

  • Short ADRs for design decisions: I now have 25 ADRs in the repo (three from this week covering the power network, compute capacity, and moon modifiers). Writing down why a mechanic works a certain way stops an agent from quietly reverting it two tickets later.
  • A glossary backed by a dumb bash linter: Models love inventing synonyms ("power" vs. "energy", "home base" vs. "cradle"). I keep 82 canonical terms in GLOSSARY.md and run a tiny grep -rnE pre-merge script that flags legacy/drift terms automatically.
  • Deleting replaced mechanics immediately: Leaving an old economy system in the repo “just in case” poisons every future AI search. When the live power network went in, I deleted pooled_energy across 36 files (+581 / -378 lines) in the same push. Same with pooled_compute the moment live compute reservations worked.
  • Calling time-out myself: Not once did an agent suggest pausing feature work to audit tests, break up a god script, or benchmark frame times. Every stabilisation break had to be my call.

By the Numbers
#

115

Commits in 5 Days

+18,635 / -6,227 lines across 196 files—nearly a third as many lines deleted as added.

30

Tickets Shipped

Small, verifiable vertical slices from core combat to power networks and refactoring.

1,834

Passing Assertions

42 headless test suites and 251 test functions keeping refactors honest.

82

Glossary Terms

Backed by 25 ADRs and a zero-tolerance pre-merge naming linter.

How It Plays Now & What’s Next
#

For the first time, the game actually has a real rhythm—expanding out, juggling local power brownouts, intercepting hazards, and racing the rival AI. That said, plenty is still rough: the mouse-first HUD still feels cramped on smaller screens, and controller support doesn’t exist yet beyond a design doc.

Before I tackle Steam Deck and gamepad playtesting, I’m going to write up a few of the engineering deep dives from this week—starting next with what I found when I actually audited 21 of my AI-written test files.