Colourful Creatures and Genetic Drift

If you played Species 0.5.0, you may have noticed an evolutionary bias towards brightly coloured creatures over grey, black or white.

If you’re thinking entirely in terms of natural selection, this might seem odd: colour is a completely neutral mutation in 0.5.0. There is no selection pressure related to colour. No, not even a hidden special one I haven’t told you about. Colour does not affect their survival or reproduction in any way.

And yet the creatures consistantly evolved from grey to bright colours. Why?

This is where an evolutionary mechanism known as Genetic Drift comes into the picture.

For a value that randomly mutates or ‘wanders’ in a single dimension, Genetic Drift has a fairly negligible influence. As you can see below: the wandering line hovers around it’s original horisontal position. It can still wander fairly significantly, but simple statistical pressure mimimises the effect of drift:

Image

The same does not apply for a value that wanders in two dimensions. A value wandering in two dimensions is unlikely to return to it’s starting point, because when it does both the wandering x and wandering y co-ordinates have to be there at the same time. This rarely happens.

Image

This effect increases with every dimension of wandering: if you allow the point to wander up and down as well, it’ll will move away from it’s starting point even faster. And for a creature in Species, with a genome of almost 100 different values or ‘dimensions’, this statistical bias exerts is a very strong pressure.

And this is where things relate back to colourful creatures. Colour is represented in computing terms by 3 values: red, green and blue. Each of these values mutates randomly. In order to get a monochrome colour like black, white or any shade of grey, these three values all have to pass through the same spot at the same time. As said before, this rarely happens.

Image

So the end result is that even with no selection pressure applied, genetic drift causes continual change towards brighter, more distinct colours.

Image

Genetic drift doesn’t get the attention that natural selection does in textbooks and introductory curriculum (afterall, ‘things diverge statistically’ is hardly as memorable a concept as ‘survival of the fittest’), but in reality a lot of the biodiversity in the world is likely more attrituable to genetic drift than to selection pressures. Selection pressures only provide traits that are strictly functional in the creatures niche: simpler neutral mutations like differing plumage and skin colours, facial features, fur growth patterns and so on are almost certainly the result of genetic drift.

The two aren’t so easily distinguished from each other, though. They’re intertwined: genetic drift is a statistical effect of random mutation, which means it provides the raw material for natural selection to work with. If Evolution were a games industry, genetic drift would be the indie developers who put out loads of crazy original idea’s, while natural selection is the AAA industry who rarely contribute new idea’s but do take the best idea’s and refine them to be even better.

Genetic drift also provides an interesting counter point to the common anti-evolutionist claim that “natural selection reduces information”. The common answer to this claim is that mutation increases information, which is true, but doesn’t tell the whole story: as you can see in the first example above, is mutation was a simple, 1-dimensional measure it would only provide small amounts of new information. Genetic drift makes up the difference by providing new combinations of information, and is a major contributor to rapid evolutionary effects like Punctuated Equilibrium.

Oh, and a note about Species: Genetic Drift in Species has a tendency to drown out Natural Selection. If you reduce the Mutation Rate, you’re likely to see much more in the way of selection pressures.

With all that said…

The bright colours looked garish and kind of ugly. They didn’t look natural at all. But as I said in the comment thread this came up on, it would be go against my design philosophy to ‘fix’ the issue. The bright colours are a valid result of Genetic Drift: applying counter-biases towards less bright colours would amount to me preprogramming my own preferences into the simulation.

There’s another option, though:

The RGB representation is unnatural in and of itself. In nature, pigmentation is handled by chemical compounds of certain colours that are pushed to the surface of the skin. A chemically-accurate pigmentation simulation is beyond even my level of bio-programming masochism, but the point is that there is more than one way to represent colours: we’re not necessarily locked into using RGB.

An alternative solution is storing colours as Hue-Saturation-Luminosity. This would mean the genetic drift would seem less directed: similar numbers in HSL would still be less likely than differing ones, but they don’t have any sort of correlation to a specific tone or shade.

Image
[On the left: RGB Randomised Colours. On the right: HSL Randomised Colours]

As the test above shows, randomised HSL colours have a much higher incidence of desaturated black, white and grey’s, and in general look a lot less circus-y and a lot more natural than the equivalent randomised RGB palette. HSL randomisation can still generate bright colours, but they’re less common.

Of course, there are always going to be problems. The increased incidence of black makes it difficult to make out body texture on quite a few creatures in the game, for example. But that’s something we can deal with via graphical upgrades, like gloss mapping.

0.6.0 uses a hue/sat/lum shader, and even though the difference is subtle, it’s noticeable if you’re looking for it.

Cheers,
Qu

Advertisements

, , ,

  1. #1 by Fjonan on June 27, 2013 - 3:55 pm

    In nature color does play a role. Camouflage against captors or attraction for potential mates. That would integrate the color into the evolutionary process, wouldn’t it?

  2. #2 by localSol on June 27, 2013 - 4:36 pm

    Good choice with Hue-Saturation-Lightness !
    Isn’t it comfortable? There are more human-comfortable color models supposedly but the conversions to and from RGB didn’t seem comfortable to me. Either way, best luck to you.

  3. #3 by WellOiledProf on June 29, 2013 - 2:07 am

    Thanks for explaining the colour drift process in such detail; I have mistakenly been increasing the mutation rate to high levels in the belief that it would produce beautiful more natural coloured creatures at high speed. So to get this straight: Low mutation rates would tend towards more “rounded” natural colours and parents that look more like their children (and generally a more genetically homogeneous species)?

  4. #4 by WellOiledProf on June 29, 2013 - 2:11 am

    Also the game very occasionally crashes and the frame rate can be very low (my computer isn’t great); which settings would you advise to increase performance most while allowing a large number of creatures on screen at once?

  5. #5 by contusionas on September 12, 2014 - 6:52 pm

    hello there and thank you for your information – I
    have certainly picked up anything new from right here.
    I did however expertise several technical points using this site, since I experienced to reload the website many
    times previous to I could get it to load properly.

    I had been wondering if your web hosting is OK? Not that I’m complaining, but sluggish loading instances times will often affect
    your placement in google and could damage your quality score if ads
    and marketing with Adwords. Anyway I’m adding this RSS to
    my email and can look out for much more of your respective interesting content.
    Ensure that you update this again soon.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: