Author Topic: Using viruses to reproduce.  (Read 2381 times)

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Using viruses to reproduce.
« on: January 22, 2007, 10:46:57 PM »
My apologies in advance if this stream of consiousness is old news but this just kind of dawned on me and I find this line of thinking fasinating.  I love it when virtual nature surprises me.

I have a big evosim running currently which I will post in a couple of days as soon as I hit 1000 cummulative hours.  In the sim, I use mutation disabled veggies with the following gene:

cond
start
628 rnd .aimright store
100 .shootval store
-2 .shoot store
stop

The veggies provide lots of nrg shots that my zerobots can run into and absorb.  I set up the inbound nrg such that it doesn't quite keep up with the veggy nrg loss.   So a veggy spawns into being somewhere, spews nrg for a while and then dies and disappears, providing a dynamic environment.

I am not using everlasting nrg shots.  I did initally, but I wanted nrg absorbation by my evolving zerobot hetertrophs to be non-random and with many many thousands of everlasting nrg shots in a sim, there is no nrg locality - no selection pressure to do better at aquiring nrg.   I'm trying to provide selection pressure for my zerobots to grow smarter.   For example, my first replicatiors tended to fix themselves in place.  Why not?  Nrg was random and everywhere.   But now they don't do that because the sim size and veggy die off rate is such that the mean time it takes for a veggy to materialize next to a fixed zerobot is longer then the  average zerobot lifetime at current cost and offspring nrg levels.  Selection has favorred movement to get nrg and now all my evobots move at the max velocity (although they accelerate slowly).  Now I'm working on getting them to stop conditionally when they encounter another bot.  Stopping next to a veggy spouting nrg and then moving on again when it dies or some varient of this behaviour would provide a huge nrg intake advantage leading to increased reproductive sucess.  Selection should favor it.  Such a conditional adaptation would be huge.

Anyway, I've evolved a self replicating virus in the sim.  The code is below.  I have not reverse engineered it yet, but what happens is that over time, some of my veggies catch the virus even during their short life spans.  The virus deletes the shooting gene, preventing the veggies from dying.  I've watched it happen.  Seletion favors this (for the virus) since if a virus can turn off a veggies shooting gene, it will live a very long time in that autotroph compared to my hetertroph zerobots, dramaticaly improving the virus's reproductive success.

This got me thinking.  Since most mutations occur during reproduction, one can imagine bots evolving a reproduction strategy which completly bypasses all the reproduction-time mutations built into the simulator.  The strategy would be simply to reproduce, then infect the offspring with a virus that deletes all the offspring's DNA and contains the parents entire genome.  The genome could have logic to facilitate this such as stickign aroudn the parent for the first N cycles, etc  Since the built-in mutation code does not get invoked for viruses, such a reproduction strategy would bypass all the human authored simulator mutation logic (except point mutations).  The offspring's DNA may have been mutated by the simulator at reproduction time, but that DNA get's thrown away and replaced by the parent.  Reproduction becomes a two step process I.e. create an empty husk and then inject it with your DNA.  

I have long had concerns as to whether we have included all the right kinds of mutations in the right way into the simulator.  'Real' biological mutations are largely a function of the DNA copying, repair and error correction machinery used by and evolved over time by biological organisms.  Such things as gene structure are intimently related to the how, when and where mutations occur.  The two things evolved together.  The fact that our built-in mutation logic is human authorred and completly disconnected from gene structure or any other evolved mechanism has always concerned me.

But if bots start taking their reproduction and in particular, the copying of their DNA into their offspring (or for multibots, into cells of their own body as they grow) into their own hands (so to speak) then long term, we might see mutation mechanisms evolve naturally alongside the evolved DNA copying machinery.  That would be way cool.

One can imagine sexual reproduction emerging from this as well, first as parasitic bechaviour then as symbiosis.  Instead of reproducing and injecting your DNA into an offspring you make, it is obviously less costly if you can find the empty husk somewhere else and inject your DNA into that.  The bot becomes the virus and vice versa.  But bots may well evolve counter measures to the virus from another bot, in particular preventing the full deletion of it's own DNA.  Selection would favor this.  But some of the newly injected DNA might be useful.  Selection may favor strategies where the resultant bot is a combination of the two original genomes.  Over time, this might get structured and formalized, changing from mere opportunism to true symbiosis and then to sexual reproduction.  Species would emerge where there are incompatabilites in genome merging strategies.  Selection starts to favor only mating with another member of your own species since mating outside your species results in wasted effort or non-viable offspring.

Now consider multibots.  Every cell in a multibot has all the DNA for making every other cell in the multi-bot just like every cell in our bodies has a complete set of our DNA (if they don't it's not a multi-bot, it's symbiosis between different organisms).  It would be very difficult for an outside organism to infect all the cells of a multibot with it's reproduction virus.  In fact, infecting more than one will be difficult given the time it takes to incubate a virus shot (genomes are getting large by now).   Selection may favor a multibot getting rid of an infected cell, or isolating it, or over time, incubating it until it grows into a new multibot....   You know where I'm going with this.  The feamle multibot's infected cell is the egg gamate of one sex of the species.  The virus shot is the sperm from the male.  Viola!

Anyway, sorry for the ramble, but I find this lien of reasoning fasinating and perhaps even illuminating into our own biological history.  If anyone has any good reading suggestions on the role of viruses in our own biological evolution, I would be very appreciative.

As a follow on subject I've yet to explore, perhaps we should consider adding the potential for the gene of a virus shot to be ineaxctly copied into the victim so as to facilitate the evolution of this kind of reproduction with DNA copying induced mutations.  Or perhaps we should just let it evolve naturally..  


Virus code

cond
 27 1 -7 >=
 start
 xor
 angle rnd inc
 dist 3 35 and
 5 not
 dist >> * inc
 !~=
 *.dx 6 start
 ceil and
 - 1 1 !%=
 start
 xor
 14 dup 47 dist << dec
 dist >=
 49 %=
 not
 >> ^ mult inc
 !~=
 *20 6 start
 pyth and
 << 1 !%=
 start
 xor
 1 and
 dist *23 dec
 10 ceil angle 49 inc
 not
 | >> * inc
 *.shootval *.aimright =
 start
 angle and
 & 1 !=
 0 !=
 start
 xor
 1 add 47 dist << dec
 10 49 35 ceil %=
 not
 >> >> * inc
 !~=
 *.robage 6 start
 angle << 1 start
 3 20 div cond
 27 1 -7 >=
 start
 xor
 angle rnd inc
 dist 3 35 and
 5 not
 dist >> * inc
 !~=
 *.dx 6 start
 ceil and
 - 1 1 !%=
 start
 xor
 14 dup 47 dist << dec
 10 dist >=
 49 %=
 not
 >> ^ mult inc
 !~=
 *20 6 start
 pyth and
 << 1 !%=
 start
 xor
 1 and
 dist *23 dec
 10 ceil angle 49 inc
 not
 | >> * inc
 *.shootval *.aimright =
 start
 angle and
 & 1 !=
 0 !=
 start
 xor
 1 add 47 dist << dec
 10 49 35 ceil %=
 not
 >> >> * inc
 !~=
 *.robage 6 start
 angle << 1 start
 3 20 div
Many beers....

Offline Jez

  • Bot Overlord
  • ****
  • Posts: 788
    • View Profile
Using viruses to reproduce.
« Reply #1 on: January 22, 2007, 11:56:38 PM »
I have often thought of viruses as horizontal gene transfer. I don't think of viruses as other than self replicating objects.

I think what your bots have done, transferring info to the veg so they don't die as opposed to stopping by the veg is similar to bots exploiting loopholes in the code.

You know I am anti virus power as it stands, I will reply to this again when I am not so tired.
If you try and take a cat apart to see how it works, the first thing you have in your hands is a non-working cat.
Douglas Adams

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7715
    • View Profile
Using viruses to reproduce.
« Reply #2 on: January 23, 2007, 01:15:03 AM »
I have often thought of how we might construct meta-DNA.  That is, DNA that can reference and parse itself.  Many other simulators have this because their organisms have to manually copy themselves into another cell in the Cellular Autonoma.

In the Darwinbots universe, this isn't as easy as that.  The best solution I can think is to have a seperate DNA entity program that handles DNA copying and maintenance.  When a repro command is called, it would call this seperate program to create the DNA for the new bot.

Thing is, I have no idea how this seperate program would work.

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
Using viruses to reproduce.
« Reply #3 on: January 23, 2007, 01:21:55 AM »
That's pretty cool, never seen a virus take naturally evolve before. Had the thought about viral reproduction awhile ago, just never got around to making it work right.

I did however, design on species that would randomly fire a gene at age 0 and delete any extra genes over a certain number.

Was pretty interesting, led to improved gene spread in the population. A mutated gene that allowed cannibotism spread blazingly fast across the sim, much faster even than normal reproduction could account for, it also seemed better regulated since Cannis didn't have their typical advantage. Also led to virally transmitted diseases(Digital STDS   ) like continually reproduction for hetrotropic bots. Normally this would have been limited to a single species, but it was able to cross into non-decendent lines with the viruses.

Had to add some viral prevention dna for the plants, also restricted gene usage with epigenetics. Still wasn't a total success, since the plants would still occasionally pick up animal dna; possibly through multiple viral insertion into their genomes.

More on viruses:
I had a few odd times when the virus actually became an anti-viral defense. Since the virus is most affected by mkvirus a mutation of the number stored there saved the bot for awhile, until the sheer numbers of viruses overwhelmed their defense.

I do think that viruses should be allowed to mutate upon insertion into another bot. This would be the best time since the processing power wouldn't be wasted upon viruses that fly off into the wild blue yonder.
« Last Edit: January 23, 2007, 01:30:18 AM by Endy »

Offline MacadamiaNuts

  • Bot Destroyer
  • ***
  • Posts: 273
    • View Profile
    • http://www.franontanaya.com/blog/
Using viruses to reproduce.
« Reply #4 on: January 23, 2007, 11:23:35 AM »
During an early stage of my Five-O's they used to fire a virus that copied almost all their DNA into veggies, turning them into hunters too. But since reproduction was disabled for veggies they didn't go beyond that.

Btw:

Quote
dist >=
49 %=
not
>> ^ mult inc

That's the same pattern generator concept I saw in the Five-O's. Dist being used as random generator, mult to select only a range of sysvars and then a store or an inc/dec.

It seems that zerobots like a lot these multipurpose single genes.
Sometimes you win, and sometimes you lose...

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7715
    • View Profile
Using viruses to reproduce.
« Reply #5 on: January 24, 2007, 11:03:08 PM »
Most mutated viruses I've seen look like that.  Just maybe 7 random looking commands that repeat and repeat in the genome.  First time I saw an example posted, I thought it was a bug.

Apparently viruses are really easy to evolve compared to shooting, or tieing, or a host of more common behaviors in authored bots.  I'm sure there's a lesson to be learned here that would help us refine the interaction of sysvars, but I don't know what it is.

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
Using viruses to reproduce.
« Reply #6 on: June 08, 2007, 12:39:49 AM »
Newer post brought this to mind again.  

Quote
Just maybe 7 random looking commands that repeat and repeat in the genome.

The Y chromosome and various prokaryotes seem to use repetitive dna sequences to help avoid the effects of a bad mutation. Seems to make sense that our bots would do the same.

Prokaryotes are able to somewhat selectively take up new dna from the enviroment, by doing a basic species check. Maybe we could give the bots something similar. It makes sense that new dna would perhaps be useful, but it makes more sense to only select new dna from near kin rather than possibly parasitic dna.
« Last Edit: June 08, 2007, 12:47:31 AM by Endy »

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Using viruses to reproduce.
« Reply #7 on: June 27, 2007, 03:08:36 PM »
This is nice after I was playing with the code of your sim I have thought over a theorie, now I now it's right for sure, now I've got something else to back it up.

First the 2nd gene from one of the 2 bots explained in the other post.

(the 3rd gene and the the second bot the 2nd gen are looking also kinda like this one)
Quote
cond
27 1 -7 >=
start
angle rnd inc
dist 3 29 6 dist >> * inc
*.dx 6 ceil - 1 1 14 dup 52 dist << dec
10 dist 36 | ^ mult inc
*20 6 angle << 1 1 dist *.robage dec
49 inc
10 ceil angle >> >> * inc
*.shootval *.aimright angle & 1 0
else
1 add 47 dist << dec
-1 * inc
*.robage 26 1

Here's the first part of the virus here posted.
Quote
cond
27 1 -7 >=
start
xor
angle rnd inc
dist 3 35 and
5 not
dist >> * inc
!~=
*.dx 6 start
ceil and
- 1 1 !%=
start
xor
14 dup 47 dist << dec

Compare them.

Well see anything, I you didn't pay attention They looked kinda each other.

I've figured out (see post in the 1000 hour topic)that these bots are completely lame without those virus's. In fact the virussus are controlling the bots. They are sometimes randomly deliting genes, that's probably happened to your veggie. They delete genes sometimes that way there's is a constant war between the different kinds of virus's.
« Last Edit: June 27, 2007, 03:09:53 PM by Peter »
Oh my god, who the hell cares.