Evolving Node Creatures

Today I just want to showcase a program I wrote, er, soon to be half a year ago. It is perhaps the clearest example of how evolution works.


This is a node creature. It consists of nodes - the grey circles - and muscles, which are the lines connecting the nodes. All nodes are not connected to each-other.

The node creature lives in a physics-world, where all nodes are pulled downwards due to gravity, and where the nodes collide with the ground, keeping them up. There is also air friction, and a higher friction on the ground (depending on how much force pushes the node into the ground).

Apart from these natural forces, the creature can exert force through its muscles, which from time to time either contract or expand, pushing its two nodes apart or together, though this is not an instant effect. Even weaker, the nodes exert pressure on the muscles to keep them at roughly the same angle-distance to each-other at all times.

Gravity kicks in after a few seconds

The node creature therefore has three kinds of information in its genome:

  1. Its shape (number of nodes and which nodes are connected by muscles)
  2. The angle that the nodes prefer its muscles to be
  3. The times at which each muscle expands or contracts
How these three bits interact determine how well the creature is able to move rightwards. Because that's the only goal of a creature. To move rightward.

The further right a creature moves, the higher its chance of survival. After a hundred creatures have been simulated, all that went further than average survive, while the rest die, being replaced by mutated versions of the survivors.


While the previous .gif showed a creature just a couple of generations in, this one is taken from generation 89. It has become a lot better at moving rightwards. It has really learnt how to tumble.


But evolution continues. Though the benefits do flatten out over time, 250 generations later, the average creature moves almost twice as far.

All three above creatures come from the same evolutionary line. What makes this project so succesful is that this is just one of a thousand possible solutions. With the same physics and just different starting creatures, we instead get this creature:



Er, I think this is the first time I see the program unable to find a good solution. At least it is, as I promised, different.

Comments