Author Topic: Battlestar bot 4-28-08  (Read 3479 times)

Offline Reiyuki

  • Bot Neophyte
  • *
  • Posts: 8
    • View Profile
Battlestar bot 4-28-08
« on: April 28, 2008, 11:14:48 PM »
I never thought I'd waste this much time and have so much fun doing so.  I rebuilt the battlestar bot from scratch and made it into a fairly reliable setup.  (launch them at 5000nrg or above, preferably 30k)

Nifty features:
 - Battlestar (mothership) randomly spews tiny drone ships to scour the land for resources
 - When drones gather 2500 nrg, they will return to base and dump their cargo
 - If drones see each other, they will trade parent locations and return to the stronger parent when full
 - Eyetracking algorithm results in minor flocking patterns


Future ideas:
 - Virus delivery (cause robots to zombie toward the mothership)
 - Inter-mothership communication/coordination  (motherships congregate and share power)
 - Tie-proofing and/or tie feeding
 - Proper poison/venom swarming


Something tells me I'll be at this all week until I can get it to withstand spinners
have fun



 cond
 *.out1 3 =
 *.pleas 1 <
 *.nrg 2500 >
 start
 4 .out1 store
 stop
''''''''''''''''''''''''  Gene:  1 Ends at position  15  '''''''''''''''''''''''
 cond
 *.out1 4 =
 *.eye5 60 >
 *.in3 *.out3 =
 *.in4 *.out4 =
 start
 *.nrg 2 div .shootval store
 -2 .shoot store
 stop
''''''''''''''''''''''''  Gene:  2 Ends at position  38  '''''''''''''''''''''''
 cond
 *.out1 4 =
 *.in2 *.out2 !=
 *.in1 1 !=
 start
 *.out3 *.out4 angle .setaim store
 5 .up store
 stop
''''''''''''''''''''''''  Gene:  3 Ends at position  58  '''''''''''''''''''''''
 cond
 *.out1 3 =
 *.out1 2 =
 or
 *.robage 2 >
 *.vel 40 <
 *.eye5 10 <
 start
 15 .up store
 10 rnd 5 sub .aimright store
 stop
''''''''''''''''''''''''  Gene:  4 Ends at position  86  '''''''''''''''''''''''
 cond
 *.out1 3 =
 *.out1 4 =
 or
 *.out1 2 =
 or
 *.eye5 20 <
 *.eye1 0 >
 *.eye9 0 >
 or
 *.eye3 20 >
 or
 *.eye7 20 >
 or
 start
 *.eye1 1 ceil *.eye9 1 ceil sub 140 mult .aimleft store
 *.eye8 *.eye2 sub *.eye7 add *.eye3 4 div sub .aimright store
 stop
''''''''''''''''''''''''  Gene:  5 Ends at position  140  '''''''''''''''''''''''
 cond
 *.out1 3 =
 *.out1 4 =
 or
 *.out1 2 =
 or
 *.eye5 10 >
 *.eye5 200 <
 *.refeye *.myeye !=
 start
 *.refveldx .dx store
 *.refvelup 90 add .up store
 *.refxpos *.refypos angle .setaim store
 stop
''''''''''''''''''''''''  Gene:  6 Ends at position  176  '''''''''''''''''''''''
 cond
 *.out1 3 =
 *.eye5 0 >
 *.in2 *.out2 =
 start
 *.refveldx .dx store
 *.refvelup 20 add .up store
 *.refaim .setaim store
 stop
''''''''''''''''''''''''  Gene:  7 Ends at position  199  '''''''''''''''''''''''
 cond
 *.out1 3 =
 *.out1 2 =
 or
 *.eye5 80 >
 *.refeye *.myeye !=
 *.in2 100 <
 *.in3 100 <
 start
 *.pain 2 div 1 floor 4 add 25 ceil 3 *.out1 mod 1 ceil mult 1 add .shootval store
 -1 .shoot store
 *.refxpos *.refypos angle .setaim store
 *.refvelup 1 add .up store
 stop
''''''''''''''''''''''''  Gene:  8 Ends at position  253  '''''''''''''''''''''''
 cond
 *.out1 3 =
 *.in2 *.out2 >
 *.myeye *.refeye =
 start
 *.in2 .out2 store
 *.in3 .out3 store
 *.in4 .out4 store
 stop
''''''''''''''''''''''''  Gene:  9 Ends at position  274  '''''''''''''''''''''''
 cond
 *.out1 3 =
 *.out1 2 =
 or
 *.in1 4 =
 start
 *.refaim 618 add .setaim store
 stop
''''''''''''''''''''''''  Gene:  10 Ends at position  292  '''''''''''''''''''''''
 cond
 *.robage 3 =
 start
 -2 .venval store
 7 .vloc store
 30 .strvenom store
 stop
''''''''''''''''''''''''  Gene:  11 Ends at position  307  '''''''''''''''''''''''
 cond
 *.in3 100 <
 *.eye5 60 >
 *.robage 4 mod 0 =
 *.refeye *.myeye !=
 *.refshoot 0 !=
 start
 19 .vloc store
 *.refxpos *.refypos angle 628 add .venval store
 5 .shootval store
 -3 .shoot store
 5 .strvenom store
 stop
''''''''''''''''''''''''  Gene:  12 Ends at position  346  '''''''''''''''''''''''
 cond
 *.in3 100 <
 *.eye5 60 >
 *.robage 4 mod 1 =
 *.refeye *.myeye !=
 *.refshoot 0 !=
 start
 8 .vloc store
 800 .venval store
 5 .shootval store
 -3 .shoot store
 5 .strvenom store
 stop
''''''''''''''''''''''''  Gene:  13 Ends at position  381  '''''''''''''''''''''''
 cond
 *.in3 100 <
 *.eye5 60 >
 *.robage 4 mod 2 =
 *.refeye *.myeye !=
 *.refshoot 0 !=
 start
 7 .vloc store
 -2 .venval store
 5 .shootval store
 -3 .shoot store
 5 .strvenom store
 stop
''''''''''''''''''''''''  Gene:  14 Ends at position  416  '''''''''''''''''''''''
 cond
 *.out1 3 =
 *.robage 1 >
 start
 *.genes .delgene store
 stop
''''''''''''''''''''''''  Gene:  15 Ends at position  428  '''''''''''''''''''''''
 cond
 *.robage 1 =
 *.nrg 5000 <
 start
 3 .out1 store
 330 *.robage 1 add mult inc
 .deltie inc
 618 .aimright store
 *.in2 .out2 store
 *.in3 .out3 store
 *.in4 .out4 store
 *.body 10 mult 100 sub .fdbody store
 stop
''''''''''''''''''''''''  Gene:  16 Ends at position  467  '''''''''''''''''''''''
 cond
 *.robage 1 =
 *.nrg 3000 >=
 start
 2 .out1 store
 330 *.robage 1 add mult inc
 .deltie inc
 618 .aimright store
 stop
''''''''''''''''''''''''  Gene:  17 Ends at position  490  '''''''''''''''''''''''
 cond
 *.out1 2 =
 *.robage 100 >
 *.nrg 10000 >
 start
 *.vel -1 mult .up store
 1 .out1 store
 *.nrg .out2 store
 *.xpos .out3 store
 *.ypos .out4 store
 7 .ploc store
 stop
''''''''''''''''''''''''  Gene:  18 Ends at position  522  '''''''''''''''''''''''
 cond
 *.out1 0 =
 *.out1 2 =
 or
 *.nrg 10000 >
 *.refeye *.myeye !=
 *.vel 0 =
 start
 1 .out1 store
 *.nrg .out2 store
 *.xpos .out3 store
 *.ypos .out4 store
 7 .ploc store
 stop
''''''''''''''''''''''''  Gene:  19 Ends at position  556  '''''''''''''''''''''''
 cond
 *.out1 1 =
 *.eye5 20 <
 *.eye1 0 >
 *.eye9 0 >
 or
 *.eye3 20 >
 or
 *.eye7 20 >
 or
 start
 *.eye1 1 ceil *.eye9 1 ceil sub 140 mult .aimleft store
 *.eye8 *.eye2 sub *.eye7 add *.eye3 4 div sub .aimright store
 stop
''''''''''''''''''''''''  Gene:  20 Ends at position  602  '''''''''''''''''''''''
 cond
 *.out1 1 =
 *.eye5 30 >
 *.refeye *.myeye !=
 *.in2 100 <
 *.in3 100 <
 *.refbody 4 >
 start
 *.pain 2 div 1 floor 4 add 25 ceil .shootval store
 -1 .shoot store
 *.refxpos *.refypos angle .setaim store
 stop
''''''''''''''''''''''''  Gene:  21 Ends at position  642  '''''''''''''''''''''''
 cond
 *.out1 1 =
 *.robage 5 mod *.pain add 4 >=
 *.eye5 30 <
 *.in1 0 !=
 or
 start
 120 .aimright store
 stop
''''''''''''''''''''''''  Gene:  22 Ends at position  665  '''''''''''''''''''''''
 cond
 *.out1 1 =
 *.nrg 16000 >
 *.body 30000 <
 start
 100 .strbody store
 stop
''''''''''''''''''''''''  Gene:  23 Ends at position  680  '''''''''''''''''''''''
 cond
 *.out1 1 =
 *.nrg 10000 <
 start
 100 .fdbody store
 stop
''''''''''''''''''''''''  Gene:  24 Ends at position  692  '''''''''''''''''''''''
 cond
 *.out1 1 =
 *.nrg 11000 >
 *.slime 500 <
 start
 50 .mkslime store
 stop
''''''''''''''''''''''''  Gene:  25 Ends at position  707  '''''''''''''''''''''''
 cond
 *.out1 1 =
 *.nrg 16000 >
 *.shell 10000 <
 start
 100 .mkshell store
 100 .mkpoison store
 stop
''''''''''''''''''''''''  Gene:  26 Ends at position  725  '''''''''''''''''''''''
 cond
 *.out1 1 =
 *.waste 1000 >
 start
 1000 .shootval store
 -4 .shoot store
 stop
''''''''''''''''''''''''  Gene:  27 Ends at position  740  '''''''''''''''''''''''
 cond
 *.out1 1 =
 *.out3 *.out4 dist 50 >
 start
 *.out3 *.out4 angle .setaim store
 1 .up store
 0 .dx store
 stop
''''''''''''''''''''''''  Gene:  28 Ends at position  762  '''''''''''''''''''''''
 cond
 *.out1 1 =
 *.robage 50 mod 1 =
 *.eye5 50 <
 start
 2 .repro store
 stop
''''''''''''''''''''''''  Gene:  29 Ends at position  779  '''''''''''''''''''''''
 cond
 *.out1 1 =
 *.out1 2 =
 or
 *.mkvirus 0 !=
 start
 *.mkvirus .delgene store
 stop
''''''''''''''''''''''''  Gene:  30 Ends at position  795  '''''''''''''''''''''''

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Battlestar bot 4-28-08
« Reply #1 on: April 29, 2008, 01:21:28 PM »
It seems to get confused a lot... tryed no fluid, thing fluid and transitory...
Seems thin fluids are best, but it seems like the base should save it's position and move back if it's pushed too far away...
If you want it to beat spinner you should probably start with v1.1 or 1.0, since the newest version uses ties rather agressively... so you would need some good tie defences and counter moves if you want it to beat the new ones.
I'm not sure if you want it to be an F2 bot, seems that way... but I think it would perform a lot better if it used tie feeding.
The trick is that your small bots are so small they can't drain the alge effectively... but you can make the alge feed you instead :

'Conspec, just so it's all there
def mykey 50

cond
*.robage 0 =
start
123 .mykey store
.mykey .tmemloc store
stop

'Eating alge
cond
*.tmemval *.mykey !=
*.numties 0 >
start
'The usual stuff :
*.trefxpos *.trefypos angle .setaim store
20 .up store
*.tiepres .tienum store
99 .sharenrg store

'The actual trick.
'Push a positive value into the alge's tieval
.tieval .tieloc store
1000 .tieval store
'Shoot -1 or -6 into the alge's tieloc
.tieloc .shoot store
-1 .shootval store
*.trefnrg 1000 <
-6 .shootval store
stop

'Feeding the base
cond
*.tmemval *.mykey =
*.trefbody 1000 >
*.numties 0 >
start
*.tiepres .tienum store
-1 .tieloc store
1000 .tieval store
stop

Or something like that anyway...
It still needs to avoid confusion among the drones though...
And the conspec can be tricked :

cond
*.robage 0 =
start
.tmemloc .tmemloc store
stop

cond
*.tmemloc .tmemloc !=
start
*.tmemval *.tmemloc store
.tmemloc .tmemloc store
stop

cond
*.numties 0 >
*.tmemloc .tmemloc =
*.tmemval 0 >
*.tmemval .tmemloc !=
start
*.tmemval .tmemloc store
stop


And ofcourse you can prevent this by saving you key in several places and checking a random one, so if a bot hasstolen a conspec it will still be visible to most bots... or you can add robage to your key every X cycles, and check to see if *.trefage *.key add is withing the right range (x)... this way a stolen key will expire after x cycles... or you can combine the 2...
The same works for .memloc/.memval ofcourse...
« Last Edit: April 29, 2008, 01:44:35 PM by Moonfisher »

Offline Reiyuki

  • Bot Neophyte
  • *
  • Posts: 8
    • View Profile
Battlestar bot 4-28-08
« Reply #2 on: April 29, 2008, 02:18:03 PM »
Quote from: Moonfisher
It seems to get confused a lot... tryed no fluid, thing fluid and transitory...
Seems thin fluids are best, but it seems like the base should save it's position and move back if it's pushed too far away...
If you want it to beat spinner you should probably start with v1.1 or 1.0, since the newest version uses ties rather agressively... so you would need some good tie defences and counter moves if you want it to beat the new ones.
I'm not sure if you want it to be an F2 bot, seems that way... but I think it would perform a lot better if it used tie feeding.
The trick is that your small bots are so small they can't drain the alge effectively... but you can make the alge feed you instead :

'Conspec, just so it's all there
def mykey 50

cond
*.robage 0 =
start
123 .mykey store
.mykey .tmemloc store
stop

'Eating alge
cond
*.tmemval *.mykey !=
*.numties 0 >
start
'The usual stuff :
*.trefxpos *.trefypos angle .setaim store
20 .up store
*.tiepres .tienum store
99 .sharenrg store

'The actual trick.
'Push a positive value into the alge's tieval
.tieval .tieloc store
1000 .tieval store
'Shoot -1 or -6 into the alge's tieloc
.tieloc .shoot store
-1 .shootval store
*.trefnrg 1000 <
-6 .shootval store
stop

'Feeding the base
cond
*.tmemval *.mykey =
*.trefbody 1000 >
*.numties 0 >
start
*.tiepres .tienum store
-1 .tieloc store
1000 .tieval store
stop

Or something like that anyway...
It still needs to avoid confusion among the drones though...
And the conspec can be tricked :

cond
*.robage 0 =
start
.tmemloc .tmemloc store
stop

cond
*.tmemloc .tmemloc !=
start
*.tmemval *.tmemloc store
.tmemloc .tmemloc store
stop

cond
*.numties 0 >
*.tmemloc .tmemloc =
*.tmemval 0 >
*.tmemval .tmemloc !=
start
*.tmemval .tmemloc store
stop


And ofcourse you can prevent this by saving you key in several places and checking a random one, so if a bot hasstolen a conspec it will still be visible to most bots... or you can add robage to your key every X cycles, and check to see if *.trefage *.key add is withing the right range (x)... this way a stolen key will expire after x cycles... or you can combine the 2...
The same works for .memloc/.memval ofcourse...


Thanks for the tie thing, I always had issues getting the veggies to feed right.  
As for tie defense...  The base should have enough nrg to keep up a 300 unit slime, which would pretty much prevent it from being decapitated.  The drones are more expendable.


As for the bot itself, I designed it in thin fluid and haven't really tested on anything else yet.  That would explain some of the odd behavior.  The rest of it is probably due to bugs in the vision/tracking.  A revamp on that whole part would probably clear some things up.

I like to use as few genes as possible, but it does make it harder to write multimode bots.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Battlestar bot 4-28-08
« Reply #3 on: April 29, 2008, 03:39:08 PM »
Quote from: Reiyuki
I like to use as few genes as possible, but it does make it harder to write multimode bots.

Not at all.  Seasnake is a single gene....

Alos, if people posted zipped example sims of their bots, it would eliminate the issues with duplicating enviornmental or starting conditions...
Many beers....

Offline Reiyuki

  • Bot Neophyte
  • *
  • Posts: 8
    • View Profile
Battlestar bot 4-28-08
« Reply #4 on: April 29, 2008, 07:34:50 PM »
Quote from: EricL
Quote from: Reiyuki
I like to use as few genes as possible, but it does make it harder to write multimode bots.

Not at all.  Seasnake is a single gene....

Alos, if people posted zipped example sims of their bots, it would eliminate the issues with duplicating enviornmental or starting conditions...

Fair enough
(attached sim with best example of behavior)

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Battlestar bot 4-28-08
« Reply #5 on: April 29, 2008, 08:18:52 PM »
Have a look at my antbot, I think the idea behind it is very similar.
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan