Nematode.farm is a simple WASM and SDL2 based game utilizing simulations of the C. elegans nematode as the 'opponent' artificial intelligence.
This project started as a visualizer/development tool to complement my work on the nanotode C. elegans framework and the nematoduino robot (in fact the worms in nematode.farm follow almost exactly the same motion logic as the robot).
But when I realized I could also turn it into a dumb little game, I thought, "Why the heck not?!" And so, here we are.
Assuming the role of the mighty Teal Worm, your objective as a player is to push all the wandering red and blue worms into their respective pens before the timer runs down.
Compete with your friends! Compete with yourself! Just chill out and watch the damn worms! It's all up to you.
Arrow keys move the player worm forward and backward, and steer it left and right. Escape exits to the title screen.
"So, what are the AI worms doing?" is probably one of the first questions that come to mind here.
Well, most of the time the worms are having their "chemotaxis" neurons stimulated ("chemotaxis" is a fancy worm-science word for "wiggle around and look for food"), so by default they're on kind of a random walk around the screen.
But whenever they bump into a barrier, or another worm, they get their "nose touch" neurons stimulated, which should cause them to reverse direction quickly. Graphically, whenever you see a worm's "nose" light up, its nose touch neurons are being fired.
If you'd like more details on how I interpret the signals from the simulated nervous system of the worm into motion, check out the README on the nematoduino GitHub.
The title screen of nematode.farm gives you the option to press [V] to display a readout of the muscle/motion state of the worm on that screen.
The visualization shows the state of each muscle in the worm, as well as the left and right components contributing to its motion, which are entirely analogous to that of the nematoduino 2-wheeled robot.
Closely Related Projects by This Author
A framework for running lightweight simulations of the C. elegans nematode's nervous system. Forms the core of the simulation seen in nematode.farm.
An Arduino UNO-compatible robotic simulation of the C. elegans nematode. Also employs nanotode as the core of the C. elegans simulation.
Acknowledgements and References
The OpenWorm Project
Notes: The reason any of this happened; source data for my neural net comes from their GitHub
Article: Extending the C. Elegans Connectome to Robotics
Notes: The project that got me excited about C. elegans in the first place!
Busbice, T., Garrett, G., Churchill G.
GitHub: GoPiGo C. elegans Connectome Code
Notes: The jumping-off point for my work
YouTube video: C. elegans brain and body simulation
Notes: Inspired me to make my own similar project. The idea to show muscle states was wonderful! Thank you, sir!