Inspiration
"New Worlds" usually means space or fantasy. We went the other way, into the world of one of the smallest animals there is, the fruit fly. Its brain has been mapped neuron by neuron and published openly through Virtual Fly Brain. We wanted to see whether that wiring could run a living world rather than sit in a database. It's also a preview: as bigger brains get mapped, worlds like this could run on them.
What it does
A 3D clearing of fruit flies, each run by a model built from 104 real neuron classes. They forage, court, fight, sleep, lay eggs and flee a spider. Click any fly to read its thoughts, watch its brain light up in a 3D brain, and open the real neuron's data. Dials tune aggression, fear or food supply across the population, and you can possess a fly and see through its compound eyes.
How we built it
Simulation: a Python FastAPI server ticks the world at 20 Hz. Each tick, every fly goes from senses to neuron activations to competing drives to one decision. Learning: dopamine signals reweight the mushroom-body synapses, so flies learn which smells are worth following. Data: Virtual Fly Brain's public APIs supply neuron descriptions, synaptic partners and 3D skeletons. Front end: three.js draws the low-poly world and React draws the HUD, streamed over a WebSocket at 10 Hz. Optional Claude layer: it can narrate a fly's thoughts.
Challenges we ran into
Making the data real. We verified every neuron ID against Virtual Fly Brain's live data and cross-checked the circuits against the literature. Showing the brain in 3D. We placed real reconstructed neurons inside the template brain. 89 of the 104 classes have skeletons in brain space; the rest live in the nerve cord or body. Balancing an ecology. Making food finite first starved flies on top of food. Fixing it meant separating how a fruit tastes from how much is left. Interaction bugs. Flies move between click and release, which broke selection until we selected on press. Rendering. Terrain, mountains that blend into the ground, and a compound-eye shader had to stay smooth in a browser.
Accomplishments that we're proud of
Making the data real. We verified every neuron ID against Virtual Fly Brain's live data and cross-checked the circuits against the literature. Showing the brain in 3D. We placed real reconstructed neurons inside the template brain. 89 of the 104 classes have skeletons in brain space; the rest live in the nerve cord or body. Balancing an ecology. Making food finite first starved flies on top of food. Fixing it meant separating how a fruit tastes from how much is left. Interaction bugs. Flies move between click and release, which broke selection until we selected on press. Rendering. Terrain, mountains that blend into the ground, and a compound-eye shader had to stay smooth in a browser.
What we learned
Connectome data is rich, but turning wiring into behaviour needs many modelling choices. Showing the neuron behind each decision makes a simulation feel explainable. Being honest about limits earns trust. The neurons and circuits are real, but the weights are hand-set, so this is a model inspired by the connectome, not a synapse-by-synapse simulation.
What's next for Lord of the Flies
Larger brains as their connectomes arrive, richer social behaviour, and a classroom mode for teaching how brains decide.
Built With
- anthropic-claude
- fastapi
- glsl
- html
- httpx
- javascript
- neo4j
- numpy
- orjson
- python
- react
- rest-api
- solr
- three.js
- typescript
- uvicorn
- vfbquery
- virtual-fly-brain
- vite
- webgl
- websockets
- zustand