Darwinbots Forum
Bots and Simulations => Bestiary => F2 bots => Topic started by: Moonfisher on April 30, 2008, 09:26:31 PM
-
No more easy conspecs if you want to beat spinner
No major changes appart from the conspec...
And replaced the conspec breaking tie action with one that causes mrepro, since there's no point stealing a bots key and then break it's conspec... or maybe there is... but wanted to take full advantage of the stolen key
I also included an alge that should allow you to test if your conspec is safe.
(It uses the same tricks as spinner)
If you can get up close and feed from it then your conspec should be relatively safe.
Spinner :
'Spinner v1.4 (F2) 01-05-08
'by Moonfisher
'Changed the conspec again
'Now it also steals simple conspecs
'Changed a few other small things
'But it's basicaly the same
'And tried making it a litle easyer to read.
'------------------- vars
def seteyes 50
def seteyewidth 51
def seteyespace 52
def setoffset 53
def state 54
def repspin 55
def randm 56
def keyloc 57
def oponent 58
def birthstate 971
def birthx 972
def birthy 973
'-------------------- constants
def spineyewidth 0
def spineyespace 105
def spinoffset 140
def scaning 1
def torpedo 2
'0 is nothing
def friend 13
def enemy 14
def alge 15
def key1 23
def key2 403
def key3 506
def key4 102
def key5 1053
def startkey 110
def startloc 120
def locs 5 '--- Must correcpond to the amount of different tie actions
'Set locs to 4 to disable instant kill using .shootval
'Set locs to 3 to disable .strbody killing aswell
'================================================
'----- Birth
cond
*.robage 0 =
start
4 rnd .randm store
.startkey *.randm add .keyloc store
.memloc .memloc store
.tmemloc .tmemloc store
.key1 .startkey store
.key2 .startkey 1 add store
.key3 .startkey 2 add store
.key4 .startkey 3 add store
.key5 .startkey 4 add store
'-------Tie actions (5)
.eye5dir .startloc store
682 .startloc 1 add store
.vloc .startloc 2 add store
174 .startloc 3 add store
'.memloc .startloc 4 add store '-- Funny, but no point in both stealing keys and breaking conspecs
'173 .startloc 5 add store
.mrepro .startloc 4 add store
50 .startloc 5 add store
.shootval .startloc 6 add store
31999 .startloc 7 add store
.strbody .startloc 8 add store
31999 .startloc 9 add store
.deltie inc
stop
cond
*.robage 0 =
*.birthstate 0 =
start
.scaning .state store
stop
cond
*.robage 0 =
*.birthstate 0 !=
*.state 0 =
start
*.birthstate .state store
stop
cond
*.birthstate 0 !=
start
0 .birthstate store
stop
cond
*.robage 0 =
*.state .scaning =
start
1 .seteyes store
.spineyewidth .seteyewidth store
.spineyespace .seteyespace store
.spinoffset .setoffset store
.shoot .vloc store
-2 .venval store
.shoot .ploc store
stop
cond
*.robage 0 =
*.state .torpedo =
start
1 .seteyes store
.spineyewidth .seteyewidth store
.spineyespace .seteyespace store
.spinoffset .setoffset store
.shoot .vloc store
-2 .venval store
.shoot .ploc store
stop
cond
*.seteyes 1 =
start
*.setoffset .eye9dir store
*.setoffset *.seteyespace add .eye8dir store
*.setoffset *.seteyespace 2 mult add .eye7dir store
*.setoffset *.seteyespace 3 mult add .eye6dir store
*.setoffset *.seteyespace 4 mult add .eye5dir store
*.setoffset *.seteyespace 5 mult add .eye4dir store
*.setoffset *.seteyespace 6 mult add .eye3dir store
*.setoffset *.seteyespace 7 mult add .eye2dir store
*.setoffset *.seteyespace 8 mult add .eye1dir store
4 .focuseye store
0 .seteyes store
stop
'================================================
'================================================
'----- Conspec
start
*.keyloc .out9 store
*.keyloc * .out8 store
stop
cond
*.numties 0 >
start
*.keyloc .tout9 store
*.keyloc * .tout8 store
stop
cond
*.eye9 0 >
*.in8 *.in9 * =
*.in9 * 0 !=
start
.friend .oponent store
stop
cond
*.eye9 0 >
*.in8 *.in9 * !=
*.in9 * 0 = or
start
.enemy .oponent store
stop
cond
*.refeye 0 =
*.refshoot 0 =
*.refshell 0 =
*.revenom 0 =
*.refpoison 0 =
*.refvenom 0 =
*.eye9 0 >
start
.alge .oponent store
stop
cond
*.eye9 0 =
*.robage 0 = or
start
0 .oponent store
stop
'----- Poser conspecs
cond
*.memloc .memloc !=
*.memval 0 !=
start
*.memval *.memloc store
stop
cond
*.memloc .memloc !=
start
.memloc .memloc store
stop
cond
*.eye9 0 >
*.memloc .memloc =
*.memval 0 >
*.memval .memloc !=
start
*.memval .memloc store
stop
cond
*.tmemloc .tmemloc !=
*.tmemval 0 !=
start
*.tmemval *.tmemloc store
stop
cond
*.tmemloc .tmemloc !=
start
.tmemloc .tmemloc store
stop
cond
*.numties 0 >
*.tmemloc .tmemloc =
*.tmemval 0 >
*.tmemval .tmemloc !=
start
*.tmemval .tmemloc store
stop
cond
*.eye9 0 >
*.in8 *.in9 * !=
*.in9 * 0 = or
start
*.in1 .out1 store
*.in2 .out2 store
*.in3 .out3 store
*.in4 .out4 store
*.in5 .out5 store
*.in6 .out6 store
*.in7 .out7 store
*.in10 .out10 store
stop
cond
*.numties 0 >
*.tin8 *.tin9 * !=
*.tin9 * 0 = or
start
*.tin1 .tout1 store
*.tin2 .tout2 store
*.tin3 .tout3 store
*.tin4 .tout4 store
*.tin5 .tout5 store
*.tin6 .tout6 store
*.tin7 .tout7 store
*.tin10 .tout10 store
stop
'================================================
cond
*.state .torpedo =
*.oponent .alge =
*.nrg 500 >
start
.scaning .state store
stop
'================================================
'----- Shooting
cond
*.state .scaning =
*.eye9 0 >
*.oponent .enemy =
*.oponent .alge = or
start
*.refxpos *.refypos angle .setaim store
*.refxpos *.xpos sub abs *.refypos *.ypos sub abs pyth 5 div 30 sub 0 floor 100 ceil *.refvelup add .up store
*.refveldx .dx store
-6 .shoot store
*.refxpos .out4 store
*.refypos .out5 store
stop
cond
*.poisoned 0 =
*.body 50 >
*.state .scaning =
*.eye9 55 >
*.oponent .enemy =
*.oponent .alge = or
start
*.nrg 30 div 20 ceil *.eye9 40 sub 0 floor sgn *.body 40 sub 0 floor sgn mult mult 1 floor .shootval store
stop
cond
*.eye9 0 =
*.oponent .friend = or
*.out4 0 !=
*.out5 0 != or
start
0 .out4 store
0 .out5 store
stop
cond
*.state .scaning =
*.eye9 0 >
*.oponent .enemy =
*.robage 5 mod 0 =
*.venom 1 >
start
-3 .shoot store
0 .shootval store
stop
cond
*.state .scaning =
*.eye9 0 >
*.robage 10 mod 0 =
*.oponent .alge =
*.venom 1 >
start
-3 .shoot store
0 .shootval store
stop
cond
*.state .scaning =
*.eye9 0 >
*.robage 10 mod 1 =
*.oponent .alge =
*.venom 1 >
start
.setaim .shoot store
*.refxpos *.refypos angle 682 add .shootval store
stop
'================================================
'================================================
'----- Spread
cond
*.state .scaning =
*.state .torpedo = or
*.eye9 0 =
*.robage 20 mod 16 >=
*.robage 200 >= or
start
*.aim 35 add .setaim store
stop
cond
*.state .scaning =
*.state .torpedo = or
*.eye9 0 =
*.robage 20 mod 16 <
*.robage 200 <
start
20 .dx store
stop
cond
*.state .scaning =
*.state .torpedo = or
*.eye9 0 !=
*.oponent .friend =
*.robage 20 mod 16 >=
*.robage 200 >= or
start
*.aim 35 add .setaim store
stop
cond
*.state .scaning =
*.state .torpedo = or
*.eye9 0 !=
*.oponent .friend =
*.robage 20 mod 16 <
*.robage 200 <
start
20 .dx store
stop
cond
*.state .scaning =
*.state .torpedo = or
*.robage 100 >=
*.robage 1000 <
*.eye9 0 =
*.robage 20 mod 10 >
start
20 .dx store
stop
'================================================
'================================================
'----- Aim
cond
*.state .scaning =
*.state .torpedo = or
*.eye9 0 =
*.robage 20 >
*.oponent .friend = and or
*.eye1 0 >
start
*.aim *.eye1dir add .setaim store
stop
cond
*.state .scaning =
*.state .torpedo = or
*.eye9 0 =
*.robage 20 >
*.oponent .friend = and or
*.eye2 0 >
start
*.aim *.eye2dir add .setaim store
stop
cond
*.state .scaning =
*.state .torpedo = or
*.eye9 0 =
*.robage 20 >
*.oponent .friend = and or
*.eye3 0 >
start
*.aim *.eye3dir add .setaim store
stop
cond
*.state .scaning =
*.state .torpedo = or
*.eye9 0 =
*.robage 20 >
*.oponent .friend = and or
*.eye4 0 >
start
*.aim *.eye4dir add .setaim store
stop
cond
*.state .scaning =
*.state .torpedo = or
*.eye9 0 =
*.robage 20 >
*.oponent .friend = and or
*.eye5 0 >
start
*.aim *.eye5dir add .setaim store
stop
cond
*.state .scaning =
*.state .torpedo = or
*.eye9 0 =
*.robage 20 >
*.oponent .friend = and or
*.eye6 0 >
start
*.aim *.eye6dir add .setaim store
stop
cond
*.state .scaning =
*.state .torpedo = or
*.eye9 0 =
*.robage 20 >
*.oponent .friend = and or
*.eye7 0 >
start
*.aim *.eye7dir add .setaim store
stop
cond
*.state .scaning =
*.state .torpedo = or
*.eye9 0 =
*.robage 20 >
*.oponent .friend = and or
*.eye8 0 >
start
*.aim *.eye8dir add .setaim store
stop
cond
*.state .scaning =
*.state .torpedo = or
*.eye9 0 >
*.oponent .friend =
*.in4 0 !=
*.in5 0 != or
*.in4 *.in5 dist 1000 <
start
*.in4 *.in5 angle .setaim store
20 .dx store
stop
'================================================
'================================================
'----- Reproduction
cond
*.state .scaning =
*.eye9 0 =
*.oponent .friend = or
*.nrg 3100 > or
*.nrg 300 >
*.body 100 > and
*.totalmyspecies 70 < and
*.nrg 500 >
*.body 100 > and
*.totalmyspecies 70 >= and or
*.repspin 0 =
start
*.robage 1 add .repspin store
stop
cond
*.robage 1 =
*.totalmyspecies 5 =
*.nrg 3000 %=
*.body 1000 =
start
*.robage 1 add .repspin store
stop
cond
*.state .scaning =
*.repspin 0 >
*.repspin 1 add *.robage =
start
*.aim 511 add .setaim store
0 .up store
0 .dx store
stop
cond
*.state .scaning =
*.repspin 0 >
*.repspin 2 add *.robage =
start
*.aim 341 add .setaim store
0 .up store
0 .dx store
stop
cond
*.state .scaning =
*.repspin 0 >
*.repspin 3 add *.robage =
start
*.aim 511 add .setaim store
0 .up store
0 .dx store
stop
cond
*.state .scaning =
*.repspin 15 add *.robage <
*.repspin 0 !=
start
0 .repspin store
stop
cond
*.state .scaning =
*.repspin 0 >
*.nrg 300 >
*.body 100 >
*.repspin 1 add *.robage =
*.repspin 2 add *.robage = or
*.totalmyspecies 70 <
*.eye9 0 =
*.oponent .friend = or
*.oponent .alge = or
start
32 .repro store
0 .shoot store
stop
cond
*.state .scaning =
*.repspin 0 >
*.nrg 500 >
*.body 100 >
*.repspin 1 add *.robage =
*.repspin 2 add *.robage = or
*.totalmyspecies 70 >=
*.eye9 0 =
*.oponent .friend = or
*.oponent .alge = or
start
32 .repro store
0 .shoot store
stop
cond
*.state .scaning =
*.repspin 0 >
*.oponent .enemy =
*.eye9 0 !=
*.nrg 300 >
*.body 100 >
*.repspin 1 add *.robage =
*.repspin 2 add *.robage = or
start
*.refxpos .birthx store
*.refypos .birthy store
.torpedo .birthstate store
5 .repro store
0 .shoot store
stop
'================================================
'================================================
'----- Body and such + some defence stuff
cond
*.state .scaning =
*.nrg 200 >
*.body 500 <
*.totalmyspecies 70 > or
start
100 .strbody store
stop
cond
*.state .scaning =
*.nrg 100 <
*.body 20 >
start
100 .fdbody store
stop
cond
*.state .scaning =
*.shell 50 <
*.nrg 50 >
start
20 .mkshell store
stop
cond
*.state .scaning =
*.shell 200 <
*.nrg 180 >
*.body 120 >
start
200 *.shell sub .mkshell store
stop
cond
*.state .scaning =
*.venom 50 <
*.nrg 20 >
start
50 *.venom sub .strvenom store
stop
cond
*.state .scaning =
*.shell 300 <
*.nrg 200 >
*.body 100 >
*.eye9 0 >
*.oponent .enemy =
*.refvelscalar 20 > or
start
300 *.shell sub .mkshell store
stop
cond
*.state .scaning =
*.shflav 0 !=
*.shflav -2 !=
*.shflav -3 !=
*.nrg 80 >
*.venom 5 >
start
*.shang .setaim store
-3 .shoot store
10 .shootval store
stop
cond
*.state .scaning =
*.shflav 0 !=
*.shflav -2 !=
*.shflav -3 !=
*.nrg 80 >
*.venom 5 <=
start
*.shang .setaim store
.setaim .shoot store
*.refaim 682 add .shootval store
stop
cond
*.fixpos 0 !=
start
0 .fixpos store
stop
cond
*.state .scaning =
*.pain 60 >
*.shflav 0 !=
*.shflav -2 !=
start
*.maxvel .dx store
stop
cond
*.shflav 0 !=
start
0 .shflav store
stop
start
.deltie inc
stop
'Not sure counter leeching is legal for F2
'If it isn't, then use the other tie value...
cond
*.numties 0 >
*.robage 1 >
*.tiepres 0 >
start
*.tiepres .tienum store
.tieval .tieloc store
31000 .tieval store
'0 .tieval store '-- This can be safer, helps against EtchII, but only delay's the inevitable.
*.tiepres .deltie store
stop
'================================================
'================================================
'----- Torpedoes
cond
*.state .scaning =
*.oponent .enemy =
*.eye9 0 !=
*.eye9 10 <
*.body 500 >
*.totalmyspecies 50 <
*.refshell 0 >
*.refshell *.refbody add *.refnrg add *.shell *.body add *.nrg add > '-not great...
start
*.refxpos .birthx store
*.refypos .birthy store
.torpedo .birthstate store
5 .repro store
0 .shoot store
stop
cond
*.robage 1 >
*.body *.nrg add 200 <
*.oponent .alge !=
*.eye9 0 = or
start
.torpedo .state store
stop
cond
*.robage 0 =
*.state .torpedo =
start
*.birthx *.birthy angle .setaim store
stop
cond
*.state .torpedo =
*.body 1 >
start
*.body 10 mult 10 sub 0 floor .fdbody store
stop
cond
*.state .torpedo =
*.oponent .enemy =
*.numties 0 =
*.eye9 0 !=
start
*.refxpos *.refypos angle .setaim store
*.refxpos *.xpos sub abs *.refypos *.ypos sub abs pyth 10 div 30 sub 0 floor 100 ceil *.refvelup add .up store
*.refveldx .dx store
*.refvelsx .sx store
1 .tie store
.eye5dir .tieloc store
.spinoffset .spineyespace 4 mult add .tieval store
stop
cond
*.state .torpedo =
*.oponent .alge =
*.eye9 0 >
start
0 .up store
0 .dx store
0 .sx store
0 .tie store
*.aim *.eye8dir add .setaim store
stop
cond
*.state .torpedo =
*.tin8 *.tin9 * !=
*.tin9 * 0 = or
*.numties 0 >
*.robage 0 >
start
*.tiepres .tienum store
.locs 1 sub rnd 2 mult .startloc add dup * .tieloc store
1 add * .tieval store
40 .stifftie store
200 .fixlen store
*.trefxpos *.trefypos angle .setaim store
*.trefvelup .up store
*.trefveldx .dx store
0 .deltie store
stop
cond
*.state .torpedo =
*.tin8 *.tin9 * =
*.tin9 * 0 !=
*.numties 0 >
start
*.tiepres .deltie store
stop
start
.fixpos dec
stop
'================================================
'================================================
'----- Viral and mem defence.
'Haven't realy gotten around to make a propper defence.
cond
*.keyloc .startkey *.randm add !=
*.venval -2 != or
*.vloc .shoot != or
start
.startkey *.randm add .keyloc store
-2 .venval store
.shoot .vloc store
stop
cond
*.vtimer 0 !=
start
0 .vshoot store
stop
cond
*.repro 0 !=
*.repro 32 !=
*.repro 5 !=
start
0 .repro store
stop
cond
*.delgene 0 !=
start
0 .delgene store
stop
'================================================
end
[b]The test alge :[/b]
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']'Alge for testing your conspec
'If you can't get up close and feed on this
'Then your conspec is obviously vulnerable to these genes
cond
*.robage 0 =
start
.memloc .memloc store
.tmemloc .tmemloc store
100 .eye5width store
stop
cond
*.memloc .memloc !=
*.memval 0 !=
start
*.memval *.memloc store
stop
cond
*.memloc .memloc !=
start
.memloc .memloc store
stop
cond
*.eye9 0 >
*.memloc .memloc =
*.memval 0 >
*.memval .memloc !=
start
*.memval .memloc store
stop
cond
*.tmemloc .tmemloc !=
*.tmemval 0 !=
start
*.tmemval *.tmemloc store
stop
cond
*.tmemloc .tmemloc !=
start
.tmemloc .tmemloc store
stop
cond
*.numties 0 >
*.tmemloc .tmemloc =
*.tmemval 0 >
*.tmemval .tmemloc !=
start
*.tmemval .tmemloc store
stop
cond
*.eyef 0 >
start
*.in1 .out1 store
*.in2 .out2 store
*.in3 .out3 store
*.in4 .out4 store
*.in5 .out5 store
*.in6 .out6 store
*.in7 .out7 store
*.in8 .out8 store
*.in9 .out9 store
*.in10 .out10 store
stop
cond
*.numties 0 >
start
*.tin1 .tout1 store
*.tin2 .tout2 store
*.tin3 .tout3 store
*.tin4 .tout4 store
*.tin5 .tout5 store
*.tin6 .tout6 store
*.tin7 .tout7 store
*.tin8 .tout8 store
*.tin9 .tout9 store
*.tin10 .tout10 store
stop
cond
*.eyef 0 =
start
*.aim 70 add .setaim store
stop
cond
*.shflav 0 !=
start
*.shang - *.aim add .setaim store
0 .shflav store
stop
end
-
I like the idea of the test veggy.
-
Heh yeah I figured it would be a lot easyer to check conspecs that way...
I also though about exanding the alge a litle, let it reproduce and pass allong the saved .memloc/.memval keys, and have a lot of genes with a shoot or eye or tie comand in it and delete the genes if what it sees has less shoot/eye/tie commands, and spread them as a virus if the oponent has more...
Basicaly try to slowly addapt to any simple conspec while running away...
Release it on IM so you would either need a propper conspec or no conspec at all
Would probably only work one way though... only deleting genes... it would be easy to spread the conspec to other bots since they'll just addapt to anything they see...
Ofcourse something like alga minimalis would break that completely....
I guess it's not so easy to addapt to the realy simple conspecs...
Either way it's still fun for testing... I know excalibur dies out against it rather fast, even with the random .memloc check...
It also hit me I should probably have tested my own conspec against the alge... cause I just did now and it failed
So I have to think of something more clever... or go back to *.refshoot and *.refeye and such... funny how the simplest conspecs seem to be the best...
Think I'll just need to get the *.refage thing into .out10... it was originaly designed to add robage to the key in .out10... but something is wrong with it... theres like 16 cycles of difference somethimes... no clue why...
I'll have to run a few tests and make an update
I'd rather not use *.refshoot and *.refeye, since I want to try and fake those aswell...
But I know refage keys can work, used it in some bot I made earlyer... will just have to have a wider margin of error for the key and seperate the key values as much as possible.
May aswell do something new since it needs to be updated... so stupid to make a test bot and not run my own bot against it