Building a Swarm Mesh Network

Truth

Was a super difficult challenge that we struggled with. Here is what we got:


What We Actually Built

Crate deployment system — Drones start hibernating in a sealed container. When enemies cross a seismic sensor threshold, the crate lid opens and drones burst out in a staggered sequence over a few seconds. No drones deploy until a threat is detected.

Formation flocking — Once deployed, drones form a line using five interlocking forces: separation (keep distance), cohesion (stay near neighbors), alignment (match velocity), line-pull (stay on the advancing formation axis), and advance (constant push toward enemies). No fixed slots. Drones organically spread along an invisible line that moves forward across the map.

Leaderless mesh network — Each drone automatically discovers peers within radio range. Power adjusts so roughly 2 neighbors are in range, minimizing RF signature. The mesh floods threat alerts through the network with a TTL counter. Dead or hibernating drones are automatically excluded from routing.

Enemy detection and engagement — Drones sense enemies within visual range and broadcast alerts across the mesh. The system calculates how many kamikazes each threat requires (1 for infantry, 6 for a tank) and assigns the closest available drones. Once assigned, a drone breaks formation and dives straight at its target at full speed. Impact is instant death for both.

Self-healing network — When a drone dies, the mesh automatically removes it from peer discovery. Remaining drones re-establish links and continue routing without interruption. No central controller, no acknowledgment protocol. The mesh just works around losses.

Procedural city environment — Buildings generated procedurally in blocks with varying heights and rooftop details. Enemies spawn from the bottom edge and advance toward the crate through the street grid.

Visual rendering — Tkinter GUI showing the entire map, drones as dots with trails, enemies as colored shapes, the formation line as it advances, all mesh connections drawn as live lines. A live event log on the right shows every crate activation, drone deployment, enemy detection, and impact.

How We Built It

Python end-to-end. Drone agents with position, velocity, and state machines (hibernating → deploying → flocking → engaging or dead). A mesh class handling peer discovery and alert flooding every tick. A simulation loop computing flocking forces and updating all entities. A renderer drawing everything in real time.

Started with basic movement and formation holding, then added seismic triggering, staggered deployment, mesh peer discovery, threat detection, engagement assignment, and alert flooding. Each layer built on the previous one. Everything tested immediately in the GUI.


PS, I also ran a marathon mid hackathon

Lawyer portrait photo

Create a free website with Framer, the website builder loved by startups, designers and agencies.