用氛围编程造即时战略游戏,还能靠声音联机
做法与步骤
- 先给智能体一个 MVP 目标(手机端 C&C 风格 RTS),让它反问需求,再用图像生成 API 产出基础素材,得到可运行但不好玩的原型。
- 前几版只做到“像游戏”:补全精灵图、加入 AI 对战、生成多地形地图,但作者自己玩一会就腻,印证了智能体擅长做外观、不擅长做好玩。
- 关键转折是直接下模糊指令“让它好玩很多”,在动态工作流模式下并行调度大量子智能体,跑了一整夜并模拟上千场对战来调平衡。
- 用模拟数据验证效果:25 分钟仍未分胜负的对局从 14% 降到 0.9%,落后 800 以上资源翻盘的比例从 24% 升到 46%。
- 后续迭代把游戏移植到 three.js 做全 3D 模型,补充步兵与运输机等单位,并发现 AI 不爱用新单位,于是想用新地图机制强制玩家使用。
- 联机方案很另类:两台靠近的手机通过音频消息同步游戏状态,是作者此前 Chirp Pong 实验的延伸。
对实践的启示
作者承认的反方与局限
作者原本相信编码智能体能做出像游戏的东西但做不出真正好玩的游戏,这个实验一度印证了该判断,直到模糊指令加大规模模拟才被推翻。
原文摘引
This game isn't fun enough yet. Make it a LOT more fun.
I've reviewed almost none of the code, and it's built in a language (TypeScript) that I've hardly used myself.
coding agents can build a thing that looks like a game but can't actually make something that's genuinely compelling to play
▸ 展开原文全文(75 段,抓取自 Simon Willison)
Battle Drones—a vibe coded RTS with audio-based multiplayer
20th October 2026
My latest vibe coded game experiment is a Command & Conquer style RTS (Real Time Strategy) game called Battle Drones (play it here). Unlike my previous experiments, this one is actually fun to play. I’m somewhat embarrassed to admit that I got there by telling Claude to “Make it a LOT more fun”. It also supports multiplayer between nearby devices using audio to synchronize game state! Here’s what I’ve built so far, and some of the things I learned along the way.
Battle Drones
My initial goal was to build an RTS game I could play on my phone, in the style of Command & Conquer. I have fond memories of the 1995 original (I liked Red Alert too) and wanted to recapture a little bit of the magic.
After 12 major iterations (and 321 commits by coding agents, mainly Claude Code) I now have a browser-based game that works on mobile and desktop, has multiple play modes, several maps (including a random map generator) and even supports multiplayer for two devices within microphone range of each other.
Here’s a video demo of Battle Drones running in a desktop browser:
Features so far include:
- 9 buildings, 7 ground vehicles, 6 aerial vehicles, 3 infantry units—all 3D models, which you can browse here
- Fog of war
- Different weapons are needed to target aerial or ground vehicles
- Six maps, across five biomes—temperate, desert, arctic, volcanic, tropical
- A random map generator
- Skirmish mode—red vs. blue on a rotationally symmetrical map
- Last Stand mode—one player holds out against as many waves of enemies as possible
- Area effect weapons: Barrage, EMP, Drop Pod, Sky Hammer
- Crate drops with bonus resources
- In-game music that responds to events—it gets more intense as fighting breaks out
- Different in-game AI personalities (Balanced, Rush, Air Swarm, Boom, Skyforce, Ironclad)
- AI vs. AI mode, to watch those personalities play each other
- The Goliath—a giant stomping mech with laser eyes and arm cannons and the ability to establish a new base
- Mutators that add extra rules or twists
- A “Daily Op” challenge
- Ranks and achievements (Medals)
- Agent vs. Agent mode where two LLMs can play Battle Drones against each other
- A multiplayer mode based on two nearby phones communicating via audio messages, an extension of my earlier experiment with Chirp Pong
How I built this
Battle Drones is heavily vibe coded—I’ve reviewed almost none of the code, and it’s built in a language (TypeScript) that I’ve hardly used myself. I’ve playtested it quite a bit though, and it’s been through a large number of iterations since I started the project.
Here’s a rough history of the project so far, including key prompts and links to transcripts.
v1: the initial prototype
I started out with Claude Fable 5 back in July:
We are going to build a mobile friendly RTS game - command and conquer style - called Battle Drones, in which two armies of drones (both flying and ground-based) battle for territory and resources
Let's start with a MVP design, ask me some questions
Here’s a shared transcript. I’d given Claude Code for Web an environment variable with an OpenAI API key and told it to use the OpenAI Image Generation API for assets, which got me some basic sprites.
You can try v1 here—it looked like this:
It’s recognizable as an RTS, has building mechanics and the ability to select and direct units, and a basic AI to play against.
This first version was barely a proof of concept, and it wasn’t any fun to play.
Claude used the Phaser 2D game framework for these early versions. I didn’t even realize this until several iterations later!
v2: full sprites
The second version (try v2 here) added sprites for all of the vehicles and the “AI vs. AI” mode, so I could watch the game playing without having to directly control it myself.
Claude proved reasonably competent at prompting OpenAI’s image models to generate sprites. You can browse the v2 sprites in the public/assets/sprites folder.
v3: varied terrain
It still wasn’t much fun, and the graphics were boring. It was now October, and I had upgraded to Claude Opus 5.5. I told it:
Massively improve this game. Make the graphics and gameplay better (keep it mobile friendly). Render new graphics using the latest OpenAI GPT image API (lookup details) with the API key in the environment variable. Add new unit types and balance the gameplay better. Also add new buildings and better, more varied terrain.
This resulted in five new maps with generated background tiles in a variety of styles, visible here. Opus also regenerated the sprites, making them much more visually appealing. You can try v3 here—it looks like this:
This is starting to feel like a real game! It still wasn’t very fun to play though—I found myself getting bored pretty quickly.
v4: the fun update
So far my Battle Drones experiment was confirming my previous belief that coding agents can build a thing that looks like a game but can’t actually make something that’s genuinely compelling to play.
I shared this theory with someone over dinner, and then thought to myself that I should give the models a proper chance to prove me wrong. I prompted Opus 5.5 on my phone:
This game isn't fun enough yet. Make it a LOT more fun.
This time I was running in Ultracode mode, where Claude Code (in this case Claude Code for Web) runs “dynamic workflows”, described in their docs as:
A dynamic workflow is a JavaScript script that orchestrates many subagents at once.
This kicked off many hours of work. I started it in the evening and didn’t get a playable result back until late into the next morning. But the results were spectacular.
You can try v4 here—it looks like this:
I had Claude write its own release notes—here are the highlights:
Every skirmish and Daily Op now opens with a choice, gives the side that’s losing a way back, and pulls the armies into the middle of the map. There are also two new ways to play.
- Openers: pick Blitz, Industry or Air Wing before the clock starts.
- Call-down powers: Barrage, EMP, Drop Pod and the Sky Hammer orbital strike.
- Objectives and salvage: Uplink relays, supply drops and wrecks worth scrap.
- Feel: combat juice, adaptive music, unit voices and an announcer.
- Command: battle alerts, game speed, saved squads and touch placement.
- New modes: Last Stand survival waves and an 8-mission Ops campaign.
- Progression: heroes, an after-action report with awards, a career, 7 mutators and a Daily Op.
Fights run longer and swing more. In 1,200 AI-vs-AI test matches on Normal, games still undecided after 25 minutes fell from 14% to 0.9%. The share of wins by a side that had been 800+ scrap behind rose from 24% to 46%.
Part of the reason Claude took so long was that it ran over a thousand simulated playtest sessions, and used the results to rebalance the existing units, add new ones, and introduce new features.
v5: Battle Drones goes 3D
After the success of Ultracode at “Make it a LOT more fun”, I decided to be more ambitious:
Port this game to three.js with 3D models for all of the buildings and vehicles and landscapes
That was another overnight run. I woke up to this v5 version:
The new 3D models were entirely constructed by Claude in TypeScript code.
v6 (play v6 here) added some more visual polish. v7 (play v7) added robot infantry (troopers, rocket squads, snipers) and a “Condor” troop carrying aircraft.
v8: Archipelago
I was beginning to feel guilty at how little actual design input I had into the game—it really had been a case of me saying “make it more fun” and “add visual polish” for the past few releases.
I’d noticed that the AI didn’t use the new infantry and troop carrying aircraft from v7 very often—there wasn’t a great strategic reason to use them.
It would be neat if we had a new map with a new game mechanic that actively encouraged players to load up Condors with infantry robots and send them out into th