Chase/Evade

The simulation of evolution is lots of fun, download something I've been playing with (here's the source, enjoy). Inspired by discussion on the Primordial Life mailing list, this little program tries to evolve behaviour, using an action matrix. Erwin Acherman has contributed towards its development.

Here's a little screenshot of a corner of the world, showing the creatures. They can't change their appearance but each segment can see a short distance and this guides their actions. In a very similar way to Primordial Life (PLife) the red segments give the creatures energy if they hit a green segment on another, who loses energy. I use size to give an indication of how much energy the creature has:

The little creatures work out that certain responses to stimuli give them food, they learn to attack each other. After ten thousand or so generations they typically evolve to attack when they see food, run away when they see danger. Later they learn that if they turn round at a crucial moment they can protect themselves. By a hundred thousand generations they evolve the behaviour of combined turning and moving to nip around behind an attacker and attack them back! They all catch on to this great idea and soon they are all pirouetting about each other.

In the screenshot below you can see a couple of groups circling each other with their red segments pointing inwards:

All this behaviour with just a simple weighted matrix connecting 16 stimuli to 10 output responses. The matrix is shown in the screenshot as a grid of red and blue squares, red representing positive firings (if input x then output y would be a good idea) and blue representing negative firings (if input x then output y would be a bad idea).

The 16 inputs are 'see red' / 'see green' for each of the 8 arms of the creature. The 10 outputs are 8 'move forward' commands (one for each segment) plus rotate left and rotate right. See the source for more information.

You can add feedback to the matrix with extra rows and columns but I've yet to spot them taking advantage of these 'moods'. Theoretically this gives them real intelligence, should they know what to do with it.

Play with the program, let me know what your creatures end up doing.

<< back to Tim's Evolution page