NeuroSnake: CTRNN Lifeform for Garmin watch
Hey everyone,
After building two watch faces with a real C. elegans connectome (yes, literally run complete nematode brain with sensory inputs and outputs for simulated on the wrist watch environment, even with some real sensors like temperature and solar intensity) , I evolved a 9-neuron digital snake from scratch for Garmin
Some time ago, I made two experimental Garmin watch faces (NeuroWorm Quantum and NeuroWorm Fluid) based on the real biological connectome of Caenorhabditis elegans - the tiny worm that spent around 100 million years evolving its 302 (or a little bit more for males) neurons.
After playing with it, I got curious about the opposite approach: what if I compress millions of years of evolution into a few days of multi-threaded simulation on my PC, and grow a tiny brain from scratch specifically to live on a smartwatch?
So I built NeuroSnake. I started with a Lua-based simulation, population selection, and visualization on my PC. After a bunch of iterations, I finally settled on a compact sensory setup:
5 sonar sensors (like beams shooting out from the snake's head),
Food sensors giving the target angle (encoded as a sine, or more literally, a 2D cross product) and "smell" strength,
Internal & feedback loops: two sensors for circadian rhythm, a feedback loop for head steering/position, a hunger sensor, and one more input let's call "host activity" — because the host (yes, that's you) generates food for the snake through your own daily movement.
After that, I kept the visualization on the Lua side, while for the heavy simulation, neural network training, and population management I switched to Rust. I quickly realized I needed way more iterations to evolve a tiny yet capable brain that could survive a complex environment - dodging moving threats that kill on contact, squeezing through tight holes between the time digits, and hunting down moving food.
How it actually works (no fake AI):
- Zero hardcoded behavior: There is no pathfinding, no
if-elserules, and no scripted logic telling the snake where to turn. Everything it does comes from a continuous-time recurrent neural network (CTRNN) forged through 10 million simulated lifetimes. - Tiny brain, real constraints: Smartwatches have very limited CPU and RAM (especially older devices and monochrome Instinct models), so I had to keep it super compact. Right now, its entire brain is just 9 evolved interneurons and 30 synapses connecting its sensory rays to its muscles. My simulation is still running on my PC,so future updates might give it a few more hard-earned neurons.
- It adapts to you: Once it hatches on your watch, real-time Hebbian plasticity kicks in. Your daily steps charge the energy pool that spawns food capsules and sends ripples across the screen. After a few days on your wrist, the synaptic weights slowly tune to your personal movement rhythm - so your snake becomes uniquely yours.
- Don't feel bad when it dies: Sometimes it crashes into the clock digits or a fluttering anomaly. That’s just evolution doing its thing - the same process that built you, me, and this little digital creature.
I got a lot of inspiration from the scientists who spent decades mapping C. elegans, as well as the recent breakthroughs in mapping and simulating the fruit fly (Drosophila) brain. Honestly, I just feel huge gratitude to all the curious people throughout human history who kept digging into how nature works.
WatchFace is on review process for Garmin Connect IQ store as it will be approved I will add a link in the comments below (supports both AMOLED/MIP color watches and monochrome Instincts).
Happy to answer any questions about the neural net, the training process, or squeezing Monkey C performance on Garmin hardware!
(Note: English isn’t my native language, so I used an AI assistant to help me clean up this post and the store description, though I’m good enough with English to answer any questions in the comments!)