Brick & Mortar

How It's Made · Step 12 of 27

Step12

Fifty levels from a generator, and the week's rules for agents

· 4 min read

tower-defenseclaudeagentsdesign

The Tower Defense interface over brick apartment blocks in falling snow.

Tower Defense was not in the original plan. It arrived on 6 October as a prototype, because the owner wanted something to play that was not a full match. A week later it is a 50-level mode with its own towers, bosses and rules. This step is about how it got that big that fast.

The first level

The prototype rules were decided in a conversation. The owner answered a list of open questions in a few lines: yes, the player can buy mobile defenders; no, towers are not attacked, enemies walk past; yes to stars per level and a harder variant; yes to its own music. Then the prototype level went in. On the third play-through the owner's note was "super fun!" and a list of fixes: the cannon's rig must turn properly, enemies that chase a unit must not get stuck, the shop should sell every relevant building.

Two things came out of those first plays that stayed. Every lane winds around the map with several passes under the same towers. And multiple entrances: from level 3 on, two or more lanes merge. The owner loved that one, and it is why levels read as places.

The plan grows

By 13 October the owner's notes had said that the start of the mode was perfectly challenging, that level 7 already felt unchanged, and that the end of each level should be chaotic with new enemy types late. The plan had already gone from ten levels to twenty to sixty; on 13 October it settled on fifty in six chapters. Chapters one to five have eight levels each and chapter six has ten. You defend as USA, RUSSIA and MARS in turn, against each other and the aliens, with a boss at the end of each chapter and a finale on level 50.

Difficulty follows a sawtooth: each chapter climbs to a boss, and the next opens at about two thirds of that peak. A straight line is boring. A line with a reset gives the player a place to breathe and something new to learn.

Why a generator

You cannot hand-write 50 levels of 20 to 50 waves each in three weeks. The owner's own schedule decision on 14 October was a generator-first system: write the curve once, not the waves.

scripts/td_waves_gen.py takes a tuning table (how hard the first wave is, how fast the peak rises, how many units and of what kind, which boss, which lane) and a roster of enemies, and writes every wave of every level. On its first run it produced 50 levels and 1,910 waves and passed its own consistency check. A second script prints the difficulty table, so we can look at the whole sawtooth in one place.

A boss approaching along a lane, captured in a test run.

The generator is data, not taste. A human still draws each level's lanes and tower spots. And as we will see in a later step, the generator's numbers were only a first guess.

Rules for the agents that week

The same week, the owner approved a cheaper agent layout, and it is worth writing down because it applies to anyone using many agents:

What we would do differently

Try it yourself

If you have more than ten of anything, write the curve, not the items. Then spend your human attention on the ten things the curve cannot know.

Next: One mission at a time - the mission maker and the bots that test it (16 October 2026)

Start at Step 1All 27 steps

Written afterwards from our project notes and commit history; dated to when the work happened.