Five hundred enemies, two rooms, a narrow doorway, a wide gap and a dead end. One prompt to Claude Opus 5.5 in Claude Code: build the horde, and nothing may get stuck. No second model: a scorecard written before the first pass, eight things a shipped horde does. Then a bug report and a look brief.
Source: https://flockbay.com/blog/claude-opus-5-5-builds-a-500-enemy-horde-in-godot/ · Updated 2026-10-12
The prompt
The exact prompt for the first pass (with three reference pictures):
Build one mechanic for a top-down survival game in Godot: a horde of melee enemies that finds its way to the player and never gets stuck. Make it 3D, seen from a high, angled camera that shows the whole arena; Tab switches to a closer camera that follows the player, and back. This pass is a grey-box in the clean look of the reference pictures: build everything from primitives, with a capsule with a clear front for the player and a smaller capsule for each enemy, and don't download or generate 3D models. The pictures show the look and the idea; where a picture's layout differs from these words, build the words. Build one walled arena about 48 metres wide and 28 deep, with west at the left of the screen and north at the top. A wall down the middle splits it into a west room and an east room, and that wall has two openings: a doorway 2 metres wide near its north end and a gap 5 metres wide near its south end. The enemies spawn in the north-west corner and the player starts in the middle of the east room. On the straight line from the doorway to the player's start, put a U-shaped wall about 6 metres across with its open side facing the doorway, so anything that walks straight at the player from there ends up in a dead end. Scatter a few pillars and crates in both rooms. The player runs with W A S D in screen directions at about 6 metres a second and has no attack: the game is to stay alive. Each enemy is about 0.8 metres wide and runs at about 4 metres a second, and it hits the player when it is next to him. Show the player's health, how many enemies are alive and how long he has survived; at zero health show his time, and R starts again. The horde is the point. However many there are, every enemy has to reach the player by a way it can actually walk: around the U, through whichever opening gets it there sooner, never stopping against a wall or a corner, never passing through a wall, a crate or another enemy, and never queuing at the doorway in a jam that does not clear. When the player goes to the other room they come after him by the new shortest way, not through where he used to be. When they reach him in the open they close in around him from every side instead of lining up behind one another. And it has to hold with a lot of them: the keys 1, 2, 3 and 4 clear the horde and spawn 10, 100, 300 and 500 of them, and with 300 it should still run at 60 frames a second on this PC, measured with v-sync off. For testing only: F2 turns god mode on and off, so the player takes no damage, and F3 turns on a debug view that draws the navigation data you use on the floor (the mesh, the grid or the field) and, for up to twenty enemies, the route each one is following. Both are off by default. Make every key above an input action so it can be pressed by name: move_up, move_down, move_left, move_right, camera_toggle, restart, horde_10, horde_100, horde_300, horde_500, god_mode and debug_view. So the playtest can count them from outside, put the player in the group player, and keep one node in the group horde with a method enemy_positions() that returns a PackedVector3Array holding the position of every living enemy, however you draw them. Nothing else yet: no weapons, no pickups, no waves, no menus and no sound. The look comes in a later pass, so keep the scenes and scripts easy to build on. Run and test the game only through Flockbay's tools: flockbay_play, flockbay_run_headless, flockbay_script_errors, flockbay_game_input, flockbay_game_get, flockbay_game_set, flockbay_game_screenshot, flockbay_last_run and flockbay_stop. Don't start Godot from your own shell, and if one of those tools can't do something you need, say exactly what was missing in your handover. Playtest it yourself and hand it over when you think it's done.
What was judged
The horde against the scorecard: eight rows, each a drive that can be run again.
How it moves beside the shipped games of the opening: round an obstacle, through a doorway, closing round the player.
How it is built: the navigation data, how often a route is searched, what keeps bodies apart, what runs every frame.
How it holds with more of them: the frame time at 100, 300 and 500.
What it took: the passes, the minutes, its own Plays, and the estimated API bill.
The look, once the mechanic clears: the same horde dressed, beside the reference.
In the video
- 0:00 How games move a horde
- 1:14 Pass 1: the grey-box
- 2:03 Under the hood
- 2:53 What it got wrong
- 3:10 The look pass
- 4:04 The bug, second time
- 4:30 The bill
- 4:41 So can it?
It ran in Claude Code, on Flockbay’s MCP server
Claude Opus 5.5 ran in Claude Code for 92 minutes on the prompt above, with Flockbay’s tools connected over MCP: 117 calls to Flockbay’s tools and 141 to Claude Code’s own. Every call, from the run’s transcript:
| Tool | Calls |
|---|---|
| Bash | 72 |
| Edit | 35 |
flockbay_play |
28 |
flockbay_game_input |
23 |
| Read | 19 |
| Write | 15 |
flockbay_run_headless |
13 |
flockbay_last_run |
12 |
flockbay_set_input_action |
12 |
flockbay_script_errors |
11 |
flockbay_game_stats |
6 |
flockbay_game_screenshot |
4 |
flockbay_game_set |
4 |
flockbay_set_project_settings |
2 |
flockbay_game_get |
1 |
flockbay_guide |
1 |
Godot’s output caught the first bug
The first check that failed was flockbay_run_headless on res://tests/horde_test.tscn. The lines it returned that name the problem:
Ran res://tests/horde_test.tscn headless: it quit by itself with exit code 1 after 62.52 s of game time (frame 3751 of 18000).
[12] FAIL: two enemies overlapped by 0.226 m
[13] RESULT: FAIL
The next edit went to res://scripts/horde.gd
The next edit Claude Code made after that check, through Bash:
sed -i 's/^const SOLVER_ITERATIONS := 2/const SOLVER_ITERATIONS := 4/; s/var push := minf((diam - a) \* 0.5, 0.15) \/ a/var push := minf((diam - a) * 0.5, 0.2) \/ a/' scripts/horde.gd
res://scripts/horde.gd as it was handed over
Lines 51 to 83 of 979, from the game folder at the end of the build.
@export var arena_size := Vector2(48, 28)
## Where a new horde gathers before it runs.
@export var spawn_corner := Vector2(-24, -14)
@export var spawn_spacing := 1.0
const HASH_CELL := 1.0
## Floats per beetle in the MultiMesh buffer: a 3x4 transform and custom data.
const STRIDE_FLOATS := 16
const SOLVER_ITERATIONS := 4
## A remembered route: points every PATH_STEP metres along the way, kept so an
## enemy can hold its route when the crowd swings the way round behind it.
const PATH_POINTS := 128
const PATH_STEP := 0.6
## Ticks over which a new horde chooses its routes, a few at a time.
const PLAN_SPREAD := 90
var active := true
var field: FlowField
var player: Node3D
var _n := 0
var _px := PackedFloat32Array()
var _pz := PackedFloat32Array()
var _vx := PackedFloat32Array()
var _vz := PackedFloat32Array()
var _speed := PackedFloat32Array()
var _cooldown := PackedFloat32Array()
# Stall breaking: time stood still with nothing ahead, and a way held for a while.
var _stall := PackedFloat32Array()
var _commit := PackedFloat32Array()
var _commit_x := PackedFloat32Array()
var _commit_z := PackedFloat32Array()
var _head_x := PackedFloat32Array()
Download Flockbay free: Built in Flockbay, a free AI game maker built on Godot. https://flockbay.com/free-ai-game-maker/
Related: The Blender episode: where this dwarf was built, Opus 5.5 and Godot's stairs problem, How to make games in Claude Code
I make Flockbay, a free AI game maker built on Godot. The original is on flockbay.com.
Top comments (0)