Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser
Quick Information

This plugin allows you to drag and drop a artificial worm to your game project. The worms AI is powered by a mapped C. Elegans worm brain. How to use:Enable the plugin, create a 2d scene, add a WormNode into it, Run the project.This is a little more than a conversion from js to GD script (and Godot Node structure) from this project: https://github.com/heyseth/worm-sim Make sure to check the editor properties of the worm and customize it, I struggled a bit to make this work, so it might have issues, please report them. Check the signals the worm broadcasts as well, listen. Notes: - Worm collides with Area2D, I inform the AI that it has collided, but if it wants to go thought, it goes through. Only way to contain the worm is by setting a proper limitingArea on the editor, it is initially hardcoded to Rect (50, 50, 1000, 1000)- Worm "EATS" any Area2D that is part of a group "worm_food". You have to handle removing the food from the scene.
Worm Brain Plugin
A custom node for creating AI-powered worms in Godot Engine.
brain.gd
and weights.gd
use real mapping taken from a C. elegans worm brain (it has only 302 neurons), enabling you to simulate it in your game.
Heavily based on this project: Simulate the C. elegans worm brain on your browser.
Drag WormNode
to your scene and enjoy.
Note: Does not handle collision well, so you need to limit where it can go using an editor property.
Features
- Customizable worm behavior and segments
- Dynamic segment creation
- Real worm brain simulation
Installation
- Download the plugin from the Godot Asset Library or clone the repository.
- Copy the
addons/worm_ai_plugin
folder into your project'saddons
directory (if not done automatically by Godot). - Enable the plugin in
Project > Project Settings > Plugins
.
Quick Usage
- Add the
WormNode
to your scene. - Customize the worm's properties in the inspector.
- The worm will "collide" with any
Area2D
, and will eat any that is part of the groupworm_food
. - This worm is stubborn, so a wall is a mere suggestion to it. If you want to contain the worm, make sure to decrease the limiting rect in the inspector.
Worm parameters
limitingArea # Global area where the worm can move
segment_count = 20
segment_distance = 10
max_scale = 1.0 # The maximum scale of the worm's girth
min_scale = 0.3 # The minimum scale of the worm's girth
front_rate = 0.2 # Rate of girth increase at the front
back_rate = 0.4 # Rate of girth decrease at the back
hungry_worm = true
time_until_hungry_again = 2
time_scaling_factor = 1.0
wormBrainDelay = 0.0 # Controls the simulation speed
Communicating with the Brain
For these that want to play with the plugin code
worm.gd
controls the interface of the brain with the game world.
brain.gd
powers the brain using the weights configured in weights.gd
.
You can stimulate neurons with specific functions by enabling and disabling some flags on the brain, causing these neurons to be continuously stimulated while on:
stimulateHungerNeurons
stimulateNoseTouchNeuronsLeft
stimulateNoseTouchNeuronsRight
stimulateFoodSenseNeuronsLeft
stimulateFoodSenseNeuronsRight
stimulatePheromonSenseNeuronsLeft
stimulatePheromonSenseNeuronsRight
stimulateChemicalsSenseNeuronsRight
stimulateChemicalsSenseNeuronsLeft
stimulateTemperatureSenseNeuronsRight
stimulateTemperatureSenseNeuronsLeft
stimulateOdorRepelantSenseNeuronsRight
stimulateOdorRepelantSenseNeuronsLeft
The worm has 4 sensors (CollisionArea2D
), 2 for each side. They all are part of the same sensor
group; the worm knows to ignore these.
2 big ones represent smell sense, and 2 others represent touch. Collisions with these sensors activate the corresponding neurons.
License
This project is licensed under the MIT License.
Acknowledgements
This project is heavily based (it is basically a port to Godot) on the worm-sim made by Seth Miller.
Huge thanks to him for sharing that online.
This plugin allows you to drag and drop a artificial worm to your game project. The worms AI is powered by a mapped C. Elegans worm brain.
How to use:
Enable the plugin, create a 2d scene, add a WormNode into it, Run the project.
This is a little more than a conversion from js to GD script (and Godot Node structure) from this project: https://github.com/heyseth/worm-sim
Make sure to check the editor properties of the worm and customize it, I struggled a bit to make this work, so it might have issues, please report them.
Check the signals the worm broadcasts as well, listen.
Notes:
- Worm collides with Area2D, I inform the AI that it has collided, but if it wants to go thought, it goes through. Only way to contain the worm is by setting a proper limitingArea on the editor, it is initially hardcoded to Rect (50, 50, 1000, 1000)
- Worm "EATS" any Area2D that is part of a group "worm_food". You have to handle removing the food from the scene.
Reviews
Quick Information

This plugin allows you to drag and drop a artificial worm to your game project. The worms AI is powered by a mapped C. Elegans worm brain. How to use:Enable the plugin, create a 2d scene, add a WormNode into it, Run the project.This is a little more than a conversion from js to GD script (and Godot Node structure) from this project: https://github.com/heyseth/worm-sim Make sure to check the editor properties of the worm and customize it, I struggled a bit to make this work, so it might have issues, please report them. Check the signals the worm broadcasts as well, listen. Notes: - Worm collides with Area2D, I inform the AI that it has collided, but if it wants to go thought, it goes through. Only way to contain the worm is by setting a proper limitingArea on the editor, it is initially hardcoded to Rect (50, 50, 1000, 1000)- Worm "EATS" any Area2D that is part of a group "worm_food". You have to handle removing the food from the scene.