Skip to content

Commit 1eb5bad

Browse files
snow-jallenclaude
andcommitted
House bot "formics": the Formics, the hardest house bot
A hive mind built from the season's replays. The strongest student bots (OrionBot, Mistro, kaden-distributed, Simper) win by out-digging: 100+ workers, several Command Centers, towers. The Formics play that game tighter: a drop-off two tiles from every grub field (dig, bank, dig; no walking), Command Centers on the free corners (mirror symmetry tells where every corner's grubs are), a worker scout for the fields in between, Entomology first, towers by every base, and an army sized from the public scoreboard (survival and income say roughly how big an enemy army is). It fights with soldiers only (equal grubs of soldiers beat every mix in tests) and shares its blows out so none is wasted on a unit already dead. Against stand-ins for the top bots it wins 8/8 each against rush, scout-rush, kaden-, Ethan-, Flaud- and Mistro-style plans and every house bot, 23/24 against OrionBot- and Simper-style macro, and most 3- and 6-player free-for-alls; about 0.5 ms a tick. Full House keeps asking for the original five house bots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V8fdNFMnkyDNTFoKqQyD6L
1 parent ea81b54 commit 1eb5bad

19 files changed

Lines changed: 1671 additions & 9 deletions

‎CLAUDE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dotnet run --project src/NetRts.BotRunner -- --server http://localhost:5080 --na
4242
- `src/NetRts.Engine` — deterministic simulation (`GameSimulation` partials: core, Commands, Tick, Views, Testing), `GameRules`, `MapGenerator`, `Pathfinder`. No clocks, `System.Random` or unordered iteration; the replay test checks determinism.
4343
- `src/NetRts.Protocol` — JSON DTOs shared with bots. Add fields; don't rename them.
4444
- `src/NetRts.Server` — ASP.NET Core minimal APIs; `Matches/MatchHost` wraps one simulation behind a lock.
45-
- `src/NetRts.Bots` — `NetRtsClient`, `BotLoop`, `PlanBot` + house bot plans, and `Blocks/` (Block Bot: rule programs the server plays for a player). Both server-played bots stand on `BotView` (one tick's queries), `BotMemory` (what a bot keeps between ticks), `BotTurn` (one tick's budget, reserved units and commands; `TryTrain`/`TryBuild`/`TryResearch`/`Order` return an `Attempt`). `BotCharacterizationTests` hash every command the house bots and Block Bot send: a refactor must leave the hashes alone.
45+
- `src/NetRts.Bots` — `NetRtsClient`, `BotLoop`, `PlanBot` + house bot plans, `Formics/` (the hardest house bot, its own code; `FormicsTuning` holds its numbers), and `Blocks/` (Block Bot: rule programs the server plays for a player). Both server-played bots stand on `BotView` (one tick's queries), `BotMemory` (what a bot keeps between ticks), `BotTurn` (one tick's budget, reserved units and commands; `TryTrain`/`TryBuild`/`TryResearch`/`Order` return an `Attempt`). `BotCharacterizationTests` hash every command the house bots and Block Bot send: a refactor must leave the hashes alone.
4646
- `docs/bot-guide.md` is the player-facing rules/API doc — keep it in sync with `GameRules` and the endpoints. `docs/requirements-coverage.md` maps the spec to code.
4747
- `src/NetRts.Server/Achievements` — the 77 achievements (`AchievementCatalog`; ids are stored, never change one) and their evaluation; `Recaps` — nightly ladder snapshots and the recap brief.
4848
- `recap/` — the nightly recap video job (Node: Azure OpenAI gpt-5.5 + Azure Speech in Foundry, Playwright + ffmpeg); `deploy/recap/setup.sh` + `main.bicep` create its Azure resources.

‎README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Take the last enemy HQ, or have the higher score at the final whistle. Results b
147147
destruction, economy and survival, feed an Elo ladder of Top Badgers, and come with a full replay:
148148
the engine is deterministic, so a seed plus the command log reproduces any brawl exactly.
149149

150-
## Five house badgers to scrimmage
150+
## Six house bots to scrimmage
151151

152152
| House badger | API name | Plays like |
153153
|---|---|---|
@@ -156,8 +156,9 @@ the engine is deterministic, so a seed plus the command log reproduces any brawl
156156
| **Honey Badger** | `rusher` | Doesn't care. Races to two Snow Mobiles and rolls them at your campus ringed by soldiers. |
157157
| **Blue Badger** | `balanced` | Steady economy, mixed team, upgrades, attacks in waves. |
158158
| **Grub Hoarder** | `economist` | Out-digs everyone, hides behind bell towers, arrives late with an enormous clan. |
159+
| **The Formics** | `formics` | A hive mind. Digs every corner of the map with a hundred workers, then swarms you with upgraded soldiers that all hit the same target. The final boss. |
159160

160-
Beat the Sleepy Sitter and the Poky Badger in your first hour. Beating the Grub Hoarder takes a real plan.
161+
Beat the Sleepy Sitter and the Poky Badger in your first hour. Beating the Grub Hoarder takes a real plan. Beating the Formics takes the best bot in the class.
161162

162163
## An API that documents itself
163164

‎docs/bot-guide.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ own campus building and its own student housing.
4545
| Intro to Biology → Entomology | `Harvesting1` → `Harvesting2` | More grubs per dig (know your insects) |
4646
| Intro to Construction → Structural Engineering | `Fortify1` → `Fortify2` | Sturdier buildings |
4747
| Welding Technology | `SiegeEngineering` | Unlocks the Washburn Welding Shop |
48-
| Sleepy Sitter, Poky Badger, Honey Badger, Blue Badger, Grub Hoarder | `sitter`, `poky`, `rusher`, `balanced`, `economist` | House badgers |
48+
| Sleepy Sitter, Poky Badger, Honey Badger, Blue Badger, Grub Hoarder, The Formics | `sitter`, `poky`, `rusher`, `balanced`, `economist`, `formics` | House badgers (the Formics are the bugs) |
4949

5050
## The loop
5151

@@ -114,7 +114,7 @@ away, practice and preseason games in an hourly roundup. To practise privately,
114114
| `GET /api/v1/matches/{id}/replay` | Seed + every executed command — enough to re-simulate the match exactly. |
115115
| `GET /api/v1/matches/{id}/frames` | A finished match, tick by tick, as spectators saw it: the map, the whole play-by-play (`events`), and `chunkCount` chunks of `chunkTicks` (100) ticks. This is what the website's replay viewer plays. |
116116
| `GET /api/v1/matches/{id}/frames/{n}` | Chunk `n`: one spectator state per line (newline-delimited JSON) for ticks `n × chunkTicks` onward. Sent Brotli-compressed when your client accepts `br`. |
117-
| `GET /api/v1/bots` | House bots: `rusher`, `economist`, `balanced`, `sitter`, `poky`. |
117+
| `GET /api/v1/bots` | House bots: `rusher`, `economist`, `balanced`, `sitter`, `poky`, `formics` (the hardest). |
118118
| `GET /api/v1/leaderboard?category=Season` | One category's ladder: `Practice` (the default, by Elo rating; only player-vs-player 1v1s change it, while games against house bots count toward your win/loss record), `Preseason`, `Season` or `Championship` (by points, then skill). Every row also has `skill` (and the raw `mu`/`sigma`), see below. Add `&season=2026-27` for a past season. |
119119
| `GET /api/v1/players/me` | Your profile. `rating`/`wins`/`losses`/`draws` are your practice record; `records` has every category (rating, points, `skill`, record), and `verified`/`ownerName` your blue check. |
120120
| `GET /api/v1/achievements`, `GET /api/v1/players/{id}/achievements` | Every achievement (how many bots have each, and who), and the ones a bot has earned. See [Achievements](#achievements). |

‎docs/how-it-works.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,8 @@ matches are rated, so nobody can farm rating by beating the passive house bot.
350350
- `PlanBot` — one data-driven strategy engine. `rusher`, `economist`, `balanced` and `sitter` are
351351
the same code with different `BotPlan`s (worker target, build order, army mix, attack
352352
threshold).
353+
- `FormicsBot` (`Formics/`) — the hardest house bot, its own code: depots two tiles from the grubs,
354+
Command Centers on the free fields, an army sized from the public scoreboard, and focus fire.
353355

354356
The same strategy objects run in two places. Over HTTP via the runner, they are ordinary bots.
355357
Inside the server as **house bots**, `MatchHost` calls `Decide` just before each tick and submits

‎docs/tutorial/07-where-next.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ python step4_attack.py --name my-first-bot --vs balanced --tick-ms 200
2222
| `rusher` | Races up the tech to two Trebuchets, then attacks with them surrounded by soldiers and scouts. |
2323
| `economist` | Big economy, guard towers, upgrades, a large late push. |
2424
| `balanced` | Steady economy, soldiers plus archers, upgrades, attacks in waves of ten. |
25+
| `formics` | The hardest: a huge economy across the whole map, then a swarm of upgraded soldiers that focus their fire. |
2526

2627
Watch the matches in the spectate page: seeing *how* you lose is the fastest way to improve. Use
2728
`--seed` to replay the same map while you compare changes.

0 commit comments

Comments
 (0)