Swarm Comms Lab v0.1.0

Layer 3: following the coordinator's plan Layer 2: negotiating with peer claims Layer 1: solo, own camera only Ground station (ID 0) ★ Coordinator Enemy (hollow = unseen)
Time0 s
Intercepted0
Breaches0
Avg response–
Coordinator–
Network groups1
Messages / s0
Bandwidth0
Claims resolved0
Over-assigned now0
Elections0
Drones by layer

Traffic by message type

Event log

    The framework

    Every drone runs the same software. Nobody is told which layer to be in: each drone works it out from what it has, or hasn't, heard recently. A higher layer overrides a lower one whenever it's available, so losing the radio makes the swarm slower, never useless.

    Layer 3 · Coordinator plan

    When links are good, one node computes a globally optimal assignment (Hungarian algorithm) and broadcasts a PLAN five times a second.

    Active while a plan is younger than the plan timeout.

    Layer 2 · Peer claims

    No plan, but neighbors are audible. Each drone bids on its cheapest target with a CLAIM. Lowest cost wins; ties go to the lower ID.

    Active while any peer was heard within the contact timeout.

    Layer 1 · Solo

    Nobody is audible. The drone chases the most urgent enemy its own camera can see, and otherwise patrols its home slot.

    Always available. The last line of defense.

    Six rules

    1. Roles are emergent, not assigned. Identical code everywhere; the layer and the coordinator role follow from what each node hears.
    2. The coordinator is the lowest ID heard recently. No voting rounds. The ground station is ID 0, so it wins whenever it's reachable. If it goes silent past the leader timeout, the next lowest ID takes over automatically. When a lower ID reappears, the stand-in steps down.
    3. Share observations, not conclusions. OBS carries what a drone's own camera sees, with a timestamp, so everyone can build the same picture.
    4. Deterministic tie-breaks. Everyone applies the same rule to the same claims, so agreement needs no extra round of messages.
    5. Act first, reconcile later. A drone announces and moves on a new target immediately. Two drones briefly chasing one target costs less than everyone hesitating.
    6. Fast loops stay local. Steering runs on board. The radio only carries decisions, never stick commands.

    Messages

    TypeSent byMeaningSizeRelayed
    STATEeveryone, 5 HzMy position, velocity, target, layer. Doubles as a heartbeat.17 Bup to TTL
    OBSanyone seeing enemies, 5 HzWhat my own sensor sees right now.10 + 7 per enemyup to TTL
    CLAIMdrones with a target, 5 Hz + on change"I'm taking target T at cost C."12 Bmax 2 hops
    RELEASEthe drone that intercepts"Target T is done, forget it."11 Bup to TTL
    PLANcoordinator, 5 HzAssignment for every known drone, plus position cues for assigned targets.10 + 2/drone + 7/targetup to TTL
    ELECTa node that just became coordinator"I'm coordinating now."9 Bup to TTL

    Every message carries origin, sequence number, timestamp and TTL (9-byte header). Receivers drop duplicates and ignore anything older than what they already have.

    What v0.1 assumes

    Experiments to try

    1 · How long is the coordination gap?

    Run Clear skies and press Kill coordinator. Drones turn amber (Layer 2) after about 0.6 s, then D1 takes over at about 1 s and they turn blue again. Try changing the timeouts and watch the gap change.

    2 · Split brain

    Lower Drone radio range to about 130 m and Ground station radio to about 200 m. As drones chase outward, the network splits and a second coordinator appears (e.g., GS + D2). When the groups meet again, the higher ID steps down.

    3 · What does coordination buy?

    Compare Clear skies with Total blackout over a few waves. Watch the average response time and the breaches. In headless runs: about 0.3 s versus 1.4 s response, and about 0% versus 7% breaches.

    4 · Relay hops versus bandwidth

    Move Relay hops between 1 and 5. More hops reach drones far from the coordinator, but messages per second climb steeply. Where is the sweet spot?

    5 · Fighting through interference

    Pick the Move zone tool and drag the zone over the incoming wave. Drones that chase into it lose the plan and fall back, then rejoin as they leave.

    6 · One drone per target, or two?

    Change Max drones per target. Doubling up wastes drones but beats evasive enemies. This is the trade-off a trained policy should learn.

    Roadmap

    1. v0.2 Track identity: drones name tracks themselves and merge duplicates (data association).
    2. v0.3 Policy plug-in: load a trained model (e.g., ONNX or TensorFlow.js) in place of the hand-written policy.
    3. v0.4 Smarter relaying: gossip and a per-drone bandwidth budget instead of flooding.
    4. v0.5 Dataset export: log every message and decision as JSON for ML training.
    5. v0.6 Learned communication: agents learn what to send, compared against this hand-designed protocol.
    6. v0.7 3D world and realistic flight dynamics.

    Changelog