FlyBrain

Quick rating

Community listing page, reviews here may not be monitored by the author.

FlyBrain

No reviews yet

A fruit fly whose flight is steered by a spiking simulation of 18,247 neurons from the real Drosophila connectome.

Mod Loaders
Minecraft

About

Description

FlyBrain

A fruit fly for Minecraft that is steered by a spiking simulation of 18,247 real neurons from the Drosophila connectome.

Every fly you spawn runs its own neural network: a flight-relevant part of the MaleCNS v1.0 connectome (brain plus ventral nerve cord), simulated as a leaky integrate-and-fire network with the published parameters of Shiu et al. (2024). What the fly sees in the Minecraft world is turned into activity of real visual cell types, and what its motor neurons and descending neurons do is turned back into flight.

What you will see

  • Flies that avoid walls with their own eyes. Surfaces that come closer activate looming detectors (LC4, LPLC2), which drive the giant fiber neuron and trigger an escape. In the automated in-game wall test, flies with vision hit the wall in 0 of 10 runs; blind controls with the same brain hit it in 10 of 10.
  • Realistic flight style. Flies fly in straight stretches broken up by fast turns of about 90 degrees ("body saccades"), bank into their turns and tilt forward in fast flight, as measured in real Drosophila.
  • Landing, sitting, walking and takeoff. Flies land on blocks, fold their wings, walk around a little and take off again. They launch at once when their giant fiber fires, for example when you hit them.
  • Flies in the wild. Flies now appear on their own during the day in plains, meadows, flower forests, forests and swamps. A per-world limit (default 6) keeps the CPU cost in check, and wild flies disappear again when nobody is around. This is game design, not an ecological model, and can be switched off.
  • Frogs, food and a glass bottle. Frogs eat flies, dropped food attracts them, and an empty glass bottle catches one if you can hit it before its escape reflex fires. All of this is game design on top of the simulation, not biology.
  • A live brain HUD. The HUD follows the nearest fly and shows its input populations, spiking output neurons, motor commands, simulation time and flight state in real time.

How honest is it?

This mod labels everything as real data, published model or simplification.

  • Real data: the connectivity (neurons, synapse counts, signs) comes from the MaleCNS v1.0 connectome.
  • Published model: the neuron model and its parameters come from Shiu et al. 2024.
  • Simplification: the sensors (raycasts instead of ommatidia), the encoding into firing rates, the decoding of motor neurons into Minecraft motion and the fixed escape manoeuvre.
  • Behaviour layer (simplification, can be switched off): spontaneous turns with a heavy-tailed interval distribution (Reynolds and Frye 2007), saccade amplitude and duration (Muijres et al. 2015), a preferred height band, landing and resting. The network alone produces very few turns in open air, so this layer makes the flight look like a fly's. Set behaviorLayer = false in flybrain-common.toml to watch the pure network-driven flight.

It is not a complete or validated simulation of a fly. It is a real connectome driving a game character, with every shortcut documented in SCIENTIFIC_NOTES.md in the source.

Is the fly in the game conscious?

Short answer: no, and the mod does not claim otherwise.

  • What runs here is a fraction of a brain. 18,247 neurons on a path from sensory input to the wing motor neurons. The real animal has well over a hundred thousand neurons, a body, a gut, hormones and a lifetime of internal state.
  • The neuron model is deliberately thin. Leaky integrate-and-fire point neurons: a voltage, a threshold, a spike. No dendrites, no neuromodulators, no plasticity, no learning. The network never changes while you play.
  • The senses are not fly senses. The eye is 20 raycasts, not thousands of ommatidia. There is no pain pathway in the model, because no nociceptive circuit was included in the subnet.
  • What science can and cannot say. Whether insects have any subjective experience is an open research question and this mod does not settle it. What can be said without hand waving is that this simulation contains far less than a fly does, and that a spiking network on a thread pool is a mathematical model of wiring, not an animal.

Swatting a fly in the game stops a numerical integration. If the question of insect experience interests you, the honest place to look is the research on the real animals, not this mod.

Getting started

  1. Install Forge 47.x for Minecraft 1.20.1 and put the jar into mods (needed on client and server).
  2. Find wild flies by day in plains, meadows, forests or swamps, or use the FlyBrain spawn egg (Creative tab "FlyBrain") or /flybrain spawn.
  3. Run /flybrain debug to toggle the brain HUD for the nearest fly.

Commands

Command What it does
/flybrain spawn [count] Spawns flies in front of you
/flybrain debug Toggles the live brain HUD
/flybrain backend [id] Shows or switches the brain backend
/flybrain stats Scheduler statistics (threads, compute time, skipped windows)

Performance

Brain windows run on worker threads and never block the server tick. On a 12-thread desktop CPU, about 30 flies run in real time at the default resolution (dt 0.5 ms), and about 60 flies at the coarse setting. With more flies, brain windows are skipped rather than slowing the game, and distant flies update less often. 100 flies cost about 5 ms of server time per tick.

Data and licenses

  • Mod code, model, textures and sounds: MIT.
  • Bundled connectome subnet: derived from MaleCNS v1.0 (Janelia FlyEM and partners), CC-BY 4.0. The attribution is shown in game and in ATTRIBUTIONS.md.
  • FlyWire: FlyWire data is licensed CC BY-NC 4.0 and is not included. You can build a FlyWire subnet locally with the included tool and load it for yourself.

References

  • Shiu, P. K. et al. (2024). A Drosophila computational brain model reveals sensorimotor processing. Nature.
  • Takemura, S. et al. / Janelia FlyEM (2024). MaleCNS connectome v1.0.
  • Muijres, F. T. et al. (2015). Body saccades of Drosophila consist of stabilized banked turns. J Exp Biol 218, 864.
  • Tammero, L. F. and Dickinson, M. H. (2002). The influence of visual landscape on the free flight behavior of the fruit fly. J Exp Biol 205, 327.
  • Reynolds, A. M. and Frye, M. A. (2007). Free-flight odor tracking in Drosophila is consistent with an optimal intermittent scale-free search. PLoS One 2, e354.
  • Mongeau, J.-M. and Frye, M. A. (2017). Drosophila spatiotemporally integrates visual signals to control saccades. Curr Biol 27, 2901.
  • von Reyn, C. R. et al. (2014). A spike-timing mechanism for action selection. Nat Neurosci 17, 962.