Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Moonfisher

Pages: [1] 2 3
1
Mutations / Fungus Zbot
« on: May 24, 2009, 12:42:14 PM »
Not sure exactly how long it took... been putting it into a new sim at times in roder to change the detailed mutation rates.
Even with higher chance for insertion, and reduced deletion mutations, and the minimum overall mutation rate, it still ended up focusing on code compression.
So currently trying to enter this into the sim with 1/10 of regular mutation rates... maybe that will allow the dna to grow a litle.
Anyway you can just toss it into regular F1 settings, not great for leagues, but it's very stable and mutation resiliant. Probably good for tossing into evo sims or something

Code: [Select]
326 stop
 store
 store

''''''''''''''''''''''''  Gene:  1 Begins at position  5  '''''''''''''''''''''''
 start
 sqr .tie dec
 59 << *.robage 192
''''''''''''''''''''''''  Gene:  1 Ends at position  12  '''''''''''''''''''''''
''''''''''''''''''''''''  Gene:  2 Begins at position  13  '''''''''''''''''''''''
 start
 overbool
 .shoot dec
 ceil >> rnd << << ++ store
 store
 stop
''''''''''''''''''''''''  Gene:  2 Ends at position  25  '''''''''''''''''''''''

This could be cleaned up ofcourse, and I suspect further evolution with the same setting would keep cutting away anything possible to reduce the chance of mutating.

But it seems to me like it would be a nice feature if you could allow the mutation rate to follow the dna length. The longer the dna, the more likely it is to mutate, and code compression may be interesting to observe, but if one wanted to promote compexity it would probably be faster if more dna didn't equal more mutations. Or the bar for regulating overall mutation rates could just be a field allowing a much larger range. (I just hate having to extract the organism to reincert it with new mutation settings, since I can't be sure the one I extracted was the best choice )

2
DNA Tools / SGfying tool.
« on: March 10, 2009, 04:43:49 PM »
Ehm... not 100% sure it isn't full of bugs.
And never realy got some propper safety around and/or so words with or in them like floor can cause problems... unless on the same line as a store
Kinda silly, think it manages it right in the sgfy function, just not all the other places it checks...
Anyway I'll update when/if I fix it.. it should though, since the whole reason I made this was to try and get the hang of regular expressions and perl.

Also it doesn't handle not, xot, dropbool, clearbool, asf asf...

But it can understand a lot, and I think I'll work on the details and all that.

But so far it can translate a lot of bots, and the script should be easy to adjust and fix.
Just write the name of the file you want translated in the $readfile var.
You'll need something to run the script, I use ActivePerl 5.8.9.825 :
link

Tips and tricks for perl and regular expressions are more than welcome.

SGfyer.pl
Code: [Select]
my $readfile = "Filey.txt";

my $writefile = "Sgfied_$readfile";


open(READFILE, "<$readfile");
open(WRITEFILE, ">$writefile");
my @lines = <READFILE>;
my $lineNr = 0;
my $main = 0;
my $header = 1;
my $headerText = "";
my @mainConditionStack;
my @conditionStack;
my $conditions = "";

sub sgfy
{
my $localLine = "$_[0]";
if($localLine =~ m/[\s]*(<=)/){$localLine = "$` 1 sub sub -1 mult sqr dup div$'";}
if($localLine =~ m/[\s]*(>=)/){$localLine = "$` 1 add sub sqr dup div$'";}
if($localLine =~ m/[\s]*(!=)/){$localLine = "$` sub dup div$'";}
if($localLine =~ m/([^!|>|<])=([^!|>|<])/){$localLine = "$`$1sub dup div 1 sub abs$2$'";}
if($localLine =~ m/([^!])<([^!])/){$localLine = "$`$1sub -1 mult sqr dup div$2$'";}
if($localLine =~ m/([^=])>([^=])/){$localLine = "$`$1sub sqr dup div$2$'";}
if($localLine =~ m/[\W]?(and)[\W]?/){$localLine = "$`mult $'";}
if($localLine =~ m/[\W]?(or)[\W]?/){$localLine = "$`add $'";}
return $localLine;
}

sub addCondition
{
my $newLine = "$_[0]";

if($newLine =~ m/([\W\D]{1})([=|>|<]{1})([\W\D]{1})/)
{
if($main){unshift(@mainConditionStack, sgfy("$`$1$2$3"));}
else{unshift(@conditionStack, sgfy("$`$1$2$3"));}
$newLine = "$'";
}

while($newLine =~ m/[\W]?(and)[\W]?/|| $newLine =~ m/[\W]?(or)[\W]?/)
{
if($main){unshift(@mainConditionStack, sgfy("$`$1\n"));}
else{unshift(@conditionStack, sgfy("$`$1\n"));}
$newLine = "$'";
}
}

sub getConditions
{
my $currentConditions = "";
my $bools = 1;

if(@conditionStack == 0 && @mainConditionStack == 0){return "";}

#Non main is backwards
foreach my $cond (@conditionStack)
{
if($bools <= 0){next;}
if($cond =~m/^(mult|add)/){$bools += 2;}
$bools--;
$currentConditions = "$cond$currentConditions";
#if($bools <= 0){continue;}
}
if(!($currentConditions eq "")){$currentConditions = "$currentConditions mult ";}

#Main is backwards, then forwards
$bools = 1;
my @mergedMain = ();
my $mergedMainCond = "";
foreach my $mmcond (@mainConditionStack)
{
if($mmcond =~m/^(mult|add)/){$bools += 2;}
$bools--;
$mergedMainCond = "$mmcond$mergedMainCond";
if($bools <= 0)
{
push(@mergedMain, $mergedMainCond);
$mergedMainCond = "";
$bools = 1;
}
}

$bools = 1;
foreach my $mcond (@mergedMain)
{
if($bools)
{
$bools = 0;
$currentConditions = "$currentConditions $mcond";
next;
}
$currentConditions = "$currentConditions $mcond mult ";
}
$currentConditions = "$currentConditions mult ";

return $currentConditions;
}

print "SGFYING!\n";
foreach my $line (@lines)
{
#Comments
if($line =~ m/^'/)
{
if($header){$headerText = "$headerText$line";}
else{print WRITEFILE $line;}
next;
}

#Not supported
$lineNr++;
if($line =~ m/(\s[*]\s|~=|%=|clearbool|dropbool|dupbool|swapbool|overbool|xor|not)/)
{
print "$1 not supported line $lineNr\n";
next;
}

if($header)
{
$headerText = "$headerText\n'****************\n'*****SGfyed*****\n'****************\n\n";
print WRITEFILE $headerText;
$header = 0;
}

#Pre manage
if($line =~ m/[^*]([.]{1}[\w]+|[\d]+)\s+inc/){$line = "*$1 1 add $1 store\n";}
if($line =~ m/([*.]{1}[\w]+|[\d]+)\s+inc/){$line = "$1 * 1 add $1 store\n";}
if($line =~ m/[^*]([.]{1}[\w]+|[\d]+)\s+dec/){$line = "*$1 1 sub $1 store\n";}
if($line =~ m/([*.]{1}[\w]+|[\d]+)\s+dec/){$line = "$1 * 1 sub $1 store\n";}

#Genes
if($line =~ m/[\W]*cond[\W]*/){$main = 1; next;}
if($line =~ m/[\W]*start[\W]*/){$main = 0; print WRITEFILE "start\n"; next;}
if($line =~ m/[\W]*stop[\W]*/){@mainConditionStack = (); print WRITEFILE "stop\n"; next;}

#Store
if($line =~ m/(store)/)
{
$conditions = getConditions();
$line = "$` $conditions $1$'";
#print $line;
print WRITEFILE $line;
next;
}

#Conditions
if($line =~ m/[=|>|<]/ || $line =~ m/[\W]and[\W]/|| $line =~ m/[\W]or[\W]/){addCondition($line);next;}

print WRITEFILE $line;
}

close(READFILE);
close(WRITEFILE);
print "\nDONE!";

I'd upload the file, but would have to rar it (Not allowed to upload this type of file).
Could SGfy bots like Roto1 and Bubbles... didn't try much else.
Even with the extreme amount of conditions in bubbles the SGfying didn't make any notisable difference.
Litle disapointed, had hoped it might have improved bubbles slightly, but the new and old versions are a clear tie...
I figure cost reduction is only usefull in numreous micro bots with low energy that don't move or shoot much

But had some fun while exploring perl and reg expressions, and so far perl is growing on me $-)

3
F3 bots / EyeBot (F3) (Moonfisher) 17-01-2009
« on: January 16, 2009, 08:16:29 PM »
I tried to make this as easy to use as possible.
Almost plug and play, and the eyes are very easy to adjust.
You only need to set very few values to activate and use the eyes in many different ways.

The eye system by itself (And broken down):
Code: [Select]
'A system with some practical eyes
'The conspec is buildt into the eye system, it just uses
'.dnalen to reconize it's own

'- Variables -
'To apply new eye settings store the value 1 in seteyes
'seteyes will be 0 if not set and 2 if they've been set to something.
def seteyes 50

'When seteyes is 1 the values in seteyespace, setoffset and seteyewidth
'will be applied.
def seteyespace 52
def setoffset 53
def seteyewidth 54

'Eyeuse chooses between changing the focuseye to look,
'or turning the current focus eye to look.
'If you plan on shooting without using .aimshoot and you're using the
'system for turning, then remember to set the focus eye to the one you have centered
'Same goes for using angle and setaim to face the oponent,
'always rememeber to keep track of your focuseye.
'(Unless ofcourse you're never using the system for changing eyefocus)
def eyesystem 55


'- Constants -
'eyedist is used for turning and should be 35 unless something changes in the source.
def eyedist 35 'The eyes default offset

'These are just some values I usualy use, but you can use any values you like.
'They also don't need to be defined as constant, you can just push raw values into the set vars.
def fulleyespace 105 '360 degree spread
def fulloffset 140 'Offset to center eye9
def slimeyewidth -30 'Slimmest eye width


'********************************************************************
'------------------------- Init Eyes --------------------------------
'--- Initializing the eyes ---
cond
*.seteyes 0 =
start
1 .seteyes store
.dnalen .memloc store
.fulleyespace .seteyespace store
.fulloffset .setoffset store
.slimeyewidth .seteyewidth store
stop
'********************************************************************


'********************************************************************
'------------------------- Eyes -------------------------------------
'--- Setup ---
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
*.seteyewidth .eye1width store
*.seteyewidth .eye2width store
*.seteyewidth .eye3width store
*.seteyewidth .eye4width store
*.seteyewidth .eye5width store
*.seteyewidth .eye6width store
*.seteyewidth .eye7width store
*.seteyewidth .eye8width store
*.seteyewidth .eye9width store
4 .focuseye store
2 .seteyes store
stop

'--- Change focus ---
cond
*.eyesystem 0 =
start
*.eyef 0 =
*.memval *.dnalen = or
 501 *.focuseye 5 add 9 mod add * abs sgn
 501 *.focuseye 6 add 9 mod add * abs sgn 2 mult |
 501 *.focuseye 7 add 9 mod add * abs sgn 4 mult |
 501 *.focuseye 8 add 9 mod add * abs sgn 8 mult |
 501 *.focuseye 9 add 9 mod add * abs sgn 16 mult |
 501 *.focuseye 10 add 9 mod add * abs sgn 32 mult |
 501 *.focuseye 11 add 9 mod add * abs sgn 64 mult |
 501 *.focuseye 12 add 9 mod add * abs sgn 128 mult |
 dup
 dup
 dup
 dup
 dup
 dup
 dup
 dup
 1 & 1 sub dup div 1 sub abs
 *.focuseye 5 add 9 mod 4 sub
 mult
 swap
 3 & 2 sub dup div 1 sub abs
 *.focuseye 6 add 9 mod 4 sub
 mult
 add
 swap
 7 & 4 sub dup div 1 sub abs
 *.focuseye 7 add 9 mod 4 sub
 mult
 add
 swap
 15 & 8 sub dup div 1 sub abs
 *.focuseye 8 add 9 mod 4 sub
 mult
 add
 swap
 31 & 16 sub dup div 1 sub abs
 *.focuseye 9 add 9 mod 4 sub
 mult
 add
 swap
 63 & 32 sub dup div 1 sub abs
 *.focuseye 10 add 9 mod 4 sub
 mult
 add
 swap
 127 & 64 sub dup div 1 sub abs
 *.focuseye 11 add 9 mod 4 sub
 mult
 add
 swap
 255 & 128 sub dup div 1 sub abs
 *.focuseye 12 add 9 mod 4 sub
 mult
 add
 swap
 .focuseye
 swap
 sgn mult
 store
stop

'--- Turn ---
cond
*.eyesystem 1 =
start
*.eyef 0 =
*.memval *.dnalen = or
 501 *.focuseye 5 add 9 mod add * abs sgn
 501 *.focuseye 6 add 9 mod add * abs sgn 2 mult |
 501 *.focuseye 7 add 9 mod add * abs sgn 4 mult |
 501 *.focuseye 8 add 9 mod add * abs sgn 8 mult |
 501 *.focuseye 9 add 9 mod add * abs sgn 16 mult |
 501 *.focuseye 10 add 9 mod add * abs sgn 32 mult |
 501 *.focuseye 11 add 9 mod add * abs sgn 64 mult |
 501 *.focuseye 12 add 9 mod add * abs sgn 128 mult |
 dup
 dup
 dup
 dup
 dup
 dup
 dup
 dup
 1 & 1 sub dup div 1 sub abs
 *.aim 521 *.focuseye 5 add 9 mod add * add .eyedist 4 mult add
 mult
 swap
 3 & 2 sub dup div 1 sub abs
 *.aim 521 *.focuseye 6 add 9 mod add * add .eyedist 3 mult add
 mult
 add
 swap
 7 & 4 sub dup div 1 sub abs
 *.aim 521 *.focuseye 7 add 9 mod add * add .eyedist 2 mult add
 mult
 add
 swap
 15 & 8 sub dup div 1 sub abs
 *.aim 521 *.focuseye 8 add 9 mod add * add .eyedist 1 mult add
 mult
 add
 swap
 31 & 16 sub dup div 1 sub abs
 *.aim 521 *.focuseye 9 add 9 mod add * add .eyedist 0 mult add
 mult
 add
 swap
 63 & 32 sub dup div 1 sub abs
 *.aim 521 *.focuseye 10 add 9 mod add * add .eyedist 1 mult sub
 mult
 add
 swap
 127 & 64 sub dup div 1 sub abs
 *.aim 521 *.focuseye 11 add 9 mod add * add .eyedist 2 mult sub
 mult
 add
 swap
 255 & 128 sub dup div 1 sub abs
 *.aim 521 *.focuseye 12 add 9 mod add * add .eyedist 3 mult sub
 mult
 add
 swap
 .setaim
 swap
 sgn mult
 store
stop
'********************************************************************

The eye system with the F3 bot attached:
Code: [Select]
'A system with some practical eyes
'And a test bot (F3) wich shows some of the posibilities.
'The conspec is buildt into the eye system, it just uses
'.dnalen to reconize it's own

'- Variables -
'To apply new eye settings store the value 1 in seteyes
'seteyes will be 0 if not set and 2 if they've been set to something.
def seteyes 50

'When seteyes is 1 the values in seteyespace, setoffset and seteyewidth
'will be applied.
def seteyespace 52
def setoffset 53
def seteyewidth 54

'Eyeuse chooses between changing the focuseye to look,
'or turning the current focus eye to look.
'If you plan on shooting without using .aimshoot and you're using the
'system for turning, then remember to set the focus eye to the one you have centered
'Same goes for using angle and setaim to face the oponent,
'always rememeber to keep track of your focuseye.
'(Unless ofcourse you're never using the system for changing eyefocus)
def eyesystem 55


'- Constants -
'eyedist is used for turning and should be 35 unless something changes in the source.
def eyedist 35 'The eyes default offset

'These are just some values I usualy use, but you can use any values you like.
'They also don't need to be defined as constant, you can just push raw values into the set vars.
def fulleyespace 105 '360 degree spread
def fulloffset 140 'Offset to center eye9
def slimeyewidth -30 'Slimmest eye width
def normaleyewidth 0
def wideeyewidth 80 'Wider eyewidth


'- Vars and const for the test bot
'These are just used in the example to show how the system can be used.

'vars
def state 56

'const
def alge 13
def maxbody 15000
def movebody 6000


'********************************************************************
'------------------------- Init Eyes --------------------------------
'--- Initializing the eyes ---
cond
*.seteyes 0 =
start
1 .seteyes store
.dnalen .memloc store
.fulleyespace .seteyespace store
.fulloffset .setoffset store
.normaleyewidth .seteyewidth store
stop
'********************************************************************


'********************************************************************
'------------------------- Eyes -------------------------------------
'--- Setup ---
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
*.seteyewidth .eye1width store
*.seteyewidth .eye2width store
*.seteyewidth .eye3width store
*.seteyewidth .eye4width store
*.seteyewidth .eye5width store
*.seteyewidth .eye6width store
*.seteyewidth .eye7width store
*.seteyewidth .eye8width store
*.seteyewidth .eye9width store
2 .seteyes store
stop

'--- Change focus ---
cond
*.eyesystem 0 =
start
*.eyef 0 =
*.memval *.dnalen = or
 501 *.focuseye 5 add 9 mod add * abs sgn 501 *.focuseye 6 add 9 mod add * abs sgn 2 mult | 501 *.focuseye 7 add 9 mod add * abs sgn 4 mult | 501 *.focuseye 8 add 9 mod add * abs sgn 8 mult | 501 *.focuseye 9 add 9 mod add * abs sgn 16 mult | 501 *.focuseye 10 add 9 mod add * abs sgn 32 mult | 501 *.focuseye 11 add 9 mod add * abs sgn 64 mult | 501 *.focuseye 12 add 9 mod add * abs sgn 128 mult | dup dup dup dup dup dup dup dup 1 & 1 sub dup div 1 sub abs *.focuseye 5 add 9 mod 4 sub mult swap 3 & 2 sub dup div 1 sub abs *.focuseye 6 add 9 mod 4 sub mult add swap 7 & 4 sub dup div 1 sub abs *.focuseye 7 add 9 mod 4 sub mult add swap 15 & 8 sub dup div 1 sub abs *.focuseye 8 add 9 mod 4 sub mult add swap 31 & 16 sub dup div 1 sub abs *.focuseye 9 add 9 mod 4 sub mult add swap 63 & 32 sub dup div 1 sub abs *.focuseye 10 add 9 mod 4 sub mult add swap 127 & 64 sub dup div 1 sub abs *.focuseye 11 add 9 mod 4 sub mult add swap 255 & 128 sub dup div 1 sub abs *.focuseye 12 add 9 mod 4 sub mult add swap 511 swap sgn mult store
stop

'--- Turn ---
cond
*.eyesystem 1 =
start
*.eyef 0 =
*.memval *.dnalen = or
 501 *.focuseye 5 add 9 mod add * abs sgn 501 *.focuseye 6 add 9 mod add * abs sgn 2 mult | 501 *.focuseye 7 add 9 mod add * abs sgn 4 mult | 501 *.focuseye 8 add 9 mod add * abs sgn 8 mult | 501 *.focuseye 9 add 9 mod add * abs sgn 16 mult | 501 *.focuseye 10 add 9 mod add * abs sgn 32 mult | 501 *.focuseye 11 add 9 mod add * abs sgn 64 mult | 501 *.focuseye 12 add 9 mod add * abs sgn 128 mult | dup dup dup dup dup dup dup dup 1 & 1 sub dup div 1 sub abs *.aim 521 *.focuseye 5 add 9 mod add * add 35 4 mult add mult swap 3 & 2 sub dup div 1 sub abs *.aim 521 *.focuseye 6 add 9 mod add * add 35 3 mult add mult add swap 7 & 4 sub dup div 1 sub abs *.aim 521 *.focuseye 7 add 9 mod add * add 35 2 mult add mult add swap 15 & 8 sub dup div 1 sub abs *.aim 521 *.focuseye 8 add 9 mod add * add 35 1 mult add mult add swap 31 & 16 sub dup div 1 sub abs *.aim 521 *.focuseye 9 add 9 mod add * add 35 0 mult add mult add swap 63 & 32 sub dup div 1 sub abs *.aim 521 *.focuseye 10 add 9 mod add * add 35 1 mult sub mult add swap 127 & 64 sub dup div 1 sub abs *.aim 521 *.focuseye 11 add 9 mod add * add 35 2 mult sub mult add swap 255 & 128 sub dup div 1 sub abs *.aim 521 *.focuseye 12 add 9 mod add * add 35 3 mult sub mult add swap 19 swap sgn mult store
stop
'********************************************************************



'********************************************************************
'************ From here on it's just the test bot *******************
'********************************************************************

start
.fixpos dec
.deltie inc

*.nrg *.body >
*.nrg 500 > and
100 .strbody store

*.nrg 2000 >
*.body *.nrg < and
*.body .maxbody < and
*.nrg 10 mult *.body sub .strbody store

*.robage 50 >
1 .seteyes store
.wideeyewidth .seteyewidth store
stop

'- Scout -
cond
*.state 0 =
start
*.eyesystem 0 !=
0 .eyesystem store

*.eyef 0 =
*.memval *.dnalen = or
*.maxvel .up store

*.robage 5 <
*.body 1100 > and
*.maxvel - .up store

*.eyef 0 !=
*.memval .alge != and
*.memval *.dnalen != and
*.refvelsx 100 mult .dx store
*.refveldn 100 mult .up store

*.eyef 0 !=
*.memval .alge = and
1 .state store

*.eyef 0 =
*.memval *.dnalen = or
*.shflav 0 = and
*.nrg 20000 > and
*.body 3000 > and
2 .state store

*.eyef 0 !=
*.memval *.dnalen != and
*.body *.refbody 200 sub > and
3 .state store

*.body .movebody >
4 .state store
*.totalmyspecies 2 < and
*.nrg 10000 > and
*.eyef 0 = and
2 .state store
stop

cond
*.state 1 =
start
*.eyesystem 1 !=
1 .eyesystem store
4 .focuseye store

*.eyef 0 !=
*.memval .alge = and
*.refxpos *.refypos angle .setaim store
*.refvelsx *.veldx add .sx store
*.refvelup 100 *.eyef sub add 10 floor .up store
-6 .shoot store
16 .shootval store

*.eyef 0 =
*.memval .alge != or
0 .state store
stop

cond
*.state 2 =
start
*.eyef 0 =
*.memval *.dnalen = or
*.shflav 0 = and
*.nrg 20000 > and
*.body 3000 > and
*.aim 314 add .setaim store
20 .repro store

not
3 .state store
stop

cond
*.state 3 =
start
*.eyesystem 1 !=
1 .eyesystem store
4 .focuseye store

*.eyef 0 !=
*.memval *.dnalen != and
*.refxpos *.refypos angle .setaim store
*.refvelsx *.veldx add .sx store
*.refxpos *.xpos sub abs *.refypos *.ypos sub abs pyth 5 div 30 sub 0 floor 100 ceil *.refvelup add .up store
*.nrg 100 div *.refnrg ceil 25 floor .shootval store
-6 .shoot store

*.shflav 0 !=
*.shang .aimshoot store
-6 .shoot store
40 .shootval store
0 .shflav store

*.eyef 0 =
*.memval *.dnalen = or
0 .state store

*.body .movebody >
4 .state store
stop

cond
*.state 4 =
start
*.eyesystem 1 !=
1 .eyesystem store
4 .focuseye store
1 .seteyes store
.wideeyewidth .seteyewidth store

*.eyef 0 !=
*.memval *.dnalen != and
*.refxpos *.refypos angle .setaim store
-6 .shoot store
*.memval .alge != and
*.nrg 100 div *.refnrg ceil 25 floor .shootval store

*.refxpos *.refypos dist 600 >
*.memval .alge = and
*.shflav 0 = and
-10 .shootval store

*.timer 15 mod 0 =
*.memval .alge = and
150 .aimsx store

*.shflav 0 !=
*.shang .aimshoot store
-6 .shoot store
40 .shootval store
0 .shflav store

*.eyef 0 =
*.memval *.dnalen = or
0 .state store

*.eyef 0 =
*.memval *.dnalen = or
*.memval .alge = or
*.body .movebody < and
0 .state store

*.eyef 0 =
*.memval *.dnalen = or
*.memval .alge = or
*.body .maxbody > and
4 .state store
stop

end

4
Interesting behaviour bots / NNTEstBot7evo5
« on: January 08, 2009, 04:31:48 PM »
Calling it an evo bot since it does randomly adjust values and all that.
But it's made using the neural net mod I've been working on.
The mod isn't complete yet, but was good enough to run a sim, and I'm thinking of taking a break from working on the mod.

Anyway, it may not resemble single cell evolution, but it is an evo bot in it's own way.
It has some advantages, the mod only matches valid input and outputs and generaly handles a lot of the syntax on it's own.
But mostly it has 20 coustom inputs and outputs and the base bot had some rather helpfull ones. (Mainly in the areas that a neural network would have a hard time acomplishing, like pushing -1 or -6 into shoot)

It required a base bot since the mutations creating the network only happen during reproduction.
But all the genes in the base that require a certain DNA length have been disabled as the code grew. (It's DNa length is about 1300 and the last gene (The one in charge of reproduction) gets deactivated when reaching 700 dna length.)

So apart from the robage 0 gene and the genes providing the coustom inputs and outputs, the network is all that controlls the bot.
It's evolved using poison at earlier stages, but seemed to drop it again every time (Could be because of a bug in 2.43.1h wich is the source I used for the mod).

It's fragile in some ways, it only has 1 nrg once fully grown. It also seems to behave oddly when eating alge, but this is because the environment it was evolved in was size 13, with thin fluids, 70% gain to body on the alge and 150 energy per cycle to the alge.
So instead of eating the alge it nudges it along slowly and aims next to the alge so it only hits it when it's large enough to survive getting hit. Sooner or later something usualy bumps into the alge and sets things in motion. It also strafes... took me a while to figure out how obvious the advantage was  The eye isn't very wide, but it's long, so if you need to "scan" a large area with few alge to find food, you'll cover more ground moving sideways  So simple, but not as obvious as it seems.

Apart from that it doesn't do anything realy special... it took ages for it to learn how to turn... it used to just adjust it's position when chacing an alge (Since it's probably a lot easyer to use movement in the network since oversteering isn't a problem, but if you don't turn exactly right you'll be facing the wrong way)

Anyway it was mostly to test the mod, and the bot evolved past it's base, so I'm satisfied with the result for now. (But the mod still need some work before it's realy good, and still haven't figured out exactly how I'll proceed yet).

It managed to beat purple iflama (The bot at the bottom of F2, or atleast in the last league table I have)
Other than that it's not well suited for leagues since it's used to very different sim settings.

But it works and it evolved rather fast... about 250 hours, 1.4 mil cycles. Most of the good stuff happened early on though, there was a "pause" for several days before it learned how to aim.
In the sim I uploaded I unlocked global mutations to let the bots adjust their mutation rates, and it looks like it didn't take long for mutation rates to get turned very far down.
If you want to reenable and take controll over global mutation rates you need to open the mutation rates window (It will look different since the NN mod is active) and enable and then disable the checkbox in there. (This is because I havent fixed the GUI yet)
You can also see more details about the mod in the NeuralNetwork topic in the bot challenge section.

The bot may not be league material, but it's faily close and it proves that the mod works as intended.
You may need to pull a big bot away from it's alge to get the ball rolling at first, but then things should pick up.
I think this might also be a good evo base for regular sims.
(NNTEstBot7 is the base the network evolved from, I think it's needed for loading the sim)
You can only load the sim using the mod, and only v0.4. You can ofcourse run the evolved bot in any drop you like, but it won't evolve the network like intended. (You should still be able to use it as an evo bot with regular mutations though)
Also to continue evolving the network using the mod you need to load the sim, it won't parse the bot or anything, the network information is in the saved sim.


Code: [Select]
''''''''''''''''''''''''  Gene:  1 Begins at position  1  '''''''''''''''''''''''
 cond
 *.robage 0 =
 start
 7 .ploc store
 7 .vloc store
 -2 .venval store
 stop
''''''''''''''''''''''''  Gene:  1 Ends at position  15  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  2 Begins at position  16  '''''''''''''''''''''''
 cond
 *.dnalen 400 <
 start
 *.robage 1500 <
 40 .up store
 stop
''''''''''''''''''''''''  Gene:  2 Ends at position  27  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  3 Begins at position  28  '''''''''''''''''''''''
 cond
 *.dnalen 500 <
 start
 *.robage 2000 <
 *.eye5 0 >
 and
 *.refage 500 >
 and
 *.refeye 0 =
 and
 *.refshoot 0 =
 and
 -6 .shoot store
 stop
''''''''''''''''''''''''  Gene:  3 Ends at position  55  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  4 Begins at position  56  '''''''''''''''''''''''
 cond
 *.dnalen 600 <
 start
 *.robage 0 =
 628 .aimleft store
 *.eye5 0 =
 *.body 1000 >
 and
 *.robage 2000 <
 and
 314 .aimleft store
 stop
''''''''''''''''''''''''  Gene:  4 Ends at position  81  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  5 Begins at position  82  '''''''''''''''''''''''
 cond
 *.dnalen 700 <
 start
 *.eye5 0 =
 *.body 1000 >
 and
 *.robage 2500 <
 and
 50 .repro store
 *.robage 4500 >
 -2 .shoot store
 32000 .shootval store
 stop
''''''''''''''''''''''''  Gene:  5 Ends at position  110  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  6 Begins at position  111  '''''''''''''''''''''''
 start
 true
 *.refxpos *.refypos angle 70 store
 *.body 1000 sub 71 store
 *.refeye *.myeye sub abs 72 store
 *.refshoot *.myshoot sub abs 73 store
 *.refdx *.mydx sub abs 74 store
 *.nrg 3000 sub 75 store
 *.shell 500 sub 76 store
 *.poison 500 sub 77 store
 *.venom 500 sub 78 store
 *.shang - *.aim add 79 store
 *.eyef 80 store
 *.aim 81 store
 *.refshell 82 store
 *.refvelup 83 store
 *.refvelsx 84 store
 *.refveldx 85 store
 *.refvelup 86 store
 *.eye9 87 store
 *.eye1 88 store
 *.pain 89 store
 stop
''''''''''''''''''''''''  Gene:  6 Ends at position  197  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  7 Begins at position  198  '''''''''''''''''''''''
 start
 *100 0 >
 50 .repro store
 *101 0 >
 -1 .shoot store
 *102 0 >
 -6 .shoot store
 *103 0 >
 -3 .shoot store
 *104 0 !=
 *104 .mkshell store
 *105 0 !=
 *105 .mkpoison store
 *106 0 !=
 *106 .strvenom store
 *107 0 !=
 *107 .strbody store
 *108 0 !=
 *108 .fdbody store
 *109 0 !=
 *109 .up store
 *110 0 !=
 *110 .dn store
 *111 0 !=
 *111 .dx store
 *112 0 !=
 *112 .sx store
 *113 0 !=
 *113 .setaim store
 *114 0 !=
 *114 .aimleft store
 *115 0 !=
 *115 .aimright store
 *116 0 !=
 *116 .aimshoot store
 *117 0 !=
 *117 .shootval store
 *118 0 !=
 *118 .focuseye store
 *119 0 !=
 *119 .eye5width store
 true
 stop
''''''''''''''''''''''''  Gene:  7 Ends at position  320  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  8 Begins at position  321  '''''''''''''''''''''''
 start
 0 674 store
 0 109 store
 0 909 store
 0 107 store
 0 .eye2dir store
 0 .readtie store
 0 .eye3dir store
 0 104 store
 0 110 store
 0 874 store
 0 106 store
 0 .sharewaste store
 0 175 store
 0 .sharewaste store
 0 100 store
 0 112 store
 0 109 store
 0 .stifftie store
 0 .backshot store
 0 109 store
 0 110 store
 0 .eye6width store
 0 106 store
 0 109 store
 0 .genes store
 0 108 store
 0 106 store
 0 .mkvirus store
 0 116 store
 0 105 store
 0 883 store
 0 .readtie store
 0 .eye3dir store
 0 108 store
 0 113 store
 0 182 store
 0 105 store
 0 .in8 store
 0 .eye2dir store
 0 .eye1dir store
 0 116 store
 0 .readtie store
 0 107 store
 0 .strvenom store
 0 .sharewaste store
 stop
''''''''''''''''''''''''  Gene:  8 Ends at position  457  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  9 Begins at position  458  '''''''''''''''''''''''
 start
 *674 *73 24 mult add *78 -31 mult add *109 -70 mult add 119 div 674 store
 *102 *82 -35 mult add *674 -66 mult add *100 18 mult add *.paralyzed 24 mult add 134 div 102 store
 *110 *80 137 mult add *674 -63 mult add *82 31 mult add *.shup 4 mult add *73 11 mult add 35 div 110 store
 *109 *.trefvelyourdn -68 mult add *.sharewaste -37 mult add 100 div 109 store
 *102 *102 -28 mult add 168 div 102 store
 *909 *.hitdx -9 mult add *75 42 mult add 100 div 909 store
 *107 *102 -35 mult add 148 div 107 store
 *101 *.eye3dir -57 mult add *115 -3 mult add 100 div 101 store
 *.eye2dir *85 -123 mult add *.myties 95 mult add 148 div .eye2dir store
 *.sharewaste *85 57 mult add *.slime 31 mult add 281 div .sharewaste store
 *.eye3width *.genes 59 mult add *82 141 mult add *.in3 -37 mult add 100 div .eye3width store
 *.eye3dir *109 25 mult add 113 div .eye3dir store
 *101 *81 73 mult add 73 div 101 store
 *.readtie *109 29 mult add *70 28 mult add *105 -7 mult add 131 div .readtie store
 *.eye3dir *108 -155 mult add *.eyef 27 mult add *.eye9 120 mult add 101 div .eye3dir store
 *104 *84 11 mult add *76 -43 mult add 126 div 104 store
 *110 *.readtie 1 mult add 94 div 110 store
 *874 *.shsx -47 mult add *.shup -20 mult add *74 -22 mult add 100 div 874 store
 *101 *106 8 mult add *71 45 mult add 91 div 101 store
 *100 *78 -10 mult add *.trefvelyourup 50 mult add *674 -62 mult add *101 185 mult add *79 73 mult add *76 -29 mult add 131 div 100 store
 *106 *102 42 mult add *.tieang 9 mult add *.in3 87 mult add 95 div 106 store
 *.sharewaste *.multi 102 mult add 87 div .sharewaste store
 *175 *.eye3dir 20 mult add *100 8 mult add 100 div 175 store
 *.sharewaste *101 31 mult add *.trefxpos -31 mult add *.trefbody -5 mult add 100 div .sharewaste store
 *100 *102 -67 mult add *83 -4 mult add 100 div 100 store
 *112 *.velsx 51 mult add 119 div 112 store
 *101 *.trefvelmydx -34 mult add *114 52 mult add 100 div 101 store
 *109 *110 -51 mult add *71 -38 mult add *.eye5 -68 mult add 100 div 109 store
 *.stifftie *84 -22 mult add 94 div .stifftie store
 *109 *.refvelscalar 33 mult add 100 div 109 store
 *.backshot *.trefvelyourdx 73 mult add 75 div .backshot store
 *109 *.fertilized -57 mult add *.eye3dir 52 mult add 156 div 109 store
 *110 *115 18 mult add *106 -156 mult add *.hitup -83 mult add 89 div 110 store
 *.eye6width *74 27 mult add *.refvelup -54 mult add 100 div .eye6width store
 *106 *.vel 63 mult add *87 -31 mult add *.in5 138 mult add 100 div 106 store
 *111 *85 160 mult add 100 div 111 store
 *109 *.out6 -100 mult add 144 div 109 store
 *109 *82 102 mult add 52 div 109 store
 *.genes *.out2 -65 mult add *.shdx 32 mult add 20 div .genes store
 *.fixlen *89 -25 mult add 100 div .fixlen store
 *108 *.tout2 -20 mult add 84 div 108 store
 *106 *109 -115 mult add *110 91 mult add 100 div 106 store
 *.in5 *.mysx -39 mult add *81 -16 mult add 101 div .in5 store
 *.mkvirus *.refveldx 52 mult add *112 -2 mult add *.shsx 1 mult add 100 div .mkvirus store
 *116 *109 -128 mult add 100 div 116 store
 *105 *.shup 41 mult add *.rdboy 78 mult add 101 div 105 store
 *883 *.refmulti -78 mult add *101 59 mult add 142 div 883 store
 *.readtie *.trefvelmysx 87 mult add *79 28 mult add 100 div .readtie store
 *.eye3dir *.poisoned 51 mult add 100 div .eye3dir store
 *106 *72 5 mult add 139 div 106 store
 *108 *107 -36 mult add *.eye1 7 mult add 84 div 108 store
 *113 *70 100 mult add 100 div 113 store
 *182 *.out9 0 mult add *.dnalen -23 mult add 100 div 182 store
 *105 *.eye1 -4 mult add 100 div 105 store
 *.in8 *.eye2dir 63 mult add 100 div .in8 store
 *.eye2dir *116 -145 mult add *85 -113 mult add 100 div .eye2dir store
 *.eye1dir *84 -56 mult add *.eye5 75 mult add 100 div .eye1dir store
 *116 *182 -23 mult add 100 div 116 store
 *.readtie *.trefvelmysx 87 mult add *71 28 mult add 100 div .readtie store
 *105 *874 18 mult add *.stifftie -33 mult add 101 div 105 store
 *101 *.eye3dir -57 mult add *115 -3 mult add 100 div 101 store
 *883 *.eye2dir -22 mult add *175 8 mult add 117 div 883 store
 *.in3 *892 -2 mult add 100 div .in3 store
 *.sharewaste *85 57 mult add *.slime 38 mult add 281 div .sharewaste store
 *107 *909 42 mult add *.refveldx 96 mult add 127 div 107 store
 *.strvenom *78 75 mult add 100 div .strvenom store
 *.sharewaste *101 31 mult add *.trefxpos -31 mult add *.trefbody -5 mult add 100 div .sharewaste store
 *.eye4width *.refaim -44 mult add 100 div .eye4width store
 *.in8 *84 23 mult add 100 div .in8 store
 stop
''''''''''''''''''''''''  Gene:  9 Ends at position  1336  '''''''''''''''''''''''

5
Darwinbots Program Source Code / Source Documentation
« on: November 23, 2008, 11:54:07 AM »
I wanted to make a mod for DB, but I'm having a very hard time finding my way through the source.
I didn't want to use 2.44 since it crashes all the time, so the latest version I could find was 2.43.1h (Although I would have prefered 2.43.1L)

But I can't find any documentation on the wiki... I can find a list of existing features or features to come, but nothing about the actual source and it's structure...

I know there's some comments in the code, but not enough for me to figure this out.
I think my main issue is figuring out "where it starts and where it ends", meaning how everything is structured, where does what happen and in what order.
Like a simple class diagram, or even a short reame would do wonders for my part. I'm not used to VB but from what I can tell there's classes and modules, and all the modules can access everything in all classes without having to specify it anywhere... this makes it very hard to figure out the structure.

So if there's any documentation anywhere, or maybe a topic where some of these things have been discussed or a diagram showing the structure, or maybe a small readme or walkthrough for getting started with the code... maybe explanation on some of the abreviations... anything that would help me get started... then I'd love if someone could post a link.

So far I think I've guessed that rob stands for robot and robn for robot number... but I'm realy having doubt about this because it seems unlikely that anyone would abreviate a 5 letter word, and the abreviation for number is usualy "nr" or "no"...
Anyway asuming rob is an array of robots then I still find myself wondering about this linked list I found.
The node used is called node and contains a lot of abreviations that I can't figure out :

Public robn As Integer ' Robot number I think.
Public xpos As Single   ' X position... but not sure in what context
Public pp As node        ' Pointer pointer ???  (Edit: Pointer Previous ! right ?...)
Public pn As node        ' Pointer number ??? (Edit: Pointer Next maybe !)
Public orp As node       ' ???????
Public orn As node       ' ???????
Public pout As node      ' Pointer out ???

I'm not trying to insult anyone with this... I just find it very confusing and I can't figure out what this node contains and what it's for.
Also it seems like it's used inside the list class... but then how come rob() is used to access robots ?

Basicaly I'm very confused... and any help would realy be apretiated... I figrue there might be a topic where other people asked similar questions when getting aquainted with the source, or maybe some documentations somewhere that I overlooked. Any links to anything that might help are very welcome.
And I am a VB noob, so maybe I'm just not understanding how VB works... but even so, any documentation would realy help.

6
Bot Challenges / Evolved Neural Network
« on: November 09, 2008, 07:50:58 AM »
Ok, so I was working on that Neural Net challenge a while ago, and experimented with building them in a redundant way that was more mutation friendly.
And guess what, it worked, pretty well even.
And was planning on expanding the code with a larger blank network, but had tech issues with integrating the mutated code in the other network.
And then I finaly managed to focus on that thesis. So never got much further with the evo sim at that point. I also played around with other mutations settups for the bots I extracted from the first sim.
Anyway, I'm using my computer for stuff lately so I'm no longer running the sim, might start it again at some point if I have an extra computer I can put somewhere I can't hear it.

So figured I should post what I got so far in case someone wants to run it or study the results.

Now obviously most of the functional mutations have arised by changing weight in the network, but the point is to create an evo base that isn't "hand made".
The mutated network is close to how I would immagine a very redundant mutated bot would start to evolve further by creating these structures as part of it's code.

Now I only used point mutations while running the sim, but it should be possible to enable all mutations, problem is it doesn't work mid sim, so I've been drawing out the best bots after a period with no mutations, this way they can all be entered again with new mutation settings.

Just remember that it's a big bot and it's evolved in a large environment (size 13) with very litle food (no more than 25 vegs max), so mutations rates need to be very low... I've included a good setting file to work from if you want to start your own sim with these.
Costs are close to F1 with no code execution costs and low movement cost.

To start a new sim with this bot you need to fidle around with a few things, wich is also why I included a sim with only one of the bots so you can see the evolved bot in action without having to fidle with all this or load the last sim before I locked mutations.

So to limit spam I'll try to break it down :

Files :
This was all done with DB 2.43.1k, but I think it should work in newer versions aswell.
I was planning on describing all the files in detail, but it's been months since I last looked at this, so I can't remember which is what. So I'll describe what I can.
- starterNN.sim
This is a sim where I inserted one of the good bots that I extracted from the original sim, so you don't need to load a sim with 2000 bots to view the behavior.
- NNNewBase
These are the original sim files, the last one I had as a rar file was _28_76.rar, so I suspect it's one of the last sims before I locked mutations to extract the best bots.
The others are later saves and I'm not sure what I was doing to those.
- Extracted bots.
These where all the subspecies extracted from the sim after having locked mutations for a day or 2. Some of them seem to cover most of the field with some holes here and there and others seem to focus on filling out those blanks.
There where some edge scrapers for a while, but not sure if there where any left in the end. (It was a big advantage at one point because the soccer bots used to loose track of their alge around borders)
- AllInOne is just all the files in one rar, so you don't need to download them individualy. The individual files are for people who for some reason still use a modem.

Settings :
It's basicaly F1 settings with some reduced movement cost, and I think I also cut code execution costs.
Field should be size 13, they still work in other field size, but with size 13 they spread out very nicely all over the place.
Toroidal borders is a must, they are not ment for a sim with borders and I'm pretty sure it's too late to try and change that.
And thin liquids is also required, also rather important I would say, since their controlls are all evlved in that environment anything else would probably be rather confusing to them.
25 or less alge, you don't want more than that unless you're increasing costs to make up for it... I actualy recommend around 10 with the costs in the included sims.
Currently the sim only has point mutations, and only VERY few of them. You could use all mutation types in theory, just make sure they're VERY rare... it's a big sim, so mutating often will let bots mutate 100's of times before encountering an alge, meaning they'll devolve alge controll for sure (Maybe if you're very lucky a strong cannibot would evolve, but I seriously doubt it).
The code is very long so it will mutate often, and the structure means a lot of mutations will be functional, so if you want more mutations... I guess maybe a lot of non functional junk code might help.

Instructions (On starting your own sim):
You should use settings that are close to the ones from the included sim, then you can always change them gradualy into whatever it is you like. But drastic changes could end up killing off everything.
Also the size and energy of a bot affect it's controlls... it may seem silly but this is how they work and it actualy makes sence once you study their behavior and environment, size and nrg reserves affecting behavior is a good thing in the long run.
But this means that the default (and non changeable) body size a bot starts with will have a very negative effect on it's navigation. So you need to select the bot and force it to reproduce twice before it reaches a manageable size.
This is a litle tricky to accomplish, wich is why there's also an almost empty sim with some bots set up with the right size and right next to an alge. It will still take a while before the bots stabilize around their natural way of being, but they'll get there and start to play soccer with the alge eventualy.
You'll see them try to play soccer form the beginning, but it'll take a while before the alge and bots all have the size and nrg their used to and start to realy demonstrate fancy ball controll.

The included sim (starterNN.sim):
Now this sim holds one of the subspecies from the end of the 4-500 hour evo sim.
It's one that was successfull over the largest part of the field. t was at around 2000 bots when I locked mutations to extract the best bots, so the sim won't behave exactly as before while the population is this low.
Also mutations are enabled, so if you wan't to make sure you're seing the original bot start off by locking mutations. (The mutations aren't too frequent though, so it shouldn't hurt to have them enabled)
Since there's very few bots in the sim the veggies tend to get bigger than they normaly would in the old sim, so they're not at the optimal size for the bots to "play soccer" with them.
The bots will still controll the alge and avoid killing it, but the alge will be too big to move around much, and in the end the bot will be too big to controll the alge well from all the energy it gains.
So if you're not seing much action just look around for a small bot controlling a small/medium size alge. Sooner or later things will start to fit better as the sim gets going and you'll start to see bots figting over alge and a lot more "dribling".
(I tryed to record some of this stuff, but the resolution made it realy hard to see what was going on)
Theres also only 10 veggies in the sim to reduce population a litle. I also encourage playing around with costs and such, increase movement costs, slowly get to F1 default costs maybe, but take baby steps, slight changes in costs can have dramatic effects, they need time to evolve to adapt to changes, do it litle by litle.
(I forgot wich bot I used for this sim, but that should be easy to see if you just start the sim and look at the settings)

So what does it do ? What evolved so far ?

It was started off as a blank network with only a few hand set weights.
It could eat alge and reproduce basicaly, but not very well.

And after about 2000 mutations :
- Anti canni conspec: It had evolved a conspec based on movement, when 2 bots see eachother they shoot, but try to get around eachother and move on. This makes it very hard for canibots or even just carnivores to evolve, since if you attack they will fight back or use mass reproduction to escape.
- Repro defence: Using reproduction as a defence in 2 different ways. It seems to get triggered by massive damage or loosing track of an alge. If you're loosing a fight scramble and hope for the best, if you had an alge and a bot made you loose sight of it, then spread and hope to steal it back while the other bot is focused on the many offspring.
- Alge controll: Very good alge controll, and without using ties (because I did everything I could to prevent any ties form evolving, just slows down the sim too much). It basicaly plays soccer with the alge and never kills it, a bot with an alge will make a big offspring if it gets too big, to avoid risking to kill the alge as your shots grow too powerfull. But it's realy the core of the bots behavior, in a size 13 field with 25 alge you need to stick to your food source if you find one, so this is the behavior that has been refined the most from what I can see. It has very good "ball controll" by now, and some bots are also getting good at stealing the ball as a result. It looks like it's having problems killing the alge, but it's realy just trying to keep the alge to itself while avoiding to kill it comlpetely.
- Shell: It uses shell, usualy triggered by pain I think, building a certain amount, around 500... no poison, venom or any of that though...
- Non wastefull: It's not wastefull, only shoots when it sees something. It misses the alge a lot, but if it didn't it would kill it. (There has been bots that fired less shots when manipulating the alge, but they never had a breakthrough)
- Exploring: The bots are getting pretty good at covering the field while moving in patterns where they won't run into eachother too often. There are some subspecies who cover certain areas, if you start a sim with only one bot type you will notice "holes" once the field is covered. So it seems some subspecies are more dominant in different regions. There was also some "edge scrapers" for a while because the bots had a tendency to loose their alge around the borders.
- Redundancy: And ofcourse lots of redundant code, probably because I had mutations set too high, so breaking some large code sections helped it lower the amount of functional mutations.

And yes a lot of the behaviors have arised because of the NN structure, but the NN has also changed in structure and has even added hidden nodes and such. So it's not just adjusting weights in a NN it is evolving to use the network in different ways. At one point it also developped a "handicap" where one of it's movement sysvars was always 8 (This had been done outside the NN structure). This was an advantage as it stabilized the bots movement, and at a later time the handicap actualy disapeared again. Personaly I found this very interesting, not sure exactly what to make of it, but interesting non the less.


IMPORTANT :
I almost forgot the alge, none of the sims will work without this
It's just the alge I was usin, all it does is increase body size at times, but it's the alge the bots are used to and it's needed for the sims, so you probably won't get far without it.
It's called Alga_Silo.txt
It's is NOT included in the AllInOne.rar

7
Bot Tavern / Pole for the new F2 rules.
« on: November 03, 2008, 01:18:08 PM »
Now the ups and downs as I see them :

1. It's a grey area... when is somthing an exploit. I would say a good rule of thumb is that if you're using uncapped sysvars to kill a bot faster than you should be able to, then it's an exploit.
But there's probably other situations, personaly I think raping alge is an exploit (But sexrepro is only allowed in F1, so it doesn't matter).

2. This would mean a lot of maintenance for all the old F2 bots since most have tie defences.

3. This would also cause maintenance of old bots, and it would break the rule against tie feeding in F2. I think this is too drastic a change considering that all bots in F2 are buildt with the knowledge that tie feeding was illegal in F2.

4. About the same rule as #2, but only if your bot creates ties (For instance if it's a multibot). So basicaly if you at any point store a value in .tie then you're not allowed to use .tieloc and .tienum in any way. This would allow the current bots to keep their tie defences, and allow MB's in F2, but still prevent the use of dirty tricks through ties.



Personaly I'm favoring rule 1 and 4... I think that would be enough to keep F2 more interesting and it wouldn't require any changes or rerunning of the league. (Except I think the 2 top F2 bots would need to be refactored, but I believe that's a good thing)

8
F1 bots / Quickdraw (F1) (Moonfisher) 29-10-08
« on: October 29, 2008, 04:32:12 PM »
Code: [Select]
'Quickdraw (F1) (Moonfisher) 29-10-08
'For DB 2.43.1L
'Just a mashup of Lovebot behavior and a slightly modified Fruiflies.
'It's kind of half ass, and it's not realy a work in progress.
'This is just something to play with while .sexrepro is overpowered.
'It beats Saber, Fruitflies and EtchII. Haven't tested against any other bots, so tell me if you se it loose to something.
'I think abyaly will be able to beat this one without much effort though, it doesn't realy kill Saber, it just outlasts it.
'I did come up with one litle trick though, it's where the name comes from.

def fruitfly 971
def original 972
def type 973
def creep 974

def seteyes 50
def seteyespace 52
def setoffset 53
def rand 110

def spineyespace 105
def spinoffset 140
def maxpop 1000
def alge 13


'********************************************************************
'------------------------- Quickdraw --------------------------------
start
50 .repro store
341 .aimsx store
500 .dn store
500 .dx store
*.thisgene .delgene store
stop

start
50 .repro store
341 .aimsx store
500 .dn store
500 .dx store
*.thisgene .delgene store
stop

start
1 .creep store
1 .original store
50 .repro store
341 .aimsx store
500 .dn store
500 .dx store
*.thisgene .delgene store
stop
'********************************************************************



'********************************************************************
'------------------------- Robage 0 ---------------------------------
start
.fixpos dec
stop

cond
*.robage 0 =
start
.deltie inc
1 .seteyes store
.spineyespace .seteyespace store
.spinoffset .setoffset store
.dnalen .memloc store
.dnalen .tmemloc store
stop
'********************************************************************



'********************************************************************
'------------------------- Eyes -------------------------------------
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

cond
*.eyef 0 =
*.memval *.dnalen = or
*.memval .alge !=
*.fruitfly 1 != and or
*.original 1 != or
start
*.aim *.eye1dir add .eyedist 4 mult add .setaim 500 1 add * abs sgn mult store
*.aim *.eye2dir add .eyedist 3 mult add .setaim 500 2 add * abs sgn mult store
*.aim *.eye3dir add .eyedist 2 mult add .setaim 500 3 add * abs sgn mult store
*.aim *.eye4dir add .eyedist 1 mult add .setaim 500 4 add * abs sgn mult store
*.aim *.eye5dir add .eyedist 0 mult sub .setaim 500 5 add * abs sgn mult store
*.aim *.eye6dir add .eyedist 1 mult sub .setaim 500 6 add * abs sgn mult store
*.aim *.eye7dir add .eyedist 2 mult sub .setaim 500 7 add * abs sgn mult store
*.aim *.eye8dir add .eyedist 3 mult sub .setaim 500 8 add * abs sgn mult store
stop
'********************************************************************



'********************************************************************
'------------------------- Molester ---------------------------------
cond
*.creep 1 =
*.original 1 =
start
*.memval .alge !=
*.robage 15 < and
*.velup *.velup 3 div add .up store
*.veldx *.veldx 3 div add .dx store

*.eyef 0 !=
*.memval .alge = and
*.refxpos *.refypos angle .setaim store
*.refxpos *.xpos sub abs *.refypos *.ypos sub abs pyth 5 div 20 sub 0 floor 100 ceil *.refvelup add .up store
*.refveldx .dx store
-8 .shoot store
0 .shootval store
*.numties 0 = and
.tie inc

*.numties 0 >
*.tmemval .alge = and
*.tiepres .tienum store
dupbool
*.timer 2 mod 0 = and
.aimsx .tieloc store
300 .tieval store
dropbool
*.timer 2 mod 1 = and
.sexrepro .tieloc store
20 .tieval store

*.numties 0 >
*.robage 0 > and
*.tmemval *.dnalen != and
*.tmemval .alge != and
*.numties .deltie store
.strvenom .tieloc store
100 .tieval store

*.numties 0 =
*.tmemval .alge != or
0 .tieloc store
0 .tieval store

*.robage 30 >
'*.pain 10 > or
1 .fruitfly store
0 .creep store
stop
'********************************************************************



'********************************************************************
'------------------------- Fruitflies -------------------------------
'-------------------- (Slightly modified) ---------------------------
cond
*.nrg 15 >
*.numties 0 != or
*.fruitfly 1 = and
start

'-- Birth
*.robage 0 =
314 .aimright store
.deltie inc
'300 .eye5width store
.dnalen .memloc store
.dnalen .tmemloc store
15 rnd .rand store

*.rand 5 < and
*.rand .type store

*.type 0 =
6 rnd .type store


'-- Reproduction
*.body 5 >
*.nrg 150 > and
*.totalmyspecies .maxpop 2 mult < and
50 .repro store
*.tin9 234 != and
*.maxvel .dn store

*.totalmyspecies .maxpop <
*.nrg 300 > and
50 *.body 10 mult sub 0 floor .strbody store

'-- Shrinking
not
*.body 1 > and
*.body 10 mult 10 sub 0 floor .fdbody store

*.body 1 =
100 .strbody store
100 .fdbody store

'-- Tie feeding
*.numties 0 !=
*.tiepres .tienum store

*.tmemval *.dnalen =
*.numties 1 > or and
*.tin9 234 != and
*.numties .deltie store

*.numties 0 !=
*.robage 1 > and
*.trefxpos *.trefypos angle .setaim store
99 .sharenrg store

dupbool
*.memval .alge = and
*.trefxpos *.xpos sub abs *.trefypos *.ypos sub abs pyth 5 div 10 sub 0 floor *.maxvel ceil .up store
*.velsx .dx store

dropbool
dupbool
*.type 1 = and
.tieval .tieloc store
3200 .tieval store
*.memval .alge = and
.tieloc .shoot store
-1 .shootval store

dropbool
dupbool
*.type 2 = and
.shootval .tieloc store
-31999 .tieval store
*.memval .alge != and
*.timer 2 mod 0 = and
.mkslime .tieloc store

dropbool
dupbool
*.type 3 = and
.strvenom .tieloc store
100 .tieval store
*.numties .deltie store
*.memval .alge != and
*.timer 2 mod 0 = and
.fdbody .tieloc store

dropbool
dupbool
*.type 4 = and
.tieloc .tieloc store
-6 .tieval store
*.memval .alge = and
.tieval .shoot store
3200 .shootval store

dropbool
*.type 4 > and
.tieloc .tieloc store
-1 .tieval store
*.memval .alge = and
.tieval .shoot store
3200 .shootval store

*.tmemval *.dnalen =
0 .tieloc store
0 .tieval store

'-- Hunting
*.numties 0 =
*.body 1 = and
*.eyef 0 != and
*.memval *.dnalen != and
*.refbody 20 >
*.totalmyspecies 600 > or and
*.refxpos *.refypos angle .setaim store
.tie inc
*.memval .alge = and
*.velsx .dx store
*.refvelup 15 add *.maxvel ceil 0 floor .up store
.fixpos .shoot store
1 .shootval store
stop
'********************************************************************



'********************************************************************
'------------------------- Infected alge ----------------------------
cond
*.robage 0 >
*.original 1 !=
start
50 .repro store
.deltie inc
234 .tout9 store
234 .out9 store

*.nrg 300 >
dupbool
*.slime 300 < and
50 .mkslime store

dropbool
dupbool
*.shell 500 < and
500 *.shell sub 0 floor .mkshell store

dropbool
*.poison *.shell < and
*.shell 50 add *.poison sub 0 floor .mkpoison store

*.robage 1 =
.up .ploc store

*.robage 15 <
500 .dn store
70 .aimsx store

*.body 90 >
100 .fdbody store

*.robage 15 >=
*.nrg 2000 > and
dupbool
*.eyef 0 != and
*.memval *.dnalen = and
*.in9 234 != and
*.refxpos *.refypos angle .setaim store
.tie inc
0 .deltie store

dropbool
*.numties 0 > and
*.tmemval *.dnalen = and
*.tiepres .tienum store
-1 .tieloc store
1000 .tieval store
40 .stifftie store

*.numties 0 >
*.tmemval *.dnalen = and
*.tin9 234 != and
40 .stifftie store
1 .fixlen store
0 .deltie store
*.tielen 400 > and
*.trefxpos *.trefypos angle .setaim store
*.maxvel .up store

*.numties 0 >
*.tmemval *.dnalen != and
.strvenom .tieloc store
100 .tieval store
*.tin9 234 = or
*.numties .deltie store

*.shflav 0 !=
*.maxvel .dn store
*.velsx 2 mult .sx store
0 .shflav store
stop
'********************************************************************

9
Bot Tavern / The F3 league.
« on: October 21, 2008, 06:14:22 PM »
I started running some bots that qualified for F3... I think Animal minimalis qualifies aswell and if there are others feel free to mention them. Preferably F2 bots and such, there's already some evo bases in there...

There's no button for it, but just do everything as you would for F1 or F2 but write F3 in the field when starting the league (where it would normaly say F1 or F2).
You may want to start off running F1 or F2 to make sure all the settings are right (I'm not sure if it adjusts all the settings when running a league this way).
Still plenty of spots left, and I think there's some bots in the starting gate that would qualify, so I'll try to get more in there as I go along... anyone else is free to run bots and update the league if they want.

Added a lot of quick bots, it's the same bot with one or two genes added for each new bot... funny thing is when I ran them some of the simpler ones made it past Roto1 where some of the more advanced ones didn't
So the order is messed up, but I don't want to change that, it shows that smarter isn't always better
Still each bot shows an important step by taking the simples aproach I could think of.
(The original order was: Shoot, Reproduce, Body, Aim, Chase, Conspec, Boost, Eye, Defence)
(Currently running Roto2, but it's stuck fighting Body and the fight is going realy slow, but I think Body will win again)

Here's the current F3 league results (Still 14 empty slots):
1 - Big (F3) (Moonfisher) 19-10-08
2 - SWARM 2.0 (F3)(Elite)-10.03.07
3 - Defence
4 - Eye
5 - Spyrus (F3)(abyaly) 18-10-08
6 - Boost
7 - Aim
8 - Body
9 - Roto (F3) (Bacillus) 20-10-08
10- Conspec
11- Chase
12- Reproduce
13- C_Filans
14- C_Circumgirans
15- Shoot
16- C_Ancestralis

10
F3 bots / Big (F3) (Moonfisher) 19-10-08
« on: October 19, 2008, 09:47:40 AM »
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
Code: [Select]
'Big v1.0 (F3) 19-10-08
'by Moonfisher
'Not that clever... just goes ahead and shoots stuff, and grows big.
'The eyes are from excalibur.

def movebody 5000
def maxbody 10000
def x 10

cond
start
.deltie inc

*.memloc .dnalen !=
.dnalen .memloc store

*.nrg 500 <
*.body 100 > and
100 .fdbody store

*.nrg 2000 >
*.body *.nrg 4 div < and
*.body .maxbody < and
*.nrg 4 div *.body sub 10 mult .strbody store

*.eye5 0 !=
*.dnalen *.memval != and
10 .shootval store
*.refxpos *.refypos angle .setaim store
*.refveldx .dx store
*.refxpos *.xpos sub abs *.refypos *.ypos sub abs pyth 5 div 30 sub 0 floor 100 ceil *.refvelup add .up store

dupbool
*.refnrg *.refbody < and
-1 .shoot store

dropbool
dupbool
*.refnrg *.refbody >= and
-6 .shoot store

dropbool
not
*.body .movebody < and
*.maxvel .up store
*.robage 50 <
*.timer 30 mod 20 < or and
dupbool
*.eye9 *.eye1 != and
*.eye1 *.eye9 sub sgn 139 .x add mult .aimsx store
dropbool
dupbool
*.eye8 *.eye2 != and
*.eye2 *.eye8 sub sgn 104 .x add mult .aimsx store
dropbool
dupbool
*.eye7 *.eye3 != and
*.eye3 *.eye7 sub sgn 70 .x add mult .aimsx store
dropbool
dupbool
*.eye6 *.eye4 != and
*.eye4 *.eye6 sub sgn 35 .x add mult .aimsx store

*.eye5 0 !=
*.dnalen *.memval = and
*.body .movebody < and
150 .aimsx store

*.eye5 0 =
*.dnalen *.memval = or
*.body .movebody >= and
30 .aimsx store

*.shflav 0 !=
*.shang .aimshoot store
-6 .shoot store
10 .shootval store
0 .shflav store

*.eye5 0 =
*.memval *.dnalen = or
*.nrg 30000 > and
*.body .maxbody 3000 sub >
*.totalmyspecies 10 < or and
*.aim 314 add .setaim store
50 .repro store

*.robage 10 <
*.body 1500 > and
*.maxvel .dx store
stop

11
F2 bots / Spinner v1.52 (F2) (Moonfisher) 02-10-08
« on: October 02, 2008, 09:56:39 AM »
Had to add venom defences since a new F2 bot (Astronomo) was beating it with very litle effort.
It should win again now... and I think it should still beat the same old bots... but not 100% sure or anything...

Spinner v1.52 :

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
Code: [Select]
'Spinner v1.52 (F2) 02-10-08
'by Moonfisher
'Just added venom defences.


'------------------- 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 toponent 59
def genekill 60

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 543
def key2 1613
def key3 3306
def key4 4039
'(Key + 3200 must not exceed 8191)

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
'--- conspec
3 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
'-------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 '-- Also funny, but can mess up the stolen eye and shoot conspecs
65 .startloc 5 add store
.shootval .startloc 6 add store
32000 .startloc 7 add store
.strbody .startloc 8 add store
31999 .startloc 9 add store
'--------
.shoot .ploc store
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 .startkey sub 8192 mult *.robage 10 div add *.keyloc * add .out9 store
*.keyloc .startkey sub 8192 mult *.robage 10 div add *.keyloc * add .tout9 store
stop

cond
*.eyef 0 >
*.in9 24576 & 8192 div .startkey add * *.refage 10 div add *.in9 8191 & 1 sub >
*.in9 24576 & 8192 div .startkey add * *.refage 10 div add *.in9 8191 & 1 add <
start
.friend .oponent store
stop

cond
*.eyef 0 >
*.in9 24576 & 8192 div .startkey add * *.refage 10 div add *.in9 8191 & 1 sub <
*.in9 24576 & 8192 div .startkey add * *.refage 10 div add *.in9 8191 & 1 add > or
start
.enemy .oponent store
stop

cond
*.memval 0 =
*.refeye 0 =
*.refshoot 0 =
*.refshell 0 =
*.refpoison 0 =
*.refvenom 0 =
*.eyef 0 >
start
.alge .oponent store
stop

cond
*.eyef 0 =
*.robage 0 = or
start
0 .oponent store
stop

cond
*.numties 0 >
*.tin9 24576 & 8192 div .startkey add * *.trefage 10 div add *.tin9 8191 & 2 sub >
*.tin9 24576 & 8192 div .startkey add * *.trefage 10 div add *.tin9 8191 & 2 add < and
*.trefage 0 = or
start
.friend .toponent store
stop

cond
*.numties 0 >
*.tin9 24576 & 8192 div .startkey add * *.trefage 10 div add *.tin9 8191 & 2 sub <
*.tin9 24576 & 8192 div .startkey add * *.trefage 10 div add *.tin9 8191 & 2 add > or
*.trefage 0 >
start
.enemy .toponent store
stop

cond
*.tmemval 0 =
*.trefeye 0 =
*.trefshoot 0 =
*.trefshell 0 =
*.numties 0 >
start
'.alge .toponent store
stop

cond
*.numties 0 =
*.robage 0 = or
start
0 .toponent store
stop


'----- Poser conspecs
cond
*.memloc .memloc !=
*.memval 0 !=
start
*.memval *.memloc store
stop

cond
*.memloc .memloc !=
start
.memloc .memloc store
stop

cond
*.eyef 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
*.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
*.tin10 .tout10 store
stop

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

'--- Steal shoot
cond
*.eyef 0 >
*.refshoot *.myshoot <
*.refshoot 0 >
start
*.thisgene 1 add .delgene store

*.myshoot *.refshoot sub 1 >
*.thisgene 3 add .delgene store

*.myshoot *.refshoot sub 4 >
*.thisgene 4 add .delgene store

*.myshoot *.refshoot sub 9 >
*.thisgene 5 add .delgene store

*.myshoot *.refshoot sub 19 >
*.thisgene 6 add .delgene store

*.myshoot *.refshoot sub 39 >
*.thisgene 7 add .delgene store

clearbool
*.delgene .genekill store
stop

cond
0 1 =
start
0 .shoot store
stop

cond
0 1 =
start
0 .shoot store
stop

cond
0 1 =
start
0 .shoot store
0 .shoot store
stop

cond
0 1 =
start
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
stop

cond
0 1 =
start
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
stop

cond
0 1 =
start
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
stop

cond
0 1 =
start
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
stop

'--- Steal eyes
cond
*.eyef 0 >
*.refeye *.myeye <
*.refeye 0 >
start
*.thisgene 1 add .delgene store

*.myeye *.refeye sub 1 >
*.thisgene 3 add .delgene store

*.myeye *.refeye sub 4 >
*.thisgene 4 add .delgene store

*.myeye *.refeye sub 9 >
*.thisgene 5 add .delgene store

*.myeye *.refeye sub 19 >
*.thisgene 6 add .delgene store

*.myeye *.refeye sub 39 >
*.thisgene 7 add .delgene store

clearbool
*.delgene .genekill store
stop

cond
0 1 =
start
*.eye9 0 >
stop

cond
0 1 =
start
*.eye9 0 >
stop

cond
0 1 =
start
*.eye9 0 >
*.eye9 0 >
stop

cond
0 1 =
start
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
stop

cond
0 1 =
start
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
stop

cond
0 1 =
start
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
stop

cond
0 1 =
start
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
stop

'================================================

cond
*.state .torpedo =
*.oponent .alge =
*.nrg 500 >
start
.scaning .state store
stop

'================================================
'----- Shooting

cond
*.numties 0 =
*.paralyzed 0 =
*.state .scaning =
*.eyef 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 6 1 add store
*.refxpos .out4 store
*.refypos .out5 store
stop

cond
*.numties 0 !=
*.paralyzed 0 != or
*.state .scaning =
*.eyef 0 >
*.oponent .enemy =
start
.shootval 6 1 add store
-31999 .shootval store
stop

cond
*.eyef 0 =
*.oponent .friend = or
*.out4 0 !=
*.out5 0 != or
start
0 .out4 store
0 .out5 store
stop

cond
*.state .scaning =
*.eyef 0 >
*.oponent .enemy =
*.robage 5 mod 0 =
*.venom 1 >
*.numties 0 =
*.paralyzed 0 =
start
-3 6 1 add store
0 .shootval store
stop

cond
*.state .scaning =
*.eyef 0 >
*.robage 10 mod 0 =
*.oponent .alge =
*.venom 1 >
*.numties 0 =
*.paralyzed 0 =
start
-3 6 1 add store
0 .shootval store
stop

cond
*.state .scaning =
*.eyef 0 >
*.robage 10 mod 1 =
*.oponent .alge =
*.venom 1 >
*.numties 0 =
*.paralyzed 0 =
start
.setaim 6 1 add store
*.refxpos *.refypos angle 682 add .shootval store
stop

cond
'*.poisoned 0 =
*.body 50 >
*.state .scaning =
*.eyef 55 >
*.oponent .enemy =
*.oponent .alge = or
start
*.nrg 30 div 20 ceil *.eyef 40 sub 0 floor sgn *.body 40 sub 0 floor sgn mult mult 1 floor .shootval store
stop

'================================================


'================================================
'----- Spread

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 mod 16 >=
*.robage 200 >= or
start
*.aim 35 add .setaim store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 mod 16 <
*.robage 200 <
start
20 .dx store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 !=
*.oponent .friend =
*.robage 20 mod 16 >=
*.robage 200 >= or
start
*.aim 35 add .setaim store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 !=
*.oponent .friend =
*.robage 20 mod 16 <
*.robage 200 <
start
20 .dx store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.robage 100 >=
*.robage 1000 <
*.eyef 0 =
*.robage 20 mod 10 >
start
20 .dx store
stop

'================================================


'================================================
'----- Aim

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 >
*.oponent .friend = and or
'*.eye1 0 >
start
*.aim *.eye1dir add .setaim 500 1 add * abs sgn mult store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 >
*.oponent .friend = and or
'*.eye2 0 >
start
*.aim *.eye2dir add .setaim 500 2 add * abs sgn mult store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 >
*.oponent .friend = and or
'*.eye3 0 >
start
*.aim *.eye3dir add .setaim 500 3 add * abs sgn mult store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 >
*.oponent .friend = and or
'*.eye4 0 >
start
*.aim *.eye4dir add .setaim 500 4 add * abs sgn mult store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 >
*.oponent .friend = and or
'*.eye5 0 >
start
*.aim *.eye5dir add .setaim 500 5 add * abs sgn mult store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 >
*.oponent .friend = and or
'*.eye6 0 >
start
*.aim *.eye6dir add .setaim 500 6 add * abs sgn mult store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 >
*.oponent .friend = and or
'*.eye7 0 >
start
*.aim *.eye7dir add .setaim 500 7 add * abs sgn mult store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 >
*.oponent .friend = and or
'*.eye8 0 >
start
*.aim *.eye8dir add .setaim 500 8 add * abs sgn mult store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 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 =
*.eyef 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 <
*.eyef 0 =
*.oponent .friend = or
*.oponent .alge = or
start
32 .repro store
0 6 1 add store
stop

cond
*.state .scaning =
*.repspin 0 >
*.nrg 500 >
*.body 100 >
*.repspin 1 add *.robage =
*.repspin 2 add *.robage = or
*.totalmyspecies 70 >=
*.eyef 0 =
*.oponent .friend = or
*.oponent .alge = or
start
32 .repro store
0 6 1 add store
stop

cond
*.state .scaning =
*.repspin 0 >
*.oponent .enemy =
*.eyef 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 6 1 add store
stop

cond
*.paralyzed 25 >
*.body 50 >
*.nrg 100 >
start
30 .aimsx store
*.refxpos .birthx store
*.refypos .birthy store
.torpedo .birthstate store
5 .repro store
'0 6 1 add store
stop

cond
*.paralyzed 0 !=
*.shflav 0 !=
*.shflav -2 !=
start
*.shang .aimshoot store
.shootval 6 1 add store
-31999 .shootval 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 >
*.eyef 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
*.aim *.shang sub .setaim store
-3 6 1 add store
10 .shootval store
stop

cond
*.state .scaning =
*.shflav 0 !=
*.shflav -2 !=
*.shflav -3 !=
*.nrg 80 >
*.venom 5 <=
start
*.aim *.shang sub .setaim store
.setaim 6 1 add 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

cond
*.numties 0 >
*.robage 1 >
*.toponent .friend !=
start
*.tiepres .tienum store
.locs 1 sub rnd 2 mult .startloc add dup * .tieloc store
1 add * .tieval store
*.numties .deltie store
stop

'================================================


'================================================
'----- Torpedoes

cond
*.state .scaning =
*.oponent .enemy =
*.eyef 0 !=
*.eyef 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 6 1 add store
stop

cond
*.robage 1 >
*.body *.nrg add 200 <
*.oponent .alge !=
*.eyef 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 =
*.eyef 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 =
*.eyef 0 >
start
0 .up store
0 .dx store
0 .sx store
0 .tie store
*.aim *.eye8dir add .setaim store
stop

cond
*.state .torpedo =
*.toponent .enemy =
*.numties 0 >
*.robage 1 >
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 =
*.toponent .friend =
*.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 !=
*.delgene *.genekill !=
start
0 .delgene store
stop

'================================================

end

12
Short bots / Fruit Flies v0.21 (F1) (Moonfisher) 28-09-08
« on: September 28, 2008, 10:12:08 AM »
Ok this time it beats the old version  A litle bit longer, but not realy more complex or anything.

Code: [Select]
'Fruit Flies v0.21 (for DB2.43.1L)
'By Moonfisher : 28-09-08
'A very simple tie feeder for F1.
'Beats EtchII and everything else I've tried it on so far. So it should beat the current F1 league I think.
'The reproduction gene is capped at 1000, if it's still too slow try 700, although that could change the results.
'No fancy eyes or conspec or anything of that sort, just a very simple strategy.
'v0.2 : Now addapts to it's oponent through natural selection.
'It also beats most oponents a lot faster, but has a slightly harder time beating Etch II.
'It's also now one gene and generaly shorter, planning to use it as a virus for an alge.
'v0.21 : Now beats v0.1

def maxpop 1000
def alge 13

def rand 110
def type 973

cond
*.nrg 15 >
*.numties 0 != or
start
.fixpos dec

'-- Birth
*.robage 0 =
314 .aimright store
.deltie inc
300 .eye5width store
.dnalen .memloc store
.dnalen .tmemloc store
15 rnd .rand store

*.rand 5 < and
*.rand .type store

*.type 0 =
5 rnd .type store


'-- Reproduction
*.body 5 >
*.nrg 80 > and
*.totalmyspecies .maxpop 2 mult < and
*.maxvel .dn store
50 .repro store

*.totalmyspecies .maxpop <
*.nrg 200 > and
50 *.body 10 mult sub 0 floor .strbody store

'-- Shrinking
not
*.body 1 > and
*.body 10 mult 10 sub 0 floor .fdbody store


'-- Tie feeding
*.numties 0 !=
*.tiepres .tienum store

*.tmemval *.dnalen =
*.numties 1 > or and
*.numties .deltie store

*.numties 0 !=
*.robage 1 > and
*.trefxpos *.trefypos angle .setaim store
99 .sharenrg store

dupbool
*.memval .alge = and
*.trefxpos *.xpos sub abs *.trefypos *.ypos sub abs pyth 5 div 10 sub 0 floor *.maxvel ceil .up store
*.velsx .dx store

dropbool
dupbool
*.type 1 = and
.tieval .tieloc store
3200 .tieval store
*.memval .alge = and
.tieloc .shoot store
-1 .shootval store

dropbool
dupbool
*.type 2 = and
.shootval .tieloc store
-31999 .tieval store

dropbool
dupbool
*.type 3 = and
.tieloc .tieloc store
-6 .tieval store
*.memval .alge = and
.tieval .shoot store
3200 .shootval store

dropbool
*.type 3 > and
.tieloc .tieloc store
-1 .tieval store
*.memval .alge = and
.tieval .shoot store
3200 .shootval store


'-- Hunting
*.numties 0 =
*.body 1 = and
dupbool
*.eye5 0 =
*.memval *.dnalen = or and
350 .aimright store

dropbool
*.eye5 0 != and
*.memval *.dnalen != and
*.refbody 20 >
*.totalmyspecies 600 > or and
*.refxpos *.refypos angle .setaim store
.tie inc
*.memval .alge = and
*.velsx .dx store
*.refvelup 15 add *.maxvel ceil 0 floor .up store
.fixpos .shoot store
1 .shootval store
stop

end

This time one of the tie attacks realy messes up the maxpop....
So added the old condition again, but I let it reproduce when convenient up to twice the maxpop this time, just to be safe...
You can probably reduce the maxpop value, or just set the convenient repoduction cap down to 1000 if your sim is freezing, but I can't garantee that it won't change it's performance...
You can also try setting the maxpop to 32000 if you want to see how many cycles it takes to completely freeze the sim

13
F2 bots / Spinner v1.51 (F2) (Moonfisher) 26-09-08
« on: September 25, 2008, 11:12:41 PM »
There's nothing new in here, just removed the counter leeching because some where oposed to it in F2, and made it imune to a certain tie attack used by republican wasp....
Thats it... just didn't want to leave it at the bottom of F1... it also looks like republican wasp can be anoying to get past, it doesn't survive very well (Although it survives a lot better if you remove the line of code that causes it to shoot at times ) but it has a strong tie attack that will kill off a lot of bot types... so it's a tough one for newcommers to beat....

Anyway the updated version of spinner, just calling it 1.51 since theres nothing new in there this time.

Code: [Select]
'Spinner v1.51 (F2) 26-09-08
'by Moonfisher
'No major changes, imune to .shootval tie attack now (To beat republican wasp)
'And no counter leeching since it was unclear if F2 allowed counter leeching.
'So a couple of small fixes that's all.


'------------------- 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 toponent 59
def genekill 60

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 543
def key2 1613
def key3 3306
def key4 4039
'(Key + 3200 must not exceed 8191)

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
'--- conspec
3 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
'-------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 '-- Also funny, but can mess up the stolen eye and shoot conspecs
65 .startloc 5 add store
.shootval .startloc 6 add store
32000 .startloc 7 add store
.strbody .startloc 8 add store
31999 .startloc 9 add store
'--------
.shoot .ploc store
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 .startkey sub 8192 mult *.robage 10 div add *.keyloc * add .out9 store
*.keyloc .startkey sub 8192 mult *.robage 10 div add *.keyloc * add .tout9 store
stop

cond
*.eyef 0 >
*.in9 24576 & 8192 div .startkey add * *.refage 10 div add *.in9 8191 & 1 sub >
*.in9 24576 & 8192 div .startkey add * *.refage 10 div add *.in9 8191 & 1 add <
start
.friend .oponent store
stop

cond
*.eyef 0 >
*.in9 24576 & 8192 div .startkey add * *.refage 10 div add *.in9 8191 & 1 sub <
*.in9 24576 & 8192 div .startkey add * *.refage 10 div add *.in9 8191 & 1 add > or
start
.enemy .oponent store
stop

cond
*.memval 0 =
*.refeye 0 =
*.refshoot 0 =
*.refshell 0 =
*.refpoison 0 =
*.refvenom 0 =
*.eyef 0 >
start
.alge .oponent store
stop

cond
*.eyef 0 =
*.robage 0 = or
start
0 .oponent store
stop

cond
*.numties 0 >
*.tin9 24576 & 8192 div .startkey add * *.trefage 10 div add *.tin9 8191 & 2 sub >
*.tin9 24576 & 8192 div .startkey add * *.trefage 10 div add *.tin9 8191 & 2 add < and
*.trefage 0 = or
start
.friend .toponent store
stop

cond
*.numties 0 >
*.tin9 24576 & 8192 div .startkey add * *.trefage 10 div add *.tin9 8191 & 2 sub <
*.tin9 24576 & 8192 div .startkey add * *.trefage 10 div add *.tin9 8191 & 2 add > or
*.trefage 0 >
start
.enemy .toponent store
stop

cond
*.tmemval 0 =
*.trefeye 0 =
*.trefshoot 0 =
*.trefshell 0 =
*.numties 0 >
start
'.alge .toponent store
stop

cond
*.numties 0 =
*.robage 0 = or
start
0 .toponent store
stop


'----- Poser conspecs
cond
*.memloc .memloc !=
*.memval 0 !=
start
*.memval *.memloc store
stop

cond
*.memloc .memloc !=
start
.memloc .memloc store
stop

cond
*.eyef 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
*.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
*.tin10 .tout10 store
stop

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

'--- Steal shoot
cond
*.eyef 0 >
*.refshoot *.myshoot <
*.refshoot 0 >
start
*.thisgene 1 add .delgene store

*.myshoot *.refshoot sub 1 >
*.thisgene 3 add .delgene store

*.myshoot *.refshoot sub 4 >
*.thisgene 4 add .delgene store

*.myshoot *.refshoot sub 9 >
*.thisgene 5 add .delgene store

*.myshoot *.refshoot sub 19 >
*.thisgene 6 add .delgene store

*.myshoot *.refshoot sub 39 >
*.thisgene 7 add .delgene store

clearbool
*.delgene .genekill store
stop

cond
0 1 =
start
0 .shoot store
stop

cond
0 1 =
start
0 .shoot store
stop

cond
0 1 =
start
0 .shoot store
0 .shoot store
stop

cond
0 1 =
start
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
stop

cond
0 1 =
start
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
stop

cond
0 1 =
start
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
stop

cond
0 1 =
start
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
0 .shoot store
stop

'--- Steal eyes
cond
*.eyef 0 >
*.refeye *.myeye <
*.refeye 0 >
start
*.thisgene 1 add .delgene store

*.myeye *.refeye sub 1 >
*.thisgene 3 add .delgene store

*.myeye *.refeye sub 4 >
*.thisgene 4 add .delgene store

*.myeye *.refeye sub 9 >
*.thisgene 5 add .delgene store

*.myeye *.refeye sub 19 >
*.thisgene 6 add .delgene store

*.myeye *.refeye sub 39 >
*.thisgene 7 add .delgene store

clearbool
*.delgene .genekill store
stop

cond
0 1 =
start
*.eye9 0 >
stop

cond
0 1 =
start
*.eye9 0 >
stop

cond
0 1 =
start
*.eye9 0 >
*.eye9 0 >
stop

cond
0 1 =
start
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
stop

cond
0 1 =
start
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
stop

cond
0 1 =
start
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
stop

cond
0 1 =
start
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
*.eye9 0 >
stop

'================================================

cond
*.state .torpedo =
*.oponent .alge =
*.nrg 500 >
start
.scaning .state store
stop

'================================================
'----- Shooting

cond
*.numties 0 =
*.state .scaning =
*.eyef 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 6 1 add store
*.refxpos .out4 store
*.refypos .out5 store
stop

cond
*.poisoned 0 =
*.body 50 >
*.state .scaning =
*.eyef 55 >
*.oponent .enemy =
*.oponent .alge = or
start
*.nrg 30 div 20 ceil *.eyef 40 sub 0 floor sgn *.body 40 sub 0 floor sgn mult mult 1 floor .shootval store
stop

cond
*.eyef 0 =
*.oponent .friend = or
*.out4 0 !=
*.out5 0 != or
start
0 .out4 store
0 .out5 store
stop

cond
*.state .scaning =
*.eyef 0 >
*.oponent .enemy =
*.robage 5 mod 0 =
*.venom 1 >
*.numties 0 =
start
-3 6 1 add store
0 .shootval store
stop

cond
*.state .scaning =
*.eyef 0 >
*.robage 10 mod 0 =
*.oponent .alge =
*.venom 1 >
*.numties 0 =
start
-3 6 1 add store
0 .shootval store
stop

cond
*.state .scaning =
*.eyef 0 >
*.robage 10 mod 1 =
*.oponent .alge =
*.venom 1 >
*.numties 0 =
start
.setaim 6 1 add store
*.refxpos *.refypos angle 682 add .shootval store
stop

'================================================


'================================================
'----- Spread

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 mod 16 >=
*.robage 200 >= or
start
*.aim 35 add .setaim store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 mod 16 <
*.robage 200 <
start
20 .dx store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 !=
*.oponent .friend =
*.robage 20 mod 16 >=
*.robage 200 >= or
start
*.aim 35 add .setaim store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 !=
*.oponent .friend =
*.robage 20 mod 16 <
*.robage 200 <
start
20 .dx store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.robage 100 >=
*.robage 1000 <
*.eyef 0 =
*.robage 20 mod 10 >
start
20 .dx store
stop

'================================================


'================================================
'----- Aim

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 >
*.oponent .friend = and or
'*.eye1 0 >
start
*.aim *.eye1dir add .setaim 500 1 add * abs sgn mult store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 >
*.oponent .friend = and or
'*.eye2 0 >
start
*.aim *.eye2dir add .setaim 500 2 add * abs sgn mult store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 >
*.oponent .friend = and or
'*.eye3 0 >
start
*.aim *.eye3dir add .setaim 500 3 add * abs sgn mult store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 >
*.oponent .friend = and or
'*.eye4 0 >
start
*.aim *.eye4dir add .setaim 500 4 add * abs sgn mult store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 >
*.oponent .friend = and or
'*.eye5 0 >
start
*.aim *.eye5dir add .setaim 500 5 add * abs sgn mult store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 >
*.oponent .friend = and or
'*.eye6 0 >
start
*.aim *.eye6dir add .setaim 500 6 add * abs sgn mult store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 >
*.oponent .friend = and or
'*.eye7 0 >
start
*.aim *.eye7dir add .setaim 500 7 add * abs sgn mult store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 0 =
*.robage 20 >
*.oponent .friend = and or
'*.eye8 0 >
start
*.aim *.eye8dir add .setaim 500 8 add * abs sgn mult store
stop

cond
*.state .scaning =
*.state .torpedo = or
*.eyef 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 =
*.eyef 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 <
*.eyef 0 =
*.oponent .friend = or
*.oponent .alge = or
start
32 .repro store
0 6 1 add store
stop

cond
*.state .scaning =
*.repspin 0 >
*.nrg 500 >
*.body 100 >
*.repspin 1 add *.robage =
*.repspin 2 add *.robage = or
*.totalmyspecies 70 >=
*.eyef 0 =
*.oponent .friend = or
*.oponent .alge = or
start
32 .repro store
0 6 1 add store
stop

cond
*.state .scaning =
*.repspin 0 >
*.oponent .enemy =
*.eyef 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 6 1 add 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 >
*.eyef 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
*.aim *.shang sub .setaim store
-3 6 1 add store
10 .shootval store
stop

cond
*.state .scaning =
*.shflav 0 !=
*.shflav -2 !=
*.shflav -3 !=
*.nrg 80 >
*.venom 5 <=
start
*.aim *.shang sub .setaim store
.setaim 6 1 add 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

cond
*.numties 0 >
*.robage 1 >
*.toponent .friend !=
start
*.tiepres .tienum store
.locs 1 sub rnd 2 mult .startloc add dup * .tieloc store
1 add * .tieval store
*.numties .deltie store
stop

'================================================


'================================================
'----- Torpedoes

cond
*.state .scaning =
*.oponent .enemy =
*.eyef 0 !=
*.eyef 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 6 1 add store
stop

cond
*.robage 1 >
*.body *.nrg add 200 <
*.oponent .alge !=
*.eyef 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 =
*.eyef 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 =
*.eyef 0 >
start
0 .up store
0 .dx store
0 .sx store
0 .tie store
*.aim *.eye8dir add .setaim store
stop

cond
*.state .torpedo =
*.toponent .enemy =
*.numties 0 >
*.robage 1 >
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 =
*.toponent .friend =
*.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 !=
*.delgene *.genekill !=
start
0 .delgene store
stop

'================================================

end

14
Short bots / Fruit Flies v0.2 (F1) (Moonfisher) 25-09-08
« on: September 25, 2008, 09:47:20 AM »
This version uses natural selection to adapt to the oponent... finaly some evolution in F1
Bit slower against Etch II... but faster against a lot of others...
And it DOES beat Pacifist in version L... atleast every time I tried it, but so did v0.1... not sure how it performs in other versions, only tryed it in DB 2.43.1L...
Also don't use a 600 maxpop, should be at least 700... and the popcap doesn't stop reproduction now it just slows it down considerably.
If a fight is taking too long and the pop is getting too high, then you can change :

This :
Code: [Select]
'-- Reproduction
*.body 5 >
*.nrg 80 > and
*.maxvel .dn store
50 .repro store

To this :
Code: [Select]
'-- Reproduction
*.body 5 >
*.totalmyspecies .maxpop < and
*.nrg 80 > and
*.maxvel .dn store
50 .repro store

And the popcap should be more stable... was tring to make the thing as short as possible, that may have been one condition I shouldn't have cut

Code: [Select]
'Fruit Flies v0.2 (for DB2.43.1L)
'By Moonfisher
'A very simple tie feeder for F1.
'Beats EtchII and everything else I've tried it on so far. So it should beat the current F1 league I think.
'The reproduction gene is capped at 1000, if it's still too slow try 700, although that could change the results.
'No fancy eyes or conspec or anything of that sort, just a very simple strategy.
'v0.2 : Now addapts to it's oponent through natural selection.
'It also beats most oponents a lot faster, but has a slightly harder time beating Etch II.
'It's also now one gene and generaly shorter, planning to use it as a virus for an alge.

def maxpop 1000
def rand 110
def type 973

cond
*.nrg 10 >
*.numties 0 != or
start
.fixpos dec

'-- Birth
*.robage 0 =
628 rnd 314 sub .aimright store
300 .eye5width store
.dnalen .memloc store
.dnalen .tmemloc store
15 rnd .rand store

*.rand 3 < and
*.rand .type store

*.type 0 =
4 rnd .type store


'-- Reproduction
*.body 5 >
*.nrg 80 > and
*.maxvel .dn store
50 .repro store

*.totalmyspecies .maxpop <
*.nrg 200 > and
60 *.body 10 mult sub .strbody store


'-- Shrinking
not
*.body 1 > and
*.body 10 mult 10 sub 0 floor .fdbody store


'-- Tie feeding
*.numties 0 !=
*.tiepres .tienum store
*.trefxpos *.trefypos angle .setaim store

*.tmemval *.dnalen =
*.numties 1 > or and
*.numties .deltie store

*.numties 0 !=
*.robage 1 > and
*.maxvel .up store
*.velsx .dx store

dupbool
*.type 1 = and
.tieval .tieloc store
1000 .tieval store
.tieloc .shoot store
-1 .shootval store

dropbool
*.type 1 > and
.tieloc .tieloc store
-1 .tieval store
.tieval .shoot store
1000 .shootval store


'-- Hunting
*.numties 0 =
*.body 1 = and
dupbool
*.eye5 0 =
*.memval *.dnalen = or and
350 .aimright store

dropbool
*.eye5 0 != and
*.memval *.dnalen != and
*.refbody 20 >
*.totalmyspecies 600 > or and
*.refxpos *.refypos angle .setaim store
.tie inc
*.velsx .dx store
*.maxvel .up store
.fixpos .shoot store
1 .shootval store
stop

end

(Did a quick edit, added 2 conditions for the main gene as a way of semi hibernating, nothing major, just makes them last a litle longer )

15
Short bots / Fruit Flies 0.1 (F1) (Moonfisher) 23-09-08
« on: September 22, 2008, 10:52:01 PM »
So... finaly got some time to make a bot. Figured I'd take a good look at Etch II
It beats Etch II and everything else I tryed... I think it should be able to take first place in F1...
It's a very simple strategy, and probably not that hard to beat... but it works for now

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
Code: [Select]
'Fruit Flies 0.1 (for DB2.43.1L)
'By Moonfisher
'A very simple tie feeder for F1.
'Beats EtchII and everything else I've tried it on so far. So it should beat the current F1 league I think.
'The reproduction gene is capped at 1000, if it's still too slow try 600-700, although that could change the results.
'No fancy eyes or conspec or anything of that sort, just a very simple strategy.

def alge 13
def popcap 1000

'-- Birth
cond
*.robage 0 =
start
.deltie inc
314 .aimright store
300 .eye5width store
.dnalen .memloc store
.dnalen .tmemloc store
stop

'-- Reproduction
cond
*.totalmyspecies .popcap < '--- This is to cap the population so the fight doesn't freeze.
start

*.body 6 >
*.nrg 80 >
*.maxvel .dn store
50 .repro store

clearbool
*.body 6 <=
*.nrg 200 >
10 .strbody store
stop

'-- Shrinking
cond
*.body 1 >
start
clearbool
*.nrg 200 <=
*.totalmyspecies .popcap > or
*.body 10 mult 10 sub 0 floor .fdbody store
stop

'-- Tie feeding
cond
*.robage 0 >
*.numties 0 !=
start

clearbool
*.tmemval *.dnalen =
*.numties 1 > or
*.body 50 > or
*.numties .deltie store

clearbool
*.tiepres .tienum store
*.trefxpos *.trefypos angle .setaim store

*.trefbody 20 >
*.nrg 10 >
*.maxvel .up store
*.velsx .dx store
.tieval .tieloc store
1000 .tieval store
.tieloc .shoot store
-1 .shootval store

clearbool
*.trefbody 20 <=
.tieloc .tieloc store
-6 .tieval store
stop

'-- Hunting
cond
*.numties 0 =
*.body 1 =
*.nrg 10 >
start

clearbool
*.eye5 0 =
110 .aimright store

clearbool
*.eye5 0 !=
*.memval *.dnalen =
314 .aimright store

clearbool
*.eye5 0 !=
*.memval *.dnalen !=
*.refbody 10 >
*.refshell 0 > or
*.refxpos *.refypos angle .setaim store
.tie inc
*.velsx .dx store
*.maxvel .up store
.memloc .shoot store
-1 .shootval store

*.memval .alge =
.fixpos .shoot store
1 .shootval store
stop

cond
start
0 .fixpos *.fixpos 0 sub dup div mult store
stop

end

Pages: [1] 2 3