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:
Very interesting :)

For those unconvinced: start two instances of the program and leave one running, then in the other, start killing them off. Compare the two after a while: the undisturbed one will have mostly slow, easy to kill blobs. The second one, however, will have mostly fast, small, difficult to kill blobs because they're the ones that have survived your clicking and gone on to reproduce, giving rise to more of them.

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).
 
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.
 
hm... but the chances of hatching a mutated "thing" which has absolutely all the benefits of the others + a mutation that will guarantee longer life = slim chance.

and then the likeliness of it re-breeding the same mutation into others which have as good as, or better attributes of the rest of the mob is unlikely.

and then the time taken for this to transcend the whole entire species...for each minor mutation...

leads me to conclude that evolution is not the solid theory it was?
 
hm... but the chances of hatching a mutated "thing" which has absolutely all the benefits of the others + a mutation that will guarantee longer life = slim chance.
Well each creature that hatches has the same properties as its parents by default, but there's a chance that it'll mutate during hatching and one of the properties will change slightly (for better or worse).

Nickg said:
and then the likeliness of it re-breeding the same mutation into others which have as good as, or better attributes of the rest of the mob is unlikely.
Again, each creature has the same properties as its parents by default. This is how reproduction works, and is the basis of natural selection. If the properties of a creature were randomly selected at birth, you'd get weird things happening like cats giving birth to sharks and pigeons, etc.

Nickg said:
and then the time taken for this to transcend the whole entire species...for each minor mutation...

leads me to conclude that evolution is not the solid theory it was?
Well, the probability of a beneficial mutation occurring and then going on to propagate through the entire species is small, yes, but then that's why evolution takes such a bloody long time in the real world :)
 
Interesting, for me they all seem to be turning very light colours after a bit so are harder to see on the background. Pretty funky.
 
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.
 
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.
 
There is one way to kill them all, if your that way inclined.

Kill anything that moves and let anything that doesn't live. Eventually you'll have a screen of about 3 packs of non-movers. You should be able to kill them all in 3 clicks if your quick. The first time I did it I killed the first two packs but just as I was about to get the third, they all did a runner.
 
Back
Top Bottom