8,000 drones at about 72 fps: how swarm wings work
Published · Updated
Eight thousand drones, in 8 wings of 1,000, ran at about 72 frames a second on the development machine. The trick is that a wing of drones thinks as one.
One brain, many bodies
The enemy is a machine swarm. It comes in wings, 25 drones each by default.
- One brain. A wing is a single craft to the game: one pilot, one target choice, one avoidance check, one marker. It uses the same pilot code as a fighter, and it is always reckless.
- Drones are bodies. They have no AI of their own. They swirl round the wing’s centre in a flattened ball about 70 m across, each at its own pace, either way round. All of a wing’s drones are drawn as one batch.
How a wing fights
- Every half second, the wing picks up to 5 enemies in reach of the cloud: its own target first, then craft before turrets.
- Each drone takes the nearest of those its gun can reach, in its own burst rhythm, so the cloud crackles.
- One round in four is fired and drawn, carrying four rounds’ damage: the same damage a second, fewer tracers. Every fired round is rolled for a hit like any other gun round.
- Its tracers are violet. A drone is packed full of ammunition: a wing reloads, but never runs dry.
A swarm smothers everything near it, while a lone Mk3 fighter focuses on one target.
How a wing dies
Each drone is as tough as a fighter of its Mark, and the wing’s hull is all of theirs added up: a Mk1 wing has 25 × 90 = 2,250. Every drone’s worth of damage it takes kills one, so the cloud thins and its fire weakens. The marker shows the count, for example “Swarm wing 1 · 18/25”.
With the carrier’s Mk3 point defence doing 10 damage a hit, a Mk1 drone takes about 9 hits, a Mk3 drone about 36. Rounds aimed at a wing go for one drone each, so tracers fly into and past drones, not into the empty middle.
The cost is per wing
The benchmark spawned Mk3 wings 3 km out over Bukittinggi, at 1600 × 900 with rendering on, on an RTX 3070 Laptop and a Ryzen 7 5800H.
| Wings × drones | Drones | fps | Frame |
|---|---|---|---|
| none | 0 | ~185 | 5.4 ms |
| 10 × 25 | 250 | 173 | 5.8 ms |
| 40 × 25 | 1,000 | 80 | 12.5 ms |
| 40 × 50 | 2,000 | 74 | 13.5 ms |
| 80 × 50 | 4,000 | 42 | 23.6 ms |
| 8 × 1,000 | 8,000 | 71–73 | ~14 ms |
- Each wing’s brain costs about 0.2 ms a frame; each extra drone about 1 µs. The limit is about 45 to 50 wings at 60 fps, whatever their size.
- The graphics card stays near 5 ms even at 8,000 drones, one batch a wing.
- Individual enemy fighters reach 60 fps at about 100. Wings carry about 12 times as many craft.
A caveat: the samples were taken during the approach and the chase, not in a brawl with many targets, and each drone’s fire timer runs every frame, so heavy firing will cost more.
Before wings, the game got 100 individual raiders from 82 ms a frame down to 11 ms by removing loops that checked every fighter against every other. Wings were the next step.
The numbers and the reasons behind them: swarm drones and wings.