Author Topic: Sexual reproduction  (Read 7520 times)

Offline Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
Sexual reproduction
« on: January 02, 2010, 08:33:40 PM »
This is a noob question since im sure someones tried something like this before, but what if we sped up evolution by putting all the best human created bots together in a simulation and forcing them to sexually reproduce. That way all the best genes would mix together and with survival of the fittest the best combination would survive (hopefully). You would just have to get a bunch of bots and change their .repro to .sexrepro and make a veggie that would target bots and fire -8 shots at them. You could make the costs low so the mutant hybrids would have some chance at survival. Mutations would hopefully modify the genes so they work together with each other better, and since its sexual reproduction only, the best genes would be spread through the population quickly. Just wondering if anyones tried anything like that and what the results were.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Sexual reproduction
« Reply #1 on: January 02, 2010, 10:15:21 PM »
I don't think anyone's tried this.  You're welcome to give it a go and see what results.  I imagine most bots are too different from each other to produce viable children, though.

Offline Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
Sexual reproduction
« Reply #2 on: January 02, 2010, 10:42:29 PM »
I did all that and after about 20k cycles all the bots were dead except for a bunch of tie bots. something about there dna lets them produce successful offspring when fertilized by the modified animal_minimalis I used as a veggie. I ran the simulation without the tiebots and the other bots survived for a bit but then all but a small handfull of the bots I had in the sim died. Its something about the competitive nature of the bots. I can't get them to intermingle and combine their dna. I'm going to try some other things like smaller sim sizes. It might also be because I disabled the vision on the vegs to keep them from combining dna from more powerfull bots and wiping out everything.

Offline Pascal666

  • Bot Neophyte
  • *
  • Posts: 25
    • View Profile
Sexual reproduction
« Reply #3 on: January 03, 2010, 07:58:35 AM »
You could program a mod for darwinbots that scrambles a gene list, and lets 2 scrambled bots compete with each other, and let the winner compete with a new scrambled bot.

Offline Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
Sexual reproduction
« Reply #4 on: January 03, 2010, 12:41:16 PM »
Sexual reproduction doesn't work at all for some reason. The female doesn't use any of the males dna when she reproduces making it just another form of asexual reproduction. I have another idea though. What if you copied the entire dna of each bot and pasted it at the end of a single bot making one super bot with hundreds of genes from dozens of bots. It wouldn't be very efficient but with mutations in place it could evolve some interesting behaviors.

EDIT: Heres FrankenstienBot in the attachment.
« Last Edit: January 03, 2010, 01:18:17 PM by Houshalter »

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Sexual reproduction
« Reply #5 on: January 07, 2010, 02:41:44 PM »
You need the bots to fire -8 shots at their own and even enemy bots. Then the bots getting hit need to reproduce before the fertilized counter runs out.
Also if the DNA is too far appart I think it doesn't mix well, may just take one or the other. I think you would have more luck adding this gene to the end of all the bots :

cond
*.vtimer 2 <
start
*.vtimer 0 =
*.genes rnd .mkvirus store
not
10 .vshoot store
stop

Not sure if this actualy works, haven't tested it, but you get the idea... just spread random genes through a virus from all the bots, see what happens...
If the sim stabilizes you can always throw in a few random bots manualy to spice things up again, see if some new genes catch on...
But I wouldn't add any realy small tie feeders like fruitflies or rapebots (lovebot, quickdraw and Saber).

Offline Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
Sexual reproduction
« Reply #6 on: January 07, 2010, 03:46:34 PM »
I did have the veggies targeting the bots and firing - 8 shots at them. I was hoping the gene that causes them to shoot - 8 shots would get mixed in with the other bots but it just takes the dna of the longer bot and copys it (although I noticed after a while the bots got close to veggies when the wanted to reproduce to get the -8 shots.) Also your idea sounds plausible but theres no way to stop a bot from getting duplicate genes. It just makes the genome grow longer and longer and longer. Maybe theres away to test the dnalength of all the genes and the delete any genes that are the same lengh. possibly useing .dnalen or something like it.

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Sexual reproduction
« Reply #7 on: January 07, 2010, 05:41:12 PM »
If you want genes to be mingled, then the virus approach would be the best one. Just have a virus that shoots a random gene every turn, or cycles through its genes, and if an infected cell has more genes than it should (normal + 2 genes), then it deletes one of its genes at random.
"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 Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
Sexual reproduction
« Reply #8 on: January 07, 2010, 07:44:57 PM »
Like this?
Code: [Select]
start
*.vtimer 0 =
*.genes rnd .mkvirus store
*.vtimer 1 =
.vshoot inc
*870 0 =
*.genes 870 store
*.genes 3 add *870 =
*.genes rnd .delgene
stop
It seems to work but this is my first virus so I might have messed up or something. I just loaded it as a veggie to let it infect other species. I also disabled its vision to prevent it from absorbing the dna of more powerful bots then using it to wipe out everything. One thing I noticed is that at first the virus shots travel only as far as any other type of shot but then later in the simulation they just go on and on and on and on etc, etc. Also the number of genes in the bot continues to grow even though it only takes up to 2 new genes every generation. (100 generations times 2 is 200 new genes! Most of them are probably duplicates to.)
« Last Edit: January 07, 2010, 07:48:18 PM by Houshalter »

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Sexual reproduction
« Reply #9 on: January 07, 2010, 09:26:47 PM »
Seems like it should work. But either way by spreading viral defences and slime genes it would counter the effect of the virus. Also bots with a genome too long will mutate too much to survive, so they should adapt.
You can always set a longer interval for shooting out a new gene so you don't spam the bots too much with random DNA...
Like
*.robage 300 mod 0 =
*.robage 10000 < and

This way you would be able to regulate how many new genes you want floating around the sim.

Offline Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
Sexual reproduction
« Reply #10 on: January 07, 2010, 11:01:07 PM »
Heres a new version of the virus:
Code: [Select]
start
*.vtimer 0 =
*.genes rnd .mkvirus store
*.vtimer 1 =
.vshoot inc
*870 0 =
*.genes 870 store
*.genes *870 >
*.genes rnd .delgene
*.robage 0 =
100 rnd 871 store
*871 66 >
870 dec
0 871 store
*871 33 <
*871 0 != and
870 inc
0 871 store
*871 33 >
*871 66 < and
0 871 store

'the following is optional for deleting extra virus genes
'*872 *.thisgene !=
'*.thisgene 872 store
'*872 *.thisgene !=
'*872 .delgene store

stop
Two things are different now if a bot successfully reproduces with the virus gene then the offspring will have a 33% chance of either adding a new gene, deleting a gene or keeping the same number of genes. There is also now an optional piece of dna for deleting extra viruses. You can also put in that piece that causes it to shoot every so many cycles but I wouldn't because it already takes long enough to spread the virus at the begging of the sim. Also the virus won't be able to penetrate bots with working virus resistance genes therefore it can't spread them unless the virus starts the sim already in the bots dna.

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Sexual reproduction
« Reply #11 on: January 08, 2010, 12:06:35 PM »
A viral defence won't be able to delete this virus since it spreads random genes, so any attemt to delete it will just delete the gene it's trying to spread (So the bot will loose some genes till it hits the virus)
But the genes spread from other bots will still pass most viral defences since they're not hostile, also mutations will break parts of viral defences (Which in this case may prove to be an advantage)

Only slime bots will be able to stay clean for a while, but sooner or later something is bound to get through. If you're planning to run the sim for a long time then eventualy everything will be infected, and ou don't want to overdo it. If you have 2 new genes per generation it's not quite the same as 2 mutations per gen, a lot of mutations aren't functional or just cause a minor tweek.

But I like the idea of deleting or adding genes, together with mutations it should help keep the dna length down, since bots that are too long will mutate too much, making the virus itself a benefitial gene of sorts.


Also you mentioned the virus shots lasting longer aorund the end. This could be a different virus from one of the bots, but it could also mean your own virus is mutating to fire stronger shots, making the new virus more potent and widespread. So instead of evolving the bots you're evolving a stronger virus. I'm not sure it's realy a problem though, maybe making the alge imune to viruses would help (This way the virus depends on the bots to survive, but it may take a semi large sim for it to work)


EDIT :
Firgured I'd give it a try too, using this gene :

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']start
*.vtimer 0 =
*.genes rnd .mkvirus store
*.vtimer 1 =
*.robage *.dnalen mod 0 = and
10 .vshoot store
stop

start
*971 0 =
*.genes 971 store

*.robage 0 =
100 rnd 20 < and
971 inc

*971 *.genes >
*.genes rnd .delgene store
stop

This way the longer the genome the less often it spread the virus. Also it doesn't remove genes, only adds (Mutations should take care of deleting genes)
Also I introduce selected bots from F1 that I know have some nice genes, and a viral defence that won't block the behavior of this virus. (Starting with the weakest)
This way the bots have time to get infected so they can pass off some genes to the next species.
« Last Edit: January 08, 2010, 12:56:21 PM by Moonfisher »

Offline Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
Sexual reproduction
« Reply #12 on: January 08, 2010, 04:33:50 PM »
The virus eventually develops to become harmful in every sim I've tried. You can tell by the costx graph (I have the dynamic costs really sensitive). In the begging it rises as the bots compete against each other and natural selection and all that and then it drops suddenly. It continues to fall untill it reaches -30 or somethin and theres only six bots left and then they eventually die to. I wonder if theres anything we can do to make the virus favor working with its host. I could raise the dna upkeep cost and increase minor/major deletion rates and make the vegs immune. Anything else?

Second how did you make the scrolling codebox?

Last look at this, its simmilar to what the virus is supposed to do. Here.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Sexual reproduction
« Reply #13 on: January 08, 2010, 06:35:17 PM »
I think the trick is the "mice in the haystacks".  Get a bunch of seperate simulations going, where most of the time they're separated.  Then mix them a bit for a brief time and then separate them again.  If a virus kills off all the bots in a "haystack", it'll get repopulated from a more successful one.  It helps prevent catastrophic extinction.

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Sexual reproduction
« Reply #14 on: January 08, 2010, 07:07:22 PM »
In the end I couldn't get the different species to coexist long enough to transfer genes, so I just shoved the dna from 3 bots into the alge and disabled movement and such (And added a gene for zeroing out certain vars)
The last gene is the one spreading the other genes as viruses. And it spreads itself more often to make sure most bots get the gene for cleaning up excess genes.
So far everything I've tryed leads to the dna growing way too fast.

This is what I'm trying atm...

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']def realgenes 121
def rightgenes 122
def random 123
def huntx 124
def hunty 125
def hunt 126
def huntnr 127
def nrone 128
def spread 973

def key 500
def hunttime 5
def ouch 10
def cycle 20
def switch 10

def count 950
def spin 951
def count1 952

cond
*.memval 1904 !=
*.eye1 *.eye9 !=
*.eye1 *.eye5 >
*.eye9 *.eye5 > or
start
*.eye1 *.eye9 sub sgn 139 mult .aimsx store
stop

cond
*.memval 1904 !=
*.eye2 *.eye8 !=
*.eye2 *.eye5 >
*.eye8 *.eye5 > or
start
*.eye2 *.eye8 sub sgn 104 mult .aimsx store
stop

cond
*.memval 1904 !=
*.eye7 *.eye3 !=
*.eye3 *.eye5 >
*.eye7 *.eye5 > or
start
*.eye3 *.eye7 sub sgn 70 mult .aimsx store
stop

cond
*.memval 1904 !=
*.eye6 *.eye4 !=
*.eye4 *.eye5 >
*.eye6 *.eye5 > or
start
*.eye4 *.eye6 sub sgn 35 mult .aimsx store
stop

cond
*.memval 1904 !=
*.eye5 0 >
*.robage 1 >
start
*.refxpos *.refypos angle .setaim store
stop

cond
*.spin 30 =
start
0 .spin store
stop

cond
*.eye5 50 <
*.eye5 0 > and
*.memval 1904 != and
*.spin 20 >= or
start
*.refvelup 20 add .up store
*.refveldx .dx store
.spin inc
stop

cond
*.eye5 50 >
*.memval 1904 !=
start
*.refvelup .up store
*.refveldx .dx store
stop

cond
*.eye9 0 =
*.eye8 0 =
*.eye7 0 =
*.eye6 0 =
*.eye5 0 =
*.eye4 0 =
*.eye3 0 =
*.eye2 0 =
*.eye1 0 =
*.spin 20 <
start
300 .aimsx store
.spin inc
stop

cond
*.memval 1904 =
*.robage 2 >
*.spin 20 <
start
200 .aimsx store
.spin inc
stop

'****************
'* Reproduction *
'****************

cond
*50 1 =
start
628 .aimsx store
0 50 store
stop

cond
*.nrg 1000 >
*.body 500 >
*.eye5 50 <
start
628 .aimsx store
51 .repro store
1 50 store
stop

cond
*.robage 0 =
start
955 4 rnd add .memloc store
1904 955 store
1904 956 store
1904 957 store
1904 958 store
1904 959 store
1 .tie store
0 .out1 store
0 .aimsx store
.shoot .vloc store
.shoot .ploc store
100 .mkshell store
100 .strpoison store
stop

cond
*.robage 1 =
start
1 .deltie store
314 .aimsx store
stop

'********
'* Body *
'********

cond
*.body 20 >
*.nrg 500 <
start
100 .fdbody store
stop

cond
*.nrg 1000 >
*.robage 2 >
start
100 .strbody store
stop

'****************
'* Adaptive Armour *
'****************
'1 poison
'2 shell
'3 Poison + Shell

cond
*.in1 *.out1 !=
*.in1 0 !=
*.out1 3 <
*.memval 1904 =
start
*.in1 .out1 store
stop

cond
*.shflav -1 =
*.shflav 0 > or
*.out1 2 <
start
1 .out1 store
stop

cond
*.shflav -1 =
*.shflav 0 > or
*.out1 2 =
start
3 .out1 store
stop

cond
*.shflav -6 =
*.shflav -3 = or
*.out1 0 <
start
2 .out1 store
stop

cond
*.shflav -6 =
*.shflav -3 = or
*.out1 1 =
start
3 .out1 store
stop

cond
*.nrg 500 >
*.poison 500 <
*.out1 1 =
*.out1 3 = or
start
100 .strpoison store
stop

cond
*.nrg 500 >
*.shell 450 <
*.out1 1 >
start
500 *.shell sub .mkshell store
stop

cond
*.numties 0 >
*.robage 10 >
start
*.tiepres .tienum store
.tieval .tieloc store
3000 .tieval store
*.tiepres .deltie store
*.tieval 3000 div .tieloc store
.sharewaste inc
stop

'************
'* Shooting *
'************

cond
*.waste 100 >
start
*.waste .shootval store
-4 .shoot store
stop

cond
*.memval 1904 !=
*.eye5 5 >
*.refnrg 1500 <
*.refshell 50 > or
*.refpoison 0 = or
start
*.refxpos *.refypos dist 100 div -1 mult .shootval store
-1 .shoot store
stop

cond
*.memval 1904 !=
*.eye5 5 >
*.robage 1 >
start
' *.refxpos *.refypos dist 100 div -1 mult *.refxpos *.refypos dist 500 div sub .shootval store
*.refxpos *.refypos dist 100 div -1 mult .shootval store
-6 .shoot store
stop

cond
*.venom 100 <
start
100 *.venom sub 0 floor 100 ceil .strvenom store
stop

cond
*.count 0 >
start
.count dec
stop

cond
*.memval 1904 !=
*.eye5 20 >
' *.refpoison 0 =
*.count 0 =
*.refeye 0 >
start
.shoot .vloc store
-3 .shoot store
-2 .venval store
50 .shootval store
5 .count store
stop

cond
*.memval 1904 !=
*.eye5 20 >
*.count 0 =
*.refeye 0 >
*.refshell 5 >
start
.mkshell .vloc store
-3 .shoot store
-200 .venval store
50 .shootval store
0 .count store
stop

cond
*.genes 33 !=
*.sexrepro 0 != or
*.mrepro 0 != or
start
0 .repro store
0 .sexrepro store
0 .mrepro store
stop

cond
*.delgene 0 !=
*.shoot -2 = or
start
0 .delgene store
0 .shoot store
stop

'venom reloading
cond
*.venom 200 <
*.nrg 1200 >
start
100 .strvenom store
stop

'poison reloading
cond
*.poison 400 <
*.nrg 1100 >
start
100 .strpoison store
stop

'increasing shell
cond
*.shell 250 <
*.nrg 1500 >
start
100 .mkshell store
stop

'restoring venval if wrong
'restoring vloc if wrong
cond
*.venval -2 !=
*.vloc .shoot !=
start
-2 .venval store
.shoot .vloc store
stop

'countershooting venom
cond
*.shflav 0 !=
*.shflav -2 !=
start
*.shang .aimshoot store
100 .shootval store
-3 .shoot store
0 .shflav store
stop

'setting up venval vloc and ploc at birth
cond
*.robage 0 =
start
100 .strvenom store
.tie inc
-2 .venval store
.shoot .vloc store
.shoot .ploc store
stop

'deleting birthtie
cond
*.robage 1 =
start
.deltie inc
stop

'setting venval back if it is zero, yes I know it is double,
'but if I change this I have to change the last gene too smile.gif.
'that is so much work.
cond
*.venval 0 =
start
-2 .venval store
stop

'secret, well no, if someone if funny enough to set ploc to zero, this sets vloc to zero.
cond
*.ploc 0 =
start
.vloc .ploc store
stop

'shoots poison
cond
*.eye5 25 >
*.refeye *.myeye !=
*.memval -2 !=
*.refeye 0 !=
start
50 .shootval store
-3 .shoot store
stop

'setting outer eyes
start
460 .eye9width store
520 .eye9dir store
460 .eye1width store
-520 .eye1dir store
stop



'if opponent go closer
cond
*.eye5 0 >
*.refeye *.myeye !=
*.refshoot *.myshoot !=
or
*.eye5 45 <
start
*.refxpos *.refypos angle .setaim store
*.refveldx .dx store
*.refvelup 50 add .up store
stop

'turn if shooting nrg or if another multuply in front.
cond
-2 *.shoot =
*.refeye *.myeye =
*.eye5 0 !=
and
or
start
0 .shoot store
0 .shootval store
100 .aimdx store
stop

'turning
cond
*.eye5 0 =
start
10 .up store
*.eye9 *.eye1 sub 4 mult .aimdx store
*.eye8 *.eye2 sub 3 mult .aimdx store
*.eye7 *.eye3 sub 2 mult .aimdx store
*.eye4 *.eye6 sub .aimsx store
stop

'selecting favor for -6
cond
*.refeye *.myeye !=
*.refshoot *.myshoot !=
or
*.refpoison *.refshell =>
*.eye5 0 >
start
16 .shootval store
-6 .shoot store
stop

'selecting favor for -1
cond
*.refeye *.myeye !=
*.refshoot *.myshoot !=
or
*.refpoison *.refshell <
*.eye5 0 >
start
16 .shootval store
-1 .shoot store
stop

'if nothing speed up
cond
*.eye3 0 =
*.eye4 0 =
*.eye6 0 =
*.eye7 0 =
start
100 .up store
stop


'get rid of waste
cond
*.waste 100 >
start
*.waste .shootval store
-4 .shoot store
stop

'reproduce
cond
*.nrg 4000 >
*.eye5 0 =
start
50 .repro store
628 .aimleft store
100 .strbody store
stop

'if something wrong duplicate and give all nrg to offspring
cond
*.paralyzed 25 >
*.poisoned 25 > or
*.pwaste 25 > or
start
99 .repro store
stop



'more body become bigger
cond
*.nrg 1000 >
*.body 500 <
start
100 .strbody store
stop

'leaching
cond
*.tiepres 0 >
start
*.tiepres .tienum store
.tieval .tieloc store
1000 .tieval store
stop

'if low on nrg pump body back.
cond
*.nrg 250 <
start
100 .fdbody store
stop


'if it has pain run
cond
*.nrg 250 <
*.pain 50 >
start
250 .sx store
stop


'stop fixing
cond
*.fixed 0 !=
start
0 .fixpos store
stop


'this gene checks if anything that can be made is negative, if so unnegative it.
cond
*.mkshell 0 <
*.mkshell 0 < or
*.strvenom 0 < or
*.strpoison 0 < or
start
0 .mkshell store
0 .mkshell store
0 .strvenom store
0 .strpoison store
stop

'viruschecker
cond
*.genes 27 !=
*.sexrepro 0 != or
*.mrepro 0 != or
start
0 .repro store
0 .sexrepro store
0 .mrepro store
0 .mkvirus store
0 .vshoot store
0 .delgene store
stop

cond
*.realgenes *.genes !=
start
*.genes .realgenes store
stop

cond
*.rightgenes 0 =
start
*.genes .rightgenes store
stop

cond
*.robage 0 =
start
*.tiepres .deltie store
100 .eye1width store
100 .eye9width store
.key 971 store
.key 972 store
1 rnd .random store
971 *.random add .memloc store
971 *.random add .tmemloc store
.shoot .vloc store
-2 .venval store
.setaim .ploc store
stop

cond
*.robage 0 =
*.spread 1 =
start
682 .aimsx store
stop

cond
*.numties 0 >
*.eye5 50 >
*.memval .key !=
start
.tieloc .shoot store
stop

cond
*.numties 0 >
*.trefnrg 2000 >=
*.trefbody 300 < or
*.totalmyspecies 100 < or
start
-1 .shootval store
stop

cond
*.numties 0 >
*.trefnrg 2000 <
*.trefbody 300 >=
*.totalmyspecies 100 >=
start
-6 .shootval store
stop

cond
*.numties 0 >
*.tmemval .key =
start
*.tiepres .deltie store
stop

cond
*.eyef 0 >
*.memval .key !=
*.refshell 0 !=
*.refeye 0 != or
*.refshoot 0 != or
*.memval 0 != or
start
0 .hunt store
*.refxpos .out3 store
*.refypos .out4 store
1 .out5 store
stop

cond
*.eyef 0 =
*.memval .key = or
start
0 .out3 store
0 .out4 store
stop

cond
*.in3 0 !=
*.in4 0 !=
*.eyef 0 >
*.memval .key =
*.totalmyspecies 150 >
*.in5 *.huntnr <=
*.huntnr 0 = or
start
*.robage .hunt store
*.in3 .huntx store
*.in4 .hunty store
*.in5 .huntnr store
stop

cond
*.hunt 3 add *.robage <
start
0 .huntnr store
stop

cond
*.in3 0 !=
*.in4 0 !=
*.eyef 0 >
*.memval .key =
*.totalmyspecies 150 >
'*.robage 5 mod 0 =
*.in5 3 <
start
*.in3 .out3 store
*.in4 .out4 store
*.in5 1 add .out5 store
stop

cond
*.hunt .hunttime add *.robage >=
*.nrg 100 >
*.robage 20 >
start
0 .focuseye store
*.huntx *.hunty angle .setaim store
*.huntx *.xpos sub abs *.hunty *.ypos sub abs pyth 10 div 10 sub 10 *.huntnr mult sub 50 ceil .up store
*.velsx .dx store
stop

cond
*.eyef 0 =
*.memval .key = or
*.robage .cycle mod .switch <=
*.pain .ouch <
*.robage 10 >
*.hunt .hunttime add *.robage <
start
120 .aimsx store
0 .focuseye store
stop

cond
*.eyef 0 =
*.robage .cycle mod .switch >
*.hunt .hunttime add *.robage <
start
*.body 10 div 50 add .up store
stop

cond
*.eyef 0 !=
*.memval .key =
*.robage .cycle mod .switch >
*.pain .ouch <
*.hunt .hunttime add *.robage <
start
*.refvelup 10 add .up store
*.refveldx .dx store
stop

cond
*.eyef 0 =
*.memval .key = or
*.robage 3 mod 0 =
*.pain .ouch <
*.hunt .hunttime add *.robage <
start
0 .focuseye store
stop

cond
*.eyef 0 =
*.memval .key = or
*.robage 3 mod 1 =
*.pain .ouch <
*.hunt .hunttime add *.robage <
start
-4 .focuseye store
stop

cond
*.eyef 0 =
*.memval .key = or
*.robage 3 mod 0 =
*.pain .ouch <
*.hunt .hunttime add *.robage <
start
4 .focuseye store
stop

cond
*.eyef 0 >
*.memval .key !=
*.pain .ouch >= or
start
*.refveldx .dx store
stop

cond
*.eyef 0 >
*.memval .key !=
*.numties 0 =
*.pain .ouch <
start
*.refxpos *.refypos angle .setaim store
0 .focuseye store
stop

cond
*.eyef 0 >
*.memval .key =
*.numties 0 =
*.spread 0 =
*.robage 20 >= or
*.pain .ouch >=
*.robage .cycle mod .switch >
*.totalmyspecies 150 > and or
*.hunt .hunttime add *.robage <
start
*.refxpos *.refypos angle .setaim store
0 .focuseye store
stop

cond
*.eyef 0 >
*.memval .key !=
*.pain .ouch >= or
*.refxpos *.xpos sub abs *.refypos *.ypos sub abs pyth 150 >
start
*.refvelup *.refxpos *.xpos sub abs *.refypos *.ypos sub abs pyth 10 div add .up store
stop

cond
*.eyef 0 >
*.memval .key !=
*.pain .ouch >= or
*.refxpos *.xpos sub abs *.refypos *.ypos sub abs pyth 150 <=
start
*.refvelup .up store
stop

cond
*.eye5 0 >
*.focuseye 0 =
*.memval .key !=
*.totalmyspecies 70 <
*.numties 0 =
*.refshell 0 !=
*.refeye 0 != or
*.refshoot 0 != or
*.memval 0 != or
start
0 .up store
*.refveldx 20 add .dx store
*.refvelup 20 add .dn store
stop

cond
*.eye5 0 >
*.focuseye 0 =
*.memval .key !=
*.numties 0 =
*.refshell 0 =
*.refeye 0 =
*.refshoot 0 =
*.memval 0 =
start
1 .tie store
-6 .shoot store
stop

cond
*.eyef 0 >
*.memval .key !=
*.focuseye 0 =
*.numties 0 =
*.body 50 >
start
-6 .shoot store
stop

cond
*.nrg 100 >
*.body 100 >
*.nrg *.body 2 mult <
start
100 .fdbody store
stop

cond
*.body 400 >
*.nrg *.body 3 mult >
start
100 .strbody store
stop

cond
*.nrg 11000 >
*.nrg *.body >
start
1000 .strbody store
stop

cond
*.robage 5 mod 0 =
*.eye5 20 >
*.focuseye 0 =
*.memval .key !=
*.venom 5 >
start
-3 .shoot store
stop

cond
*.numties 0 >
*.robage 5 mod 0 =
start
.tieloc .vloc store
-1 .venval store
stop

cond
*.numties 0 >
*.robage 5 mod 0 =
*.totalmyspecies 100 >
start
-6 .venval store
stop

cond
*.numties 0 =
*.robage 5 mod 0 =
start
.shoot .vloc store
-2 .venval store
stop

cond
*.robage 0 =
*.spread 0 !=
start
682 .aimsx store
stop

cond
*.nrg 3000 %=
*.body 1000 %=
*.totalmyspecies 70 <
start
1 .spread store
stop

cond
*.spread 0 !=
*.nrone 0 =
*.robage 20 <
*.eye5 0 >
*.memval .key =
start
200 .aimsx store
*.velsx .dx store
50 .up store
stop

cond
*.spread 0 !=
*.robage 20 >
*.totalmyspecies 70 >
start
0 .spread store
stop

cond
*.shell 100 <
*.nrg 100 >
*.totalmyspecies 70 >
start
20 .mkshell store
stop

cond
*.venom 100 <
*.nrg 80 >
*.totalmyspecies 60 >
start
20 .strvenom store
stop

cond
*.poison 50 <
*.nrg 100 >
*.totalmyspecies 70 >
start
10 .strpoison store
stop

cond
*.nrg 100 <
*.body 10 >
start
50 .fdbody store
stop

cond
*.nrg 100 >
*.robage 10 <
*.eyef 0 =
*.memval .key = or
start
50 .up store
stop

cond
*.numties 0 >
*.robage 5 mod 0 =
start
*.tiepres .delties store
stop

cond
*.fixpos 0 !=
start
0 .fixpos store
stop

cond
*.numties 0 >
start
*.tiepres .tienum store
40 .stifftie store
1 .tielen store
99 .sharenrg store
.tieval .tieloc store
1000 .tieval store
*.trefxpos *.trefypos angle .setaim store
0 .focuseye store
stop

cond
*.numties 0 >
*.robage 9 mod 0 =
*.robage 10 >
start
.fixpos .tieloc store
1 .tieval store
stop

cond
*.nrg 300 >
*.body 100 > and
*.totalmyspecies 100 < and
*.nrg 1000 >
*.body 300 > and
*.totalmyspecies 100 >= and or
start
52 .repro store
stop

cond
*.shoot 0 !=
*.shoot -1 !=
*.shoot -3 !=
*.shoot -4 !=
*.shoot -6 !=
*.shoot .tieloc !=
start
0 .shoot store
0 .shootval store
stop

cond
*.strbody 0 <
start
0 .strbody store
stop

cond
'*.repro 22 !=
*.repro 52 !=
*.repro 0 !=
start
0 .repro store
stop

cond
*.realgenes *.rightgenes !=
start
0 .vshoot store
0 .sexrepro store
0 .mrepro store
0 .mkvirus store
1 .mkshell store
1 .strvenom store
0 .strpoison store
0 .mkslime store
0 .aimsx store
0 .aimdx store
0 .dn store
0 .sx store
0 .fdbody store
0 .fixpos store
0 .delgene store
stop

start
true
0 .shoot store
0 .tie store
0 .tieloc store
0 .ploc store
0 .vloc store
0 .delgene store
*.shell - .mkshell store
*.poison - .strpoison store
stop

start
*.vtimer 0 =
*.genes rnd .mkvirus store
*.timer 3 mod 0 = and
*.thisgene .mkvirus store
*.vtimer 1 =
*.robage 500 mod 0 = and
10 .vshoot store

*971 0 =
*.genes 971 store

*.robage 0 =
*971 *.genes = and
100 rnd 20 < and
971 inc

*971 *.genes <
*.genes rnd .delgene store
stop

As for the codebox I just select it from the menu to the left, not sure why it comes up that way.