Author Topic: Chromosomes and Sexual Rproduction  (Read 10881 times)

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Chromosomes and Sexual Rproduction
« on: August 17, 2010, 12:48:53 AM »
Hey, I was just giving this topic some thought recently and realized that the reason sexual reproduction in DB is so wobbly is that there is only one DNA. What if instead of coding the entire DNA into one section, large chunks of genes can be separated into chromosomes, which were assigned an ID to recognize pairs and a random one from each parent matched. If the chromosomes are properly coded (eg. a fair degree of independence), you could then activate one of your pair, and leave the other one to be still passed on (there's probably better ways to handle this, please discuss!). Instead of having very similar bots of different species, you could then check species by chromosome IDs (if they can breed, they're the same species) and thus introduce strains.

This would solve a lot of current issues - mainly the reproduction glitches, speciation definition, and would also allow for some funky new mutations. I know this has been discussed before, but the main difference is actually having more than one DNA strand present. Thoughts??  :D
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Chromosomes and Sexual Rproduction
« Reply #1 on: August 17, 2010, 01:08:58 PM »
That's sort of what I want to do with DB3.

What you can do basically is, using some smart algorithms, match up like parts of disparate DNA strands, and then "cross over" (eg: swap bps downstream) for the like parts.  The end result is basically a shuffled and relatively meaningful DNA strand.  I think the program does this already (Eric coded it up a while ago).  This matches very well with actual biology.  The nice thing being that you don't need IDs or anything to handle this sort of thing.  You can handle it automatically by just doing some pattern matching.

What makes the current system hard is that very very different bots can sexually reproduce, but not all properties in the system can be mixed very well.  Like clearly raping a veggy is over powered.  Since none of the DNA matches, no cross over event occurs.  So basically you've managed to inject your DNA in to a veggy cheaply and quickly.  The problem is that there's no down side to being a veggy really.  Veggies just get free energy.  Part of what I wanted to do with DB3 involves fleshing out the system better so that it's meaningful to be half veggy and half animal, with clear strengths and weaknesses.

As far as haploid/diploid: if you look at simple unicellular creatures which sexually reproduce, it's actually really, really interesting.  In our multicellular world, we think in terms of male, female, and child.  But in the world of cells sexual reproduction is more like fusing two creatures together (eg: Archons in Starcraft).  Fungi, for instance, basically alternate between haploid generations and diploid generations.  See this.

I think this sort of thing would make far more sense to bots.  There would be a "fusing" stage where two haploid individuals pool their resources during times of scarcity.  The two DNA strands sort of share control of the hybrid diploid creature.  When times become better, the hybrid creature splits back apart in to either original bot.  But during that process, the two strands take time to swap parts of their DNA with each other.  The only hard part is figuring out how two DNA strands can share control of a single bot with each other.  I don't have any really good options.  You basically want to run both in parallel, and "average" their actions together.  But an actual average wouldn't really work for things like memloc or shoot (-1 and -6 would average to like -3.  Not the same thing at all).  You could swap control of the bot every other cycle, but that feels really inelegant to the point that I can't imagine successful bots ever fusing voluntarily.  The resulting bot would be way to schizo.

For DB3 I was hoping to frame the DNA in such a way that all sysvars operate on a gradient so that averaging values together actually does make sense.  But even if that works, you run in to an issue with DNA trying to vote for much larger or smaller values than it really wants in an effort to force the values to be what it really wants (eg: strand 0 votes for 10, and strand 1, knowing strand 0 will vote for 10, votes -10 so that the average will be 0 like it wants).  But maybe that's not a bug, but a feature.  Two cheater strands won't really work well together, as they each try to get in to the other's heads.

Anyway, that's my brain dump on the matter.

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Re: Chromosomes and Sexual Rproduction
« Reply #2 on: August 17, 2010, 03:32:15 PM »
The haploid to diploid fusion should maybe not be reversible (a bit like sperm and egg not being able to seperate again I suppose), but a meiosis option would be a good way to go.
On a related manner, what about plasmids (cells 'donating' sections of DNA to other cells)? It would be a bit like a virus I suppose, but could also have some interesting uses...
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Chromosomes and Sexual Rproduction
« Reply #3 on: August 17, 2010, 06:27:40 PM »
The haploid to diploid fusion should maybe not be reversible (a bit like sperm and egg not being able to seperate again I suppose), but a meiosis option would be a good way to go.

Yeah.  My thought is when you separate you force a cross over event.  So you can't fuse and remain unchanged necessarily.

Quote
On a related manner, what about plasmids (cells 'donating' sections of DNA to other cells)? It would be a bit like a virus I suppose, but could also have some interesting uses...

Functionally, would work the same as viruses, yeah?  Just with benevolent intentions instead of malicious ones.

Viruses are tricky.  At a high level I want to treat them as just another DNA strand sharing control of a bot.  But then you get in to issues where spamming a bot with thousands of identical viruses so you can "weight" the average to do what the virus wants becomes a good strategy.  Which would be fine from a gameplay standpoint since those viruses aren't exactly free, except suddenly the simulation starts crawling as it has to do lots of basically identical calculations.  There'd be nothing to prevent the number of viruses inside bots from ballooning exponentially, and all of them executing inside the bot.  I could just count the number of identical DNA strands in a bot (with a hash) and avoid processing them that way, but maybe with mutations on that would break down quickly?  It wouldn't take long for 10000 identical virus strands to diverge with mutations enabled.  I could implement a cost for each bp executed, but that tends to have a chilling affect on evolution experimenting with complex behaviors (you get really efficient grey goo usually), so I really want to avoid that.

Thinking about it, I guess I want some mechanic that counterbalances the desire for exponential growth that reproducing units have.  But that's really pretty fundamental to the way life is supposed to work.  Actually thinking about it, I wonder why our real life genomes don't grow exponentially.  Retroviruses add themselves to the DNA strand, so I'm not sure I know what prevents them from doing this ad infinitum.  In a certain sense, I guess that's what real (non retro) viruses do.  The cell ruptures from having too many virus copies.  But with retroviruses (which are basically what Darwinbots viruses are) and plasmids I don't see a mechanism that should stop them from endlessly replicating themselves inside their host.

There's probably some selection pressure to keep DNA length small(ish), but I don't know what it might be.  Bacteria genomes are orders of magnitude smaller than eukaryote genomes, so whatever it is it's less pronounced in eukaryotes.  It's not like a computer, though, where more instructions = longer execution time.  DNA operates on a massively parallel computer.  Each bp is basically it's own processor.  Each protein is a new processor, too.

Probably has to do with mutations.  Fewer bps = fewer points of failure.  If you have 20 copies of a gene you aren't better off than having 2 copies of a gene, but you are more likely to suffer a catastrophic mutation in one of those copies that kills you.  Maybe eukaryotes have longer genomes because they have more sophisticated error checking machinery.  Not sure how I'd incorporate all that into a gameplay mechanic.  Maybe I wouldn't need to because it'd be emergent.

Offline ikke

  • Bot Destroyer
  • ***
  • Posts: 300
    • View Profile
Re: Chromosomes and Sexual Rproduction
« Reply #4 on: August 18, 2010, 12:49:38 AM »
There's probably some selection pressure to keep DNA length small(ish), but I don't know what it might be.  Bacteria genomes are orders of magnitude smaller than eukaryote genomes, so whatever it is it's less pronounced in eukaryotes. 
As I understand it dna and cell size correlate (on a species level). Organisms are selected based on optimal cell size (be it bigger or smaller) and therefore insertions or deletions are selected

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Re: Chromosomes and Sexual Rproduction
« Reply #5 on: August 18, 2010, 12:52:22 AM »
Hmmm....what about making a cap on the number of vectors in the DNA proportional to body size?

I gave this some more thought today, and thought this could play out nicely:

-Chromosomes
These have no particular internal structure. They are discrete eg. you can't have start/stop commands randomly floating around, but mutations can 'physically' break and recombine chromosomes (as real block mutations do). In place of genes, chromosomes have inline logic. This minimizes the deviation from the current code while still maintaining the rough structure of real chromosomes.

-Plasmids
These will be the conventional cond/start/stop genes. Plasmids can reproduce and eject themselves independently (eg. viruses), and are separated from the chromosomes. This means that primitive species can still function with only plasmid DNA, and will also provide full compatibility with the current code.

Sexrepro will mix chromosomes as in traditional meiosis (not sure what happens with plasmids, I guess you just mix and match somehow), repro will duplicate the individual as in mitosis, and viral commands and delgene will take over the plasmid controls.
The main idea is that chromosomes control the cell's defining functions, while the plasmids are extra generic pieces of DNA, such as viruses, or something like poison genes.

I guess the no real pressure to keep DNA length small - but mutations very rarely cause insanely large strands to appear out of nowhere (with the exception of polyploidy, which is fatal in animals and usually causes sterility in others), so DNA growth is mainly caused by viruses - a virus inserting itself into a host is usually fatal, terminating that strand. The only real growth in DNA is caused by broken viruses-and I think junk DNA is supposed to make up very large chunks of our DNA, on which no pressure acts...

There is some physical limitations on the amount of DNA, I guess. Space is the ultimate one (although only relevant when a virus undergoes extreme amplification-Ebola comes to mind), but within limits of reason, a cell can only produce so much proteins and other materials to read and execute DNA - like having a computer with a billion processors all running from the same battery, to use your analogy.
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Chromosomes and Sexual Rproduction
« Reply #6 on: August 18, 2010, 06:29:34 PM »
There's probably some selection pressure to keep DNA length small(ish), but I don't know what it might be.  Bacteria genomes are orders of magnitude smaller than eukaryote genomes, so whatever it is it's less pronounced in eukaryotes. 
As I understand it dna and cell size correlate (on a species level). Organisms are selected based on optimal cell size (be it bigger or smaller) and therefore insertions or deletions are selected

Hmm, we could probably tie DNA length to some sort of minimum cell volume.  More DNA = larger cell.  I'll have to think through what sort of consequences this might have.  At some level you need some downward pressure on DNA length, because real life computer resources aren't infinite.  But on the other side if the costs are too high you end up with grey goo.  And I don't know a good way to figure out what too high is until after you have grey goo.

Along the same line if we could tie some sort of "efficiency" to cell size vs. DNA length, that might be interesting too.  Like in times of trouble the cell can condense itself to preserve resources, but at the cost that it's basically putting itself in some sort of hibernation.  To actually execute and metabolise code and stuff you need your DNA "unraveled" with lots of working room.  But I don't know how to do that with a discretely executed DNA.  If cells could run at different clock rates (eg: say 100 cycles pass before your DNA is executed again (cycles would represent smaller chunks of time probably)), that might work.  I dunno, some food for thought.

@bac:
If viruses are chromosomes, you don't need cond, start, stop, etc. to define them anyway.  Virus production just becomes "duplicate this chromosome".  So if you've defined a nice way in which conflicting chromosomes interact (eg: average their store values or something) then this part of it at least becomes quite manageable.  You also don't have to worry about trying to balance how DNA gets injected in to existing DNA strands (eg: inside the middle of a gene is usually doubly damaging).

Quote
There is some physical limitations on the amount of DNA, I guess. Space is the ultimate one (although only relevant when a virus undergoes extreme amplification-Ebola comes to mind), but within limits of reason, a cell can only produce so much proteins and other materials to read and execute DNA - like having a computer with a billion processors all running from the same battery, to use your analogy.

Yeah, that's a good way to look at it actually.

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Re: Chromosomes and Sexual Rproduction
« Reply #7 on: August 19, 2010, 02:13:02 AM »
Quote
@bac:
If viruses are chromosomes, you don't need cond, start, stop, etc. to define them anyway.  Virus production just becomes "duplicate this chromosome".  So if you've defined a nice way in which conflicting chromosomes interact (eg: average their store values or something) then this part of it at least becomes quite manageable.  You also don't have to worry about trying to balance how DNA gets injected in to existing DNA strands (eg: inside the middle of a gene is usually doubly damaging).

Ah, but viruses are not chromosomes - in this model, viruses would instead be plasmids, floaty chunks of DNA separate from the main body of DNA eg. chromosomes. I suppose you could also insert them into the chromosomes, but then you have to define the gene within the chromosome, which otherwise would not be necessary; this way also gives some limited degree of DB2 code.

In summary, I think I'm somehow missing your point...
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Chromosomes and Sexual Rproduction
« Reply #8 on: August 19, 2010, 12:36:22 PM »
Quote
@bac:
If viruses are chromosomes, you don't need cond, start, stop, etc. to define them anyway.  Virus production just becomes "duplicate this chromosome".  So if you've defined a nice way in which conflicting chromosomes interact (eg: average their store values or something) then this part of it at least becomes quite manageable.  You also don't have to worry about trying to balance how DNA gets injected in to existing DNA strands (eg: inside the middle of a gene is usually doubly damaging).

Ah, but viruses are not chromosomes - in this model, viruses would instead be plasmids, floaty chunks of DNA separate from the main body of DNA eg. chromosomes. I suppose you could also insert them into the chromosomes, but then you have to define the gene within the chromosome, which otherwise would not be necessary; this way also gives some limited degree of DB2 code.

In summary, I think I'm somehow missing your point...

Well what is a chromosome?  Basically a large floaty chunk of DNA.  Functionally there's no reason to treat chromosomes separately from plasmids, so make them the same thing.  When you get infected with a virus, the virus just becomes a new chromosome.  It gets replicated during reproduction, tries to get matched during meiosis, all that fun stuff.  Then virus replication doesn't need to rely on any special gene tags.  It just literally copies the entire chromosome, since the entire chromosome is the virus.

Mutations later on can maybe merge chromosomes to provide some downward pressure on the number of them.

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Re: Chromosomes and Sexual Rproduction
« Reply #9 on: August 20, 2010, 01:04:54 AM »
The main reason to treat chromosomes differently to plasmids is that they are the only determinants in sexual repoduction. Plasmids do not define a species - they just float in the cell, acting completely independently of the chromosomes. This also means that infected cells don't suddenly have huge reproduction complications - viral plasmids simply replicate their own DNA (a virus doesn't copy huge chunks of random DNA, just itself) without messing up the reproduction system. It also means you don't have to trim DNA to pressure downwards - you can just can, say, half the plasmids from each parent or something like that, which would provide serious issues with chromosomes.
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline Billy

  • Bot Destroyer
  • ***
  • Posts: 175
    • View Profile
Re: Chromosomes and Sexual Rproduction
« Reply #10 on: September 06, 2010, 08:20:49 PM »
Here's my opinion:

A bot should be able to have any number of chromosomes. It should be able to merge with other bots with the same number of chromosomes, creating a bot with the chromosomes of both merging bots arranged into pairs. The opposing chromosomes should be averaged, and no, sometimes it doesn't work, but this is useful because it should prevent hybrids between two species. A bot should be able to split with or without copying its genome. Without only when it has a pair of each chromosome. When without, a random chromosome from each pair should be distributed to each daughter bot. I see no need to separate plasmids from chromosomes.

With this arrangement, it is possible to program yeast style reproduction, as well as egg/sperm style fertilisation. It seems like the ideal solution to me.
"I cannot persuade myself that a beneficent and omnipotent God would have designedly created parasitic wasps with the express intention of their feeding within the living bodies of Caterpillars."

-Charles Darwin

Offline Billy

  • Bot Destroyer
  • ***
  • Posts: 175
    • View Profile
Re: Chromosomes and Sexual Rproduction
« Reply #11 on: September 13, 2010, 02:37:41 PM »
Since my last post I've decided that my method wouldn't work very well, because it would mean that bots with viruses can't merge with bots of the same species without viruses. Now I think that viruses and plasmids shouldn't be arranged into pairs, and when a diploid bot splits they should be randomly distributed between the two daughter bots.
"I cannot persuade myself that a beneficent and omnipotent God would have designedly created parasitic wasps with the express intention of their feeding within the living bodies of Caterpillars."

-Charles Darwin

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Re: Chromosomes and Sexual Rproduction
« Reply #12 on: September 13, 2010, 06:08:13 PM »
Yup; remember that in RL, plasmids reproduce independently of the cell itself.
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Chromosomes and Sexual Rproduction
« Reply #13 on: March 19, 2011, 04:01:23 PM »
I like the idea of averaging chromosomes. ex:

Quote
Chromosome 1

50 .up store

Chromosome 2

30 .up store

Result:

40 .up store

But here is my issue , what controls how many chromosomes the robots evolve, and what controls where they are inserted, or merged?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Chromosomes and Sexual Rproduction
« Reply #14 on: March 21, 2011, 12:35:11 PM »
One of the mutation types I was thinking would duplicate chromosomes.  Another mutation type could delete or merge chromosomes at random.