Evolution - a demonstration

Soldato
Joined
18 Oct 2002
Posts
3,926
Location
SW London
I've always been interested in evolution and natural selection and the other day I thought I'd create a little program to see natural selection in action.

Basically there are a number of creatures in the world (represented by coloured blobs) and you are the predator and you kill them by clicking on them.
Every so often they reproduce and have a set probability of mutating.

Take a look and see for yourself, it's pretty impressive how quickly they manage to evolve and become successful at evading you!

Download here
It needs the .NET 2.0 framework to run and comes with a configuration file that lets you change various parameters.
Just extract the files and make sure the .config file is in the same folder as the app.

It's very much a work in progress at the moment, I plan on extending it at some point so any suggestions are welcome.
 
They all just seemed to get stuck at a couple of spawn points and stopped moving

You obviously evolved a useless bunch then :p

The fewer creatures there are in the world the more repidly they breed, so clicking on the ones that aren't moving will make it more likely that others will breed.
Obviously there is a chance that all of them could evolve not to move and that's when the become extinct by the predator killing them.

I understand the idea, but it's not very clear how it shows evolution to me.
This is really showing natural selection to be strict
http://en.wikipedia.org/wiki/Natural_selection

Basically they mutate randomly and some of them will become easier to click on (and hence kill) and some will become harder to kill.
The ones that are harder to kill are more likely to breed and take their characteristics to the next generation.
After several generations they will likely be significantly harder to kill than the first generation.
 
Last edited:
I assume the natural selection itself didn't actually require any programming at all, am I correct? It's interesting to think you could easily introduce more inherited variables and that they would then also play a role in the natural selection process, without any need to modify any algorithms. For example, if colour was inherited from previous generations, then you'd probably end up with lots of lightly coloured, difficult to see blobs if you played for long enough (and presumably all white eventually, making it impossible even to see them).

Indeed you are.

When the creatures reproduce all that happens is a few variables randomly change.
At the moment I've coded it to vary:
colour, maximum speed, size and randomness (essentially whether they follow a straight line or move about randomly)

If the random change means they're harder to hit the chances are they will become more successful.

At the minute it's pretty unlikely for them to end up all white as they colour can change quite a bit for each generation so, while they will generally move towards the background colour even if you have some white ones their offspring could be quite brightly coloured.

Still can't connect. :(
Obviously my web host doesn't like you!
It seems to be OK from here.
 
Okay either I am really slow or these guys are born too fast! I have played twice and in both cases I never get close to killing them all so unless they all suddenly get the Suicide Gene I could never hope to wipe them out, regardless if they get faster or not.

Remind me of mice. They're pretty much food on legs, but there are such a lot of them it is not a problem.

The aim isn't to kill them all, it's to see the effects of natural selection.

For instance I started one instance and tried to kill anything that wasn't black.
After a while I ended up with loads of dark creatures which were really fast.

Similarly when I tried to kill the dark ones they became light really quickly, but didn't become much smaller or faster.
 
Not sure why it's not working for certain people - I've uploaded a version of it here for those who couldn't get it working from my webspace.
http://www.mediafire.com/?1mx7l1jmmxi

I've also got a few new features that I plan on adding to it, including:
Predators in the world (who also evolve)
Food - those that don't get to the food will die
Logging of data to see how the creatures evolve: things like average size, average lifespan etc.
Possibly different genders and breeding based on certain attractiveness criteria?

I just need to get some time to actually work on it!!
 
If i left the black ones and killed the colour ones then should Natrual Selection take its course by not growing anymore coloured ones?

If the coloured ones get killed quickly then only the black ones get the chance to reproduce.
These could still produce coloured offspring through mutation, but not as likely as if a coloured one reproduced.
 
Yea I tried it too. It's not exact to genetics from what I can see or there are tons of mutations. Still a fantastic program though.

You can change the mutation rate in the XML config file.
By default there is a 60% chance of a mutation happening each time one of them reproduces.
Obviously this is far more than you would see in real life, but it would take days to see anything otherwise!

I can put the source code up if anyone's interested.
At work at the moment, but I'll see if I can remember later.
 
For those that were interested the code is available here:
Link



Yea that may help, the thing I was thinking about is that you wipe out a certain characteristic and then it just mutates back straight away.

Well, the mutations are random so you can never truly stop something mutating again.
It's probably more obvious in my demo as there are only a few things that can mutate so it seems like the same thing is happening over and over again.
 
Back
Top Bottom