• Advertisement
Sign in to follow this  

Right chaps, time to play god.

This topic is 2773 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello my fellow blasphemes.

I have three questions, but first I'll breifly summarize what I want to produce. My goal is to simulate an ecosystem of plants and animals by creating a system of evolution. So in effect, I want to run my program and end up with a bunch of plants and animals I didn't design. Eventually I'd like to use this same system in a game-context, but first I'd like to see it work.

My questions are this:

1) Where should my program begin? From cells? Basic life? Fully fledged species?

2) How should the 'genes' work? And the mutation?

3) Finally, does anyone know any example of this being done before that I could look at for reference?

Thanks for your time. I feel this would be a really interesting project and I'd love to manage it.

All help appreciated and all that.

Share this post

Link to post
Share on other sites
if you only want plants and animals, I'd start with existing plants and animals. I'd make a list of all the shapes of bodyparts used by existing creatures. Then from that you want to extract a genetic system which will give you that array of parts, and tell you how to put them together. It doesn't have to be like real genetics - I personally like games which use a monoploid genome, which eliminates recessive and dominant genes.

Share this post

Link to post
Share on other sites
Thanks for the reply, Sun.

That's not bad at all as a starting point. It's likely that I'll choose to follow this line of doing things. What I want to accomplish in the end though is to have creatures evolve in strange ways and do things I don't expect them to do. In other words, I'm not sure how to deal with behaviour and senses.

Share this post

Link to post
Share on other sites

The design I am describing has these parts:
o Classification of organism subsystems
o Format of the Genome and its mutations
o Laws

Classification of Organism Subsystem

I think you can set the line of abstraction at the level of an organism subsystems. For each organism, I think you can have these common mutable subsystems to describe each organism:

o Digestive system. This system determines what the organism can digest
o Energy storage system. This determines how much energy it can store
o Muscular system. This determines how strong and how fast it can move
o Sensory system. This determines how far and what it can sense
o Control system. This determines what it will try to eat, avoid, grow, and mate
o Add more if you want

The Genome and its Mutations

Each gene of the organism can be interpreted as a property for 1 or more systems. In the game, a gene is a string of bytes. A gene is like this:

[ one system byte that starts with 00 ]-[ n information bytes ]

The properties of the organism is determined by scanning through its genome, and interprets the first few genes for each system that it encounters. If the genome contains multiple genes for a system, the organism will only use the first few that it reads, and ignore the rest of the genome.

Mutation operations include:
o Bit flipping.
o Bit shifting
o Byte swapping
o Byte reversing
o Byte shifting
o Byte insertion
o Byte removal
o Add more if you want

Each system has its own way to interpret a gene. All interpretable gene must have a SysByte and at least one InfoByte.


Digestive System SysByte = 0000 0001
A valid Digestive System gene has five InfoBytes. The first byte specifies the minimum temperature for the organism to digest. The second byte specifies the max temperature. The third InfoByte is a number that specifies what material the organism can digest. The fourth InfoByte specifies the amount of material it can consume per day. The fifth InfoByte specifies the the amount of energy it gets for each unit of digested material.
[0000 0001][Min Temp][Max Temp][Material ID][Consumption Rate][Energy %]

Energy Storate System SysBute = 0000 0010
A valid gene for this system has five InfoBytes. The first specifies the minimum temperature for the organism to survive. The second specifies the max temperature. The third specifies the max energy the organism can store. The fourth specifies the base energy loss of the organism. The fifth specifies the percentage of energy given to an offspring.
[0000 0010][Min Temp][Max Temp][Max Engy Strg][Base Engy Loss][Offspring Engy %]

... and so on

Universal Laws

These are meant to be a set of universal laws that governs all organisms. For example, you could have a law that determine how the size and content of the organism's genome relates to the organism's physical size and appearance.

This is the part where you could include what Sunandshadow is saying. For example, if the organism contains a muscular system gene that specifies that the organism can fly, then the laws would draw the organism with wings.

I can talk more if you are interested in coding it at this level.

Share this post

Link to post
Share on other sites
Wai. You are a Darwin among men.

Your genome explanation really cleared things up for me. Thank you. I feel a lot more confident about beginning the project now, which is probably the most important thing for its completion.

It'd be great if you go into more depth. I'd like to hear more of your ideas on this subject.

I'd still really like to hear if this kind of thing has been done before if anyone's come across such a thing.

Share this post

Link to post
Share on other sites
A minor improvement to the examples: Instead of [max temp] have [temp spread]. This prevents meaningless cases where min is greater than max.

Share this post

Link to post
Share on other sites
Original post by Threads

I'd still really like to hear if this kind of thing has been done before if anyone's come across such a thing.

Closest I've seen to what you're talking about is in Star Wars Galaxies. They have a process in which Beast Masters can collect DNA strands from creatures. Equipment is needed too... an incubator unit, enzyme extractor, centrifuge, and some other stuff. They then incubate the eggs, and can either sell or hatch the egg themselves.

Beast Masters have full control over the color and combat skills of the beast. There is a significant random element to beast crafting too, including a random chance for mutations, which can improve combat stats or change the appearance of the creature being incubated. I think they have a 14 day free trial though if you want to check it out.

Can't say that I've seen anything like that for plants though.

Share this post

Link to post
Share on other sites
All of the explanations are just examples. You could modify it to fit what you want to do.

The temperature InfoBytes are for simulating the effect of habitat change and migration among other behaviors. But if you think that temperature is not a significant property of a region, you could change it to something else, like humidity, acidity, etc. I just picked temperature because it changes acorss regions.

But a principle behind the design is using one alphabet across all systems.

I think it is better to have [temp spread] as AngleWyrm said. The genome can carry meaningless genes, but I think it is better to just carry valid but unexpressed genes instead of meaningless genes.

Additional UnivLaws to Consider:

    A living organism must have at least one expressed gene for each for each system
      The longer the genome, the slower the organism grows
        The longer the genome, the more likely that a byte removal mutation will occur
          The longer the genome, the more likely that mutations will occur
            The faster an organism uses its energy, the hotter it gets.

            Muscular system

            [SysByte 0000 0100][Min Temp][Temp Rng][Movement ID][Power][Agility]

            The Muscular system determines the organism's modes of movement. A valid gene has five InfoBytes. Movement ID specifies a form of movement, such as running, grabbing, swimming, flying, bitting and also static features like horns. Each Movement ID corresponds to one or more limbs. The positions of those limbs and the shape of the organism are determined by the position of the gene in the genome and some additioanl UnivLaws that dictates how an organism grows during development:

              Muscle genes closer to the beginning of the genome grow first

              Power and Agility specify how the associated limbs can be used. They together affects the amount of energy consumed when the organism uses the movement. Higher power corresponds to denser muscles and more strength. Higher agility corresponds to having more joins, segments, or wider range or movement.

Share this post

Link to post
Share on other sites
There's a lot of research going on in this area, both here and there.. Here's an attempt at evolving virtual creatures:
Here's another:

Google "virtual creatures evolution" for some more info.

AI junkie has some nice programmers-articles on NN and mutation:

You might also want to read up on intelligent agents before setting up your model:

Share this post

Link to post
Share on other sites
Thanks for the links guys.

So Wai, how would breeding be handled in your model of things?

Share this post

Link to post
Share on other sites
I would personally separate the genetics of appearance and behavior/abilities, but it depends what your goal is. Behavior is so complicated to design on it's own, combining it with anything else is a problem.

If you want creatures to only be able to eat some other creatures, maybe you should have 20 or 40 'elements' (the periodic table ones, not earth/air/fire/water) that creatures are made out of. So your carnivore, for example, could eat three quarters of the elements in another creature, then they'd have to leave the indigestible ones there for scavengers or plants.

Behaviors, then, could require the creature to digest a certain element to be able to use the ability, otherwise the ability would be dormant.

In addition to the traits listed above, I think preferential hostility might be a useful trait - For example, humans can't eat viruses, yet we benefit from our preferential hostility toward driving viruses extinct.

Share this post

Link to post
Share on other sites
Try Googling Tierra. This is a full ecosystem, programmed by Thomas Ray, that has actual creatures, in the equivalent form to single-cell organisms. Using it, he was able to catalog every organism that was created, its genome, and the state of the world at any moment during the programs execution.

The program showed the organisms to have the ability to evolve, to better survive in an environment that had two resources, memory, and time spent on the organism. Have a look, and see if it somewhat matches what you're trying to do. Mr Ray got some surprising results, including virii that needed other organisms to be able to run.

Share this post

Link to post
Share on other sites
Very impress read on the overview Wai! :)

What is the generally idea for the game? Something like an evolution type of game play?

Share this post

Link to post
Share on other sites

The concept is that UnivLaws govern how an organism would reproduce, using variables of the Energy System. The Energy System has these variables:

[Max Engy Strg (EMS)] = The maximum amount of Engy the organism can store relative to the Base Engy Loss
[Base Engy Loss (EBL)] = The Engy the organism will lose per day just being alive
[Offspring Engy % (EOP)] = The amount of Engy the organism would dedicate for an offspring

    When an organism has way more energy that its own base engy loss and it has enough energy left to dedicate to an offspring to the base engy loss of the offspring, the organism will clone itself. (If offsprings are cheap enough and you are dedicated, just crank them out yourself.)

      When an organism's EOP does not cover the EBL of the offspring, the organism will seek the minimum number of mates to combine EOP to cover the lowest EBL among the mates that has enough EMS to cover the EBL of the both itself and the offspring. The offspring's genome contains genes from the parents. (If offspring is expensive but you have enough capacity, find mates.)

        If an organism's EMS cannot cover the EBL of itself an its offspring, it cannot carry an unborn offspring. (If you don't have enough capacity, use a mate's space.)

          If none in the group of mated organisms is a carrier, the offspring is born as an immobile object that is not alive until it is fed enough to cover its EBL. (If none of your mates have enough capacity, let it develop outside.)

            Genome is combined by listing the sorted mutated genes and use a die to choose one gene among the mates for each system. The combination process for a section stops when the die picks a mate that has no gene at the section. Example:

            Mate A Genes: A1 A2 A3 A3 A4 A5 A6 AX AX AX (10 genes)
            Mate A Genes Mutated: A1 A23 A3 A4 A5 A6 AX AX AX
            Mate A Mutated Genes Sorted: A1 A2 A3 A3 A4 A5 A6 AX AX AX

            Mate B Sorted Mutated Genes: B1 B1 B2 B3 B4 B4 B5 B6 BX BX (10 genes)

            Gene section candidates:
            System 1: (A1 or B1); (None or B1);
            System 2: (A2 or B2);
            System 3: (A3 or B3); (A3 or None);
            System 4: (A4 or B4); (None or B4);
            System 5: (A5 or B5);
            System 6: (A6 or B6);
            Meaningless Genes: (AX or BX); (AX or BX); (AX or None);

            A possible result of pairing: A1 (N) B2 B3 A3 A4 B4 B5 A6 AX BX AX
            Sorted genes of offspring: A1 B2 B3 A3 A4 B4 B5 A6 AX BX AX (11 genes)

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement