SwarmPilot
Flies the swarm. One of these sits on the player prototype's body, so every player who joins gets their own, and it is the only thing in the game that decides where a player's cloud is.
SwarmPilot
Flies the swarm. One of these sits on the player prototype's body, so every player who joins gets their own, and it is the only thing in the game that decides where a player's cloud is.
Flying it
| Control | Does |
|---|---|
move left / right | Rolls the cloud — and the roll is what turns it |
move forward / back | Throttle |
jump | Climb |
crouch | Dive |
Everything goes through the input map, so a keyboard, a gamepad and a phone all fly it without this component knowing which one is holding it.
What it feels like, and why
A swarm of a hundred thousand insects is not a cursor, so nothing here is assigned — it is all integrated.
- The stick rolls, the roll turns. A change of direction costs a beat of
banking first and a beat of levelling out after.
BANK_LAGis the single number that decides how heavy the swarm feels. - Speed is built and shed at a rate, in m/s², so the cloud carries its momentum through a turn and has to be flown out of one.
- Turning scrubs energy, so the fast way across the farm is the straight one and a panicked line costs you crop.
- Climbing is effort and diving is gravity. A dive hands you speed and drops you into the crop; hauling back out gives it up again.
- The crop is thick. Speed falls away smoothly as the swarm sinks into the feeding band rather than stepping down at a line.
- The last few metres flare at the floor and the ceiling, so the bottom of a dive feels like a bottom instead of a wall.
- The edge of the farm banks you back rather than stopping you dead: the boundary is fed in as steering, so the swarm turns away from it the way a player would.
What it publishes
Every frame, into Locust.state.swarm:
x, y, z · vx, vy, vz · heading · pitch (flight path, not the key you
pressed) · speed · feeding (true at or below ALT_FEED) · and the three
cloud-shape values bank, stretch and tighten — this slice telling
whoever draws the swarm what the air is doing to it. It reads mass,
radius and alive, which belong to the rules slice.
The body entity's transform follows the same values, so anything parented to the swarm rides along, banked and pitched with it.
One thing worth knowing
The spawn's transform lands on the body about half a second after this
component's awake() and its first update(). So the body is not read once
and owned forever: it is watched, and any move it did not make itself — the
spawn arriving, a respawn, a teleport — is adopted. The threshold scales with
how far the swarm travels in a frame, so its own motion never trips it.
Scoped to this part · feeds back into the world's score.