Darwinbots Forum

Bots and Simulations => Simulation Emporium => Topic started by: Peksa on May 01, 2008, 06:54:24 PM

Title: Ways to increase natural selection?
Post by: Peksa on May 01, 2008, 06:54:24 PM
Average fitness of species depends on two factors. Mutations mostly reduce fitness by breaking and mutation DNA and natural selection increases fitness, favoring those whose genomes survive better. In basic DB sim the enviroment isn't very complicated and doesn't encourage very complicated behaviour. What I'm hoping for is some simple or not-so-simple ways to encourage evolution of more interesting bots.

Off the top of my head, I can think of enabling corpse mode with low enough decay rate, adding some shapes that bots can see, running non-toroidal sim or running a sim in internet mode. Of course, creating a stable ecosystem with two or more species co-evolving would be the ultimate goal, but that's a tad hard to archieve.
Title: Ways to increase natural selection?
Post by: Numsgil on May 01, 2008, 07:11:05 PM
I have managed to get Animal Minimalis and Enitor Comesum co-evolving in an evo sim.  The alga was being fed per veggy instead of per kilobody (this was before I added the per kilobody option), so it evolved to be cancerous.  The enitor comesum just couldn't eat the veggies faster than they could reproduce.  Each veggy tended to have very little nrg, usually around 2 or 3, so the bots had a really hard time gathering enough nrg to stay alive.

Ultimately the sim died when the alga evolved a vibrating wiggle that made it difficult for the enitor comesum to keep the veggies visible.  The population for the enitors dropped to a few dozen, which wasn't enough to prevent deadend mutations and I gave up the sim.

Moral of the story is that you can get co-evolution, but you have to be willing to start with something that is evolutionarily stable.  Cancerous veggies and cannibots aren't very aesthetically pleasing, but they play well together in an evo sim, if you can afford to have 10x the number of veggies as animals.
Title: Ways to increase natural selection?
Post by: Moonfisher on May 02, 2008, 07:30:47 AM
Another way of favoring natural selecting is having a low amount of food, saw someone has evolved a very interesting bot behavior this way, can't remember wich topic.
Anyway I tryed running a similar sim, using the newest neural network base I managed to put together (Thanks to a lot of sugestions).
It only uses point mutations, and not too often, oscilating between 16 and 1/16 mutations. (Only spending a short time with 16* mutations)
I've slowly reduced the mutations and food over time.
It's a size 13 field and it has a veggy repop of 25 with 1 veggi spawning and a lower max veggy... basicaly there's always 25 veggies...
I have normal F1 costs, but I had to reduce the movement costs to next to nothing, also cut the code execution costs and set age costs to set in at 5000 cyles and increase slowly.
Everything else is standard F1 settings...
It seems like the bots have evolved a very starnge behavior when eating an alge, it spends most of the time firing in any other direction than the alge, and only feeds on the alge when it has a different speed (So if another bot is trying to "steal" the alge it tryes to kill it).
The alge doesn't last forever this way, but it does manage to get a lot more energy from the alge than if it has just eaten it right away.
It also uses reproduction as a defence mechanism... whenever it's in pain or getting shot or something (Not sure exactly whats going on) it starts to spawn several new offspring.
It also seems like some of them make a very large child if they're getting realy big while eating an alge, leaving the small parent to start over on the alge while the large child takes off... I'm guessing this makes the alge last longer as the shots from a smaller bot are weaker...
And it actualy managed to evolve balanced shell, as I had hoped. It looks like it's triggered by getting shot, it does sometimes end up eating some of the shell... but it looks like it only happens outside of combat...

The point is that the low food favors clever bots, so it promotes more interesting behaviors...
I was running a simpler version of the network (Only 4 outputs) earlyer in a sim with plenty of food, it didn't take long for almost everything to break, it was suddenly going in one dirrection at all times, traveling at max speed and shooting constantly... Oddly enough this worked very well because of the abundance of food and worked as a sort of conspec since the bots never ran into eachother...
It basicaly just formed larger waves of bots traveling side by side.
So having too much food can promote a very simple behavior...
And I would imagine a lot of the other setting you mentioned won't have a nearly as noticable effect if the food is abundant...
Title: Ways to increase natural selection?
Post by: Endy on May 10, 2008, 08:09:05 AM
Quote
Cancerous veggies and cannibots aren't very aesthetically pleasing, but they play well together in an evo sim, if you can afford to have 10x the number of veggies as animals.

Had an evobot that actually regained their conspec recognition to a degree. Had to become a full canni to get there though... I think that randomly shooting a fellow member is okay in the bot's world, but deliberatly hunting is the more destructive behavior.

Uses the oddball *.eye5 *777 *.in2 ~= to ID older species members(in2 is randomly increased, 777 is zero). I'm still trying to figure out exactly how it's working so we can make use of it. I think it might just be because of the veggies' *.in2 being zero, but I've yet to test it.
Title: Ways to increase natural selection?
Post by: Moonfisher on May 12, 2008, 01:28:45 PM
It definately seems like it's a sort of vegan conspec
Still nice though, in the bots world it's the only difference it needs to reconize at that point.

The bots in my sim don't seem to have a conspec, but they all move in more or less the same direction wich seems to make confrontations rare.
They rarely fight over anything other than an alge, since the bots recently got very good at keeping the alge alive it seems to be getting more important to be able to "steal" an alge from another bot since all the alge are usual occupied.

But what I'm realy hoping for is a predator that feeds mostly on other bots. I've seen a few bots grow big and travel in the oposite direction to harves oncoming bots. I even saw one that seemed to actualy reproduce... but they've always had some problems, usualy they just don't reproduce, and the one I saw who did had it's aim broken and shoot comands broken.
The whole neural network structure is slowly being broken down, so I'm not sure how much further I can take this thing.
I think amplification could make it more interesting, but I still think I need to make a mod to actualy generate the network gradualy if I realy want to get somewhere.
Title: Ways to increase natural selection?
Post by: Gantolandon on September 09, 2008, 01:28:58 PM
It seems that having more than two species increases natural selection.

My first simulation had somewhat mean algae (veggies, which tried to eat everything approaching), modified animal minimalis (eating body instead of energy, and growing) and a parasite. Improvement of this third species was my goal.

First I made it to attach to an organism which was turned back. Well... it weren't very successful, but a random mutation made it effective at least against the algae. Swirling in one place seemed to be a better strategy somehow, as it allowed to use the host as a morgenstern. I kept the mutated version, as it was clearly better than the original one. It still couldn't do much against animal minimalis, until I added a calming venom. It allowed to spray any organism in front of the parasite, making it not to attack this species.

Then the thing gone interesting. One particular mutation I remember was making the parasite attach not only to one organism, but virtually to anything, including their own siblings. They still sucked energy from the last organism they were attached to. A poor alga or animal minimalis couldn't do anything, as they were tied by multiple parasites. This net (or rather glue) made them unable to do almost anything. Veggies still could harness energy from the sun, but tied predators were doomed.

Then animal minimalis changed. They evolved into cannibots. Holding glue became a nice source of food for a short time, and they still could eat plants. Their reproduction slowed somewhat, but it were not a problem, as I somewhat castrated them earlier (in other simulations they were annoying me with rapid growth, so I culled their reproduction to 50 specimens). Parasites were in peril again.

Unfortunately, it was not a stable ecosystem. When I were in the kitchen, the plants somewhat eliminated everything. I still don't know how they did it...  
Title: Ways to increase natural selection?
Post by: Peter on September 09, 2008, 02:07:25 PM
Welcome to the forum.

Making stable sime with more then 2 species is kind of hard. Mostly after a time, one of the two species will extinct.
I gues this is becouse of that the enviroment in most sims is pretty simple and there is only one food source. Good you managed to do so.
The only reason algea could kil the others could be that they became carcerous. If you're using a sim where every algea gets a certain amount of nrg instead of kilobody, they could get as a group more energie this way and it means that it will get harder for preditors to get more nrg.
Title: Ways to increase natural selection?
Post by: Gantolandon on September 09, 2008, 04:34:23 PM
Thanks for the welcome

Nope. I used the sun model. I have seen cancerous algae only once. It's animal minimalis which become cancerous very often (which make me furious).

I certainly would like to know how to do a stable simulation... Even with two species the plants usually live only because of forced respawn...
Title: Ways to increase natural selection?
Post by: EricL on September 09, 2008, 06:32:00 PM
Welcome Ganto...

I tend to be a broken record on this subject, but part of the problem is our notion of "species".  Hand-authored bots of the same "species" only respect one another (presenting the illusion of a species) because they are coded to do so, but in reality, they are not a species in the sense that we use that term for sexually reproducing organisms, even on the first cycle when they all have the same exact genome.    Recognition of likeness for the purposes of reproduction is meaningless in asexually reproducing populations.   There is no gene flow between them except for direct line of descent.  It's little wonder that hand-coded bots in an evo sim go cannibalistic in short order.  Selection favors this since it conveys such a huge advantage to the first bot to violate the fragile and artificial (from selections point of view) conspec code.  

In evo sims, after a while, what appears to be a single species is in fact several (or better yet, hundreds) as the hand-coded conspec code breaks down and new systems evolve.  In an asexually reproducing population, the whole notion of species is suspect and may not even be relevant.  Sure, it helps to be able to recognize your offspring and not eat them, but families do not tend to group or otherwise remain in proximity and there are much easier ways for selection to avoid eating your young than conspec code.   One common way is simply not to eat (or not to be very effective at eating) heterotrophs at all.   There is no need for conspec recognition at all in a population of asexually reproducing herbivores.  All that is necessary is autotroph recognition and even then, it need not be explicit.  It could be as simple as just being a really really bad feeder when it comes to feeding upon others of similar genomes.  You may try to shoot or tie feed off your offspring or parents, but because you are so ineffective at it (they have slime or shell or similar) at least when you try it against others of similar genomes, the only things you end up really feeding off of are dumb plants.

Our genomes are too simplistic, our sims too small, our environments too simple.  There is little need for coordination between individuals and thus little reason for a bot to recognize others it might be related to as long as there is some mechanism at work, no matter how crude (like being a bad feeder) that serves to favor others of similar genomes.  

So, in most evo sims, I suspect there is more diversity then one might expect.  I have seen larger sims maintain independent families or "lines of descent" (a better term IMHO than "species" in asexually reproducing populations) for 100's of thousands of cycles.

You might try forking the species (use the Make New Species option) occasionally starting with the "Best Bot" and see how long the different families co-exist.  Family lines will eventually die out at some point as they get competed, even if families do not directly prey on one another, but you might find this takes much longer than you think.  These different families, while they co-exist, can be thought of as different species if you like since there is no gene flow between lines of descent (absent viruses).  

FYI, I will likely automate species forking in a coming version.
Title: Ways to increase natural selection?
Post by: Peter on September 10, 2008, 07:54:06 AM
I gues that if you hava a big enough sim you can keep multiple species for a long time. I zerobot-sims I had it have happening multiple times that there came multiple zerobots at some idea of 'reproducing'. It is somewhat annoying that they almost always just randomly write in their memory till they hit .repro.
Title: Ways to increase natural selection?
Post by: ikke on September 10, 2008, 08:49:51 AM
Quote from: Peter
It is somewhat annoying that they almost always just randomly write in their memory till they hit .repro.
Evolution is about probabilities of succes: out of all the possible combinations of BP that allow for reproduction how many include .repro? Empirical answer is that the proportion of .repro in the total space of possibilities is small

Quote from: EricL
FYI, I will likely automate species forking in a coming version.
Like the idea. Would it (ideally or eventually) include .myspecies or just the interface?
Title: Ways to increase natural selection?
Post by: Peter on September 10, 2008, 12:10:58 PM
Quote from: EricL
FYI, I will likely automate species forking in a coming version.
Well, I like the idea, if I am not wrong this was on your list for quite some time. Is there a global timeline for when anything what you stated is on the list could be finished. I believe you're pretty much filled in with suggestions and bug-fixes.
Title: Ways to increase natural selection?
Post by: Gantolandon on September 10, 2008, 03:32:21 PM
Quote
FYI, I will likely automate species forking in a coming version.

That would be a great idea.

Quote
One common way is simply not to eat (or not to be very effective at eating) heterotrophs at all. There is no need for conspec recognition at all in a population of asexually reproducing herbivores. All that is necessary is autotroph recognition and even then, it need not be explicit. It could be as simple as just being a really really bad feeder when it comes to feeding upon others of similar genomes. You may try to shoot or tie feed off your offspring or parents, but because you are so ineffective at it (they have slime or shell or similar) at least when you try it against others of similar genomes, the only things you end up really feeding off of are dumb plants.

Sounds good. It's just hard to do this, when the population begin to die out too fast. I tried divine interventions, but there were not much I could do. And the plants doesn't have any chance to evolve into something really useful, as they doesn't have to with their veggie state.

Perhaps it would help if there vere a command to turn off/on veggie state in the organism? It would require a gene to harness energy from the background. Having it as an option seems to reduce the plants' potential.
Title: Ways to increase natural selection?
Post by: Peter on September 10, 2008, 03:42:00 PM
Quote from: Gantolandon
Sounds good. It's just hard to do this, when the population begin to die out too fast. I tried divine interventions, but there were not much I could do. And the plants doesn't have any chance to evolve into something really useful, as they doesn't have to with their veggie state.

Perhaps it would help if there vere a command to turn off/on veggie state in the organism? It would require a gene to harness energy from the background. Having it as an option seems to reduce the plants' potential.
Veggies if they tend to survive depending on your sim(if they are just inside the sim becouse a repop it won't), they tend to evolve ways to escape their attackers. In IM there where some good examples of that.

Edit:
Oh, jep my point. If they get the chance veggies evolve too. Evolution just stears them another way.
In some situations I could see some use from of repoping of heterotrophs.

How possible would it be to add another tab to DB where hetrotrophs can repop when they died out?

Anyway, if I recall there where some ideas to make the line between veggie/normal bots some blurrier. So veggies would be able to evolve into bots and the reverse. That came into multiple practical problems.
Title: Ways to increase natural selection?
Post by: EricL on September 10, 2008, 04:02:24 PM
Quote from: Gantolandon
Sounds good. It's just hard to do this, when the population begin to die out too fast. I tried divine interventions, but there were not much I could do.
Attempting to create a stable, mature, multi-species evo-sim using hand-coded bots as a starting point is the very definition of intelligent design and creationism.  It should not be surprising that it doesn't work.  Complex eco-systems are the end result of long long long periods of evolution and co-evolution.  It extremely difficult if not impossible to create something sophisticated and balanced like this out of thin air using authored organisms.  

Evolving a balanced evo-sim takes lots of time.  If you start with anything other than zero-bots, then the sim has to get simpler before it can get more complex.  What I mean by that is that all that useless, hand-authored logic (useless in the eyes of selection) has to be evolved away before selection can really begin to evolve real complexity and diversity of species.

Title: Ways to increase natural selection?
Post by: Gantolandon on September 11, 2008, 10:08:11 AM
Quote
Attempting to create a stable, mature, multi-species evo-sim using hand-coded bots as a starting point is the very definition of intelligent design and creationism. It should not be surprising that it doesn't work. Complex eco-systems are the end result of long long long periods of evolution and co-evolution. It extremely difficult if not impossible to create something sophisticated and balanced like this out of thin air using authored organisms.

Well, I don't hope for creating a stable ecosystem with hand-coded bots. I just would like to know what can I do in case of massive dying out of the entire ecosystem. Or an interesting "species". It seems that in many cases, when an organism gains a lucky mutation, it begins to drive out its competition before it has any chance to react in any way. I don't know what to do in such cases.
Title: Ways to increase natural selection?
Post by: EricL on September 11, 2008, 10:59:34 AM
One thing you can do is create geographic isolation - pockets where diversity can evolve with minimal (but some) migration between them.  Do this by running larger fields, making your sim non-toroidal, using multiple teleporter-connected sims and/or or using shapes to create barriers to founders.   This lets species come into contact gradually and might perhaps allow them, once evolved, to evolve a means for long term co-existence instead of having every individual mixed in with every other.  Maybe.  A so-called weaker species might still defend a niche effectively against a "stronger" species, particularly if it has the strength of numbers on it's home turf.
Title: Ways to increase natural selection?
Post by: ikke on September 11, 2008, 01:33:38 PM
Issue is that every strain competes for the same niche. If there are different niches (food availability, rules) different strains evolve in the different niches without being able to outcompete each other. You may even see strains being able to cling onto life on the border caught between lad and water. ruling neither, but surviving in both
Title: Ways to increase natural selection?
Post by: EricL on September 11, 2008, 01:37:53 PM
Quote from: ikke
Issue is that every strain competes for the same niche. If there are different niches (food availability, rules) different strains evolve in the different niches without being able to outcompete each other. You may even see strains being able to cling onto life on the border caught between lad and water. ruling neither, but surviving in both
Exactly.  When I say our sims are too small, too simple, etc. I mean that we don't have a rich enough environment to support lots of niches to facilitate this multi-specialist co-existence in proximity.  Adding additional environmental complexity to facilitate diversity of niches is one of the main thrusts I want to work on over the next year...
Title: Ways to increase natural selection?
Post by: EricL on September 11, 2008, 03:38:18 PM
FYI, I managed to get a couple of hours to rub together today and I implemented auto-species forking based on genetic distance for 2.43.1M.   I also implemented a Max Genetic Distance graph which shows you the maximum genetic distance between individuals in a species.
Title: Ways to increase natural selection?
Post by: EricL on September 13, 2008, 01:06:16 PM
FYI, here's a screen shot showing co-existence of multiple species over time.  Granted, the duration shown is only 10k cycles, but you can see the relative populations of most species remain fairly stable.  Near the end, on species (Seasnake 1 4759)  can be seen making significant gains at the expense of the others.   Note that the coordinated up and down fluctuation is due to auto-costs.

New species were created via the new auto-forking capability when the genetic distance between individuals exceeded 30 mutations.
Title: Ways to increase natural selection?
Post by: Shasta on September 13, 2008, 06:49:08 PM
Thats really cool. I can see that being really handy in evo sims. But, is 30 mutations enough? When I ran a zerobot sim there were thousands of mutations before anything reproduced, that graph might get pretty cluttered.
Title: Ways to increase natural selection?
Post by: ikke on September 13, 2008, 08:53:56 PM
Quote from: EricL
FYI, here's a screen shot showing co-existence of multiple species over time.  Granted, the duration shown is only 10k cycles, but you can see the relative populations of most species remain fairly stable.  Near the end, on species (Seasnake 1 4759)  can be seen making significant gains at the expense of the others.   Note that the coordinated up and down fluctuation is due to auto-costs.

New species were created via the new auto-forking capability when the genetic distance between individuals exceeded 30 mutations.
Thanks, this is really, really helpfull (I really miss the :flowers: emoticon in this forum). I am very curious how this graph will play out in my zerobot sim. Currently my only means to assess success is finding the most successfull bot and looking at the number of offspring it has. As for the clutter: if the mutation distance can be chosen, and / or only the top x ar shown at any given time, the clutter can probably be controlled. For now I am happy enough to live with clutter.

For the complex environment: I don't know how integrated the rules are in the sim or if it is easy to make rules specific to a shape. From an evo sim perspective this is the feature. Putting on my object oriented, and without knowing the code hat I'll state that it can be as easy as making the rules object part of shape not sim. Given that DB itself is an evolutionary project, and that VB is not object oriented (at least that is what I'm told), the code probably has to be torn apart to get this done, making it a near prohibitive amount of work.
Title: Ways to increase natural selection?
Post by: Peter on September 14, 2008, 11:40:47 AM
Quote
For the complex environment: I don't know how integrated the rules are in the sim or if it is easy to make rules specific to a shape. From an evo sim perspective this is the feature. Putting on my object oriented, and without knowing the code hat I'll state that it can be as easy as making the rules object part of shape not sim. Given that DB itself is an evolutionary project, and that VB is not object oriented (at least that is what I'm told), the code probably has to be torn apart to get this done, making it a near prohibitive amount of work.
VB is objectorientated.

Can the number of 30 mutations be changed?
Can I get the program mad if I insert 1000 bots inside a sim with full mutations?
Title: Ways to increase natural selection?
Post by: goffrie on September 14, 2008, 08:59:17 PM
Quote from: Peter
VB is objectorientated.
Visual Basic 6 (at least) is not really object-oriented (Wikipedia says "basic object oriented support").

Yay nitpicking!
Title: Ways to increase natural selection?
Post by: Numsgil on September 15, 2008, 01:42:50 AM
Either way the Darwinbots source for VB is written about as procedurally as you can get.
Title: Ways to increase natural selection?
Post by: EricL on September 15, 2008, 12:23:56 PM
Quote from: Shasta
Thats really cool. I can see that being really handy in evo sims. But, is 30 mutations enough? When I ran a zerobot sim there were thousands of mutations before anything reproduced, that graph might get pretty cluttered.
In 2.43.1m, species can be forked either manually or automatically.  There's a new dialog where you set options for what attributes should be used to declare new species.  It contains a "fork now" button for one time forking as well as an option for automatic forking where the code will automatically fork species, checking every 100 cycles if the criteria for forking have been met.

In either case, the decision to fork species can be made based upon the maximum genetic distance within species, the maximum generational distance within species or both.  Maximum genetic distance as I'm using it is a bit of a misnomer in that is not an exact computed genetic distance.  I am not examining extant genomes and computing genetic distance.   Rather, I'm using ancestor lists and thus the maximum genetic distance is really the number of mutations that separate the genomes of the two most distantly related (based on genetics) individuals in the species.  Generational distance is the number of generations separating the two most distantly related individuals (based on ancestral relationship).  

Consider two extant bots of the same species, A and B.   Since they are of the same species, they have a most recent common ancestor.  Lets call that bot C.  Let's say bot C is 20 generations back for bot A and 25 generations back for bot B (the generation time on B's side of the family has been shorter for whatever reason).   45 generations separate bots A and B.  That is the generational distance.    The genetic distance (as I'm using the term) is the sum of the mutations that have occurred along both lines of descent, from C down to A and from C down to B.

A new species can be said to have come into existence when a single species splits into two or more separate and independent lines of descent.   Drift and/or selection works to separate the genomes on the lines of descent over time.  If they don't die off, at some point they can be said to have forked and to have become separate species.  The new dialog allows the human to specify when a new species should be declared for the purposes of separate tracking via the population and other graphs based on generational distance and/or genetic distance.  

New graphs for maximum genetic distance and maximum generational distance in 2.43.1m allow you to watch this happen for all species and tune your speciation settings accordingly.   With either graph, a species value that greatly exceeds those of the others is a clear indication that speciation has occurred within that species I.e. that multiple independent lines of descent exist within the species.  In future versions, I may provide the option to detect this and fork species automatically based on these relative measures rather than specific human-specified trigger values.  e.g. fork a species once it's maximum genetic distance reaches 10X the average for all other species.

The weather is still really nice here in Seattle, so my DB coding time has been limited, but it looks to turn crappy later this week at which point my time working on DB should increase.  Hopefully should be able to release this relatively soon.
Title: Ways to increase natural selection?
Post by: ikke on September 15, 2008, 01:18:55 PM
still mis the flowers emoticon. Additionally I now miss the worthy emoticon. I'll just have to settle for  
Title: Ways to increase natural selection?
Post by: Peter on September 15, 2008, 02:46:19 PM
Quote from: EricL
The weather is still really nice here in Seattle, so my DB coding time has been limited, but it looks to turn crappy later this week at which point my time working on DB should increase.  Hopefully should be able to release this relatively soon.
I hope there will be rain.
Title: Re: Ways to increase natural selection?
Post by: Botsareus on November 29, 2014, 02:55:30 PM
Expect full implementation of architecture soon.