Welcome To Darwinbots > Newbie
Sexual reproduction
Houshalter:
Heres a new version of the virus:
--- Code: ---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
--- End code ---
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.
Moonfisher:
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.
Houshalter:
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.
Numsgil:
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.
Moonfisher:
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.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version