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 - bacillus

Pages: 1 2 3 [4] 5 6
46
F1 bots / Flitter(F1)(bacillus)-30.04.08
« on: April 29, 2008, 10:38:01 PM »
Code: [Select]
'Flitter
'A hyperactive bot by bacillus
'Moves quickly, then fixes itself to feed
start
 -4 *.eye1 *.eye9 sub sgn 0 floor mult *.eye1 *.eye8 sub sgn 0 floor mult *.eye1 *.eye7 sub sgn 0    floor mult *.eye1 *.eye6 sub sgn 0 floor mult *.eye1 *.eye5 sub sgn 0 floor mult *.eye1 *.eye4 sub   sgn 0 floor mult *.eye1 *.eye3 sub sgn 0 floor mult *.eye1 *.eye2 sub sgn 0 floor mult 4 *.eye9     *.eye8 sub sgn 0 floor mult *.eye9 *.eye7 sub sgn 0 floor mult *.eye9 *.eye6 sub sgn 0 floor mult
 *.eye9 *.eye5 sub sgn 0 floor mult *.eye9 *.eye4 sub sgn 0 floor mult *.eye9 *.eye3 sub sgn 0 floor  mult *.eye9 *.eye2 sub sgn 0 floor mult *.eye9 *.eye1 sub sgn ++ sgn mult add -3 *.eye2 *.eye9 sub   sgn ++ sgn mult *.eye2 *.eye8 sub sgn 0 floor mult *.eye2 *.eye7 sub sgn 0 floor mult *.eye2 *.eye6  sub sgn 0 floor mult *.eye2 *.eye5 sub sgn 0 floor mult *.eye2 *.eye4 sub sgn 0 floor mult *.eye2    *.eye3 sub sgn 0 floor mult *.eye2 *.eye1 sub sgn ++ sgn mult add 3 *.eye8 *.eye9 sub sgn ++ sgn     mult *.eye8 *.eye7 sub sgn 0 floor mult *.eye8 *.eye6 sub sgn 0 floor mult *.eye8 *.eye5 sub sgn 0   floor mult *.eye8 *.eye4 sub sgn 0 floor mult *.eye8 *.eye3 sub sgn 0 floor mult *.eye8 *.eye2 sub   sgn ++ sgn mult *.eye8 *.eye1 sub sgn ++ sgn mult add -2 *.eye3 *.eye9 sub sgn ++ sgn mult *.eye3    *.eye8 sub sgn ++ sgn mult *.eye3 *.eye7 sub sgn 0 floor mult *.eye3 *.eye6 sub sgn 0 floor mult
 *.eye3 *.eye5 sub sgn 0 floor mult *.eye3 *.eye4 sub sgn 0 floor mult *.eye3 *.eye2 sub sgn ++ sgn   mult *.eye3 *.eye1 sub sgn ++ sgn mult add 2 *.eye7 *.eye9 sub sgn ++ sgn mult *.eye7 *.eye8 sub     sgn ++ sgn mult *.eye7 *.eye7 sub sgn 0 floor mult *.eye7 *.eye6 sub sgn 0 floor mult *.eye7 *.eye5  sub sgn 0 floor mult *.eye7 *.eye4 sub sgn ++ sgn mult *.eye7 *.eye2 sub sgn ++ sgn mult *.eye7     *.eye1 sub sgn ++ sgn mult add -1 *.eye4 *.eye9 sub sgn ++ sgn mult *.eye4 *.eye8 sub sgn ++ sgn     mult *.eye4 *.eye7 sub sgn ++ sgn mult *.eye4 *.eye6 sub sgn 0 floor mult *.eye4 *.eye5 sub sgn 0    floor mult *.eye4 *.eye3 sub sgn ++ sgn mult *.eye4 *.eye2 sub sgn ++ sgn mult *.eye4 *.eye1 sub     sgn ++ sgn mult add 1 *.eye4 *.eye9 sub sgn ++ sgn mult *.eye4 *.eye8 sub sgn ++ sgn mult *.eye4    *.eye7 sub sgn ++ sgn mult *.eye4 *.eye6 sub sgn ++ sgn mult *.eye4 *.eye5 sub sgn 0 floor mult
 *.eye4 *.eye3 sub sgn ++ sgn mult *.eye4 *.eye2 sub sgn ++ sgn mult *.eye4 *.eye1 sub sgn ++ sgn     mult add 0 *.eye5 *.eye9 sub sgn ++ sgn mult *.eye5 *.eye8 sub sgn ++ sgn mult *.eye5 *.eye7 sub     sgn ++ sgn mult *.eye5 *.eye6 sub sgn ++ sgn mult *.eye5 *.eye4 sub sgn ++ sgn mult *.eye5 *.eye3   sub sgn ++ sgn mult *.eye5 *.eye2 sub sgn ++ sgn mult *.eye5 *.eye1 sub sgn ++ sgn mult add .focuseye store
 .dnalen .memloc store
 *.nrg 3 div *.body sub dup .strbody store - .fdbody store
 *.maxvel .up store
 *.dnalen *.memval sub sgn abs *.eye5 40 sub sgn 0 floor mult .fixpos store
 99 .sharenrg store
 -1 .tieloc store
 -1000 .tieval store
stop

cond
 *.eyef 0 =
start
 *.maxvel *.refvelsx add .dx store
stop

cond
 *.dnalen *.memval !=
 *.refnrg 0 >
 *.eyef 0 >
start
 *.refxpos *.refypos angle .setaim store
stop

cond
 *.eye5 1000 >
 *.dnalen *.memval !=
 *.reffixed 0 !=
start
 *.nrg 10 div .shootval store
stop

cond
 *.eye5 40 >
 *.dnalen *.memval !=
 *.reffixed 0 !=
start
 -6 .shoot store
 .tie inc
stop

cond
 *.eye5 40 >
 *.dnalen *.memval !=
 *.reffixed 0 =
start
 .shootval inc
 .fixpos .shoot store
stop

cond
 *.nrg 1000 >
start
 45 .repro store
stop

47
Interesting behaviour bots / Antbot v1.2
« on: April 29, 2008, 10:33:26 PM »
In this new release of Antbot, I added andrenaline to the drones, which leads to the production of poison. The queen produces a shell, and the workers communicate to find food sources. Still have no use for I/O channel 3, though. Note the first ever use of OCULUS II and the changed eye widths.

'Antbot
''A hivebot by Bacillus

'''''''''''''''''''''''''''''
'I/O CHANNELS
'''''''''''''''''''''''''''''
''I/O 1-species conspec
''I/O 2-type recognition
''I/O 3-reserved for communication
''I/O 4-hive conspec
''I/O 5-andrenaline level
''I/O 6-food timer-measures time elapsed since worker last saw food
''I/O 7-X coordinate of last food sighting
''I/O 8-Y coordinate of last food sighting

'''''''''''
'VARS
''''''''''''
''Young Queen-collects energy to form her own colony
''Queen-spawns smaller ants
''Drone-Poisons enemies, collects nrg from workers & other species,
''relays back to queen
''Worker-Finds food, brings it back to queen, and shares location
''of food with other workers
''Scout-Moves quickly to pull in veggies

def youngqueen 0
def queen 1
def drone 2
def worker 3
def scout 4

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'CUSTOM MEMORY LOCATIONS
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''Temp-initialization purposes
''Type-The Ant's job in the colony
''Queenxpos and Queenypos-Queen's coordinates
''Dumpdist-The distance from the queen at which a scout should dump a veggie
''Hiveid-The id of the hive this ant belongs to
''Andrenaline-The amount of andrenaline a drone has
''Memtimer-The time elapsed since worker last saw food
''Foodxpos and Foodypos-the coordinates of the last seen food

def temp 990
def type 991
def queenxpos 992
def queenypos 993
def dumpdist 994
def hiveid 995
def andrenaline 996
def memtimer 997
def foodxpos 998
def foodypos 999

'''''''''
'DNA
'''''''''

'Initialization
''What type of ant am I?
''Set eyes and conspec
cond
 *.robage 0 =
start
 1000 rnd .temp store
 .youngqueen *.temp sgn -- abs .type mult store
 .drone *.temp sgn .type mult store
 .scout *.temp 200 sub sgn 0 floor .type mult store
 .worker *.temp 300 sub sgn 0 floor .type mult store

 1235 .out1 store

 -436 .eye9dir store
 -327 .eye8dir store
 -218 .eye7dir store
 -109 .eye6dir store
  109 .eye4dir store
  218 .eye3dir store
  327 .eye2dir store
  436 .eye1dir store
 105 .eye1width store
 105 .eye2width store
 105 .eye3width store
 105 .eye4width store
 105 .eye5width store
 105 .eye6width store
 105 .eye7width store
 105 .eye8width store
 105 .eye9width store
stop

'First generation is always a queen
start
 *.thisgene .delgene store
 .youngqueen .type store
stop

'OCULUS
'Update bot
cond
start
 *.hiveid .out4 store
 *.andrenaline .out5 store
 *.type .out2 store
 *.memtimer .out6 store
 *.foodxpos .out7 store
 *.foodypos .out8 store
 *.nrg 3 div *.body sub dup .strbody store - .fdbody store
 -4 *.eye1 *.eye9 sub sgn 0 floor mult *.eye1 *.eye8 sub sgn 0 floor mult *.eye1 *.eye7 sub sgn 0    floor mult *.eye1 *.eye6 sub sgn 0 floor mult *.eye1 *.eye5 sub sgn 0 floor mult *.eye1 *.eye4 sub   sgn 0 floor mult *.eye1 *.eye3 sub sgn 0 floor mult *.eye1 *.eye2 sub sgn 0 floor mult 4 *.eye9     *.eye8 sub sgn 0 floor mult *.eye9 *.eye7 sub sgn 0 floor mult *.eye9 *.eye6 sub sgn 0 floor mult
 *.eye9 *.eye5 sub sgn 0 floor mult *.eye9 *.eye4 sub sgn 0 floor mult *.eye9 *.eye3 sub sgn 0 floor  mult *.eye9 *.eye2 sub sgn 0 floor mult *.eye9 *.eye1 sub sgn ++ sgn mult add -3 *.eye2 *.eye9 sub   sgn ++ sgn mult *.eye2 *.eye8 sub sgn 0 floor mult *.eye2 *.eye7 sub sgn 0 floor mult *.eye2 *.eye6  sub sgn 0 floor mult *.eye2 *.eye5 sub sgn 0 floor mult *.eye2 *.eye4 sub sgn 0 floor mult *.eye2    *.eye3 sub sgn 0 floor mult *.eye2 *.eye1 sub sgn ++ sgn mult add 3 *.eye8 *.eye9 sub sgn ++ sgn     mult *.eye8 *.eye7 sub sgn 0 floor mult *.eye8 *.eye6 sub sgn 0 floor mult *.eye8 *.eye5 sub sgn 0   floor mult *.eye8 *.eye4 sub sgn 0 floor mult *.eye8 *.eye3 sub sgn 0 floor mult *.eye8 *.eye2 sub   sgn ++ sgn mult *.eye8 *.eye1 sub sgn ++ sgn mult add -2 *.eye3 *.eye9 sub sgn ++ sgn mult *.eye3    *.eye8 sub sgn ++ sgn mult *.eye3 *.eye7 sub sgn 0 floor mult *.eye3 *.eye6 sub sgn 0 floor mult
 *.eye3 *.eye5 sub sgn 0 floor mult *.eye3 *.eye4 sub sgn 0 floor mult *.eye3 *.eye2 sub sgn ++ sgn   mult *.eye3 *.eye1 sub sgn ++ sgn mult add 2 *.eye7 *.eye9 sub sgn ++ sgn mult *.eye7 *.eye8 sub     sgn ++ sgn mult *.eye7 *.eye7 sub sgn 0 floor mult *.eye7 *.eye6 sub sgn 0 floor mult *.eye7 *.eye5  sub sgn 0 floor mult *.eye7 *.eye4 sub sgn ++ sgn mult *.eye7 *.eye2 sub sgn ++ sgn mult *.eye7     *.eye1 sub sgn ++ sgn mult add -1 *.eye4 *.eye9 sub sgn ++ sgn mult *.eye4 *.eye8 sub sgn ++ sgn     mult *.eye4 *.eye7 sub sgn ++ sgn mult *.eye4 *.eye6 sub sgn 0 floor mult *.eye4 *.eye5 sub sgn 0    floor mult *.eye4 *.eye3 sub sgn ++ sgn mult *.eye4 *.eye2 sub sgn ++ sgn mult *.eye4 *.eye1 sub     sgn ++ sgn mult add 1 *.eye4 *.eye9 sub sgn ++ sgn mult *.eye4 *.eye8 sub sgn ++ sgn mult *.eye4    *.eye7 sub sgn ++ sgn mult *.eye4 *.eye6 sub sgn ++ sgn mult *.eye4 *.eye5 sub sgn 0 floor mult
 *.eye4 *.eye3 sub sgn ++ sgn mult *.eye4 *.eye2 sub sgn ++ sgn mult *.eye4 *.eye1 sub sgn ++ sgn     mult add 0 *.eye5 *.eye9 sub sgn ++ sgn mult *.eye5 *.eye8 sub sgn ++ sgn mult *.eye5 *.eye7 sub     sgn ++ sgn mult *.eye5 *.eye6 sub sgn ++ sgn mult *.eye5 *.eye4 sub sgn ++ sgn mult *.eye5 *.eye3   sub sgn ++ sgn mult *.eye5 *.eye2 sub sgn ++ sgn mult *.eye5 *.eye1 sub sgn ++ sgn mult add .focuseye store

 12 *.type .scout sub sgn abs -- abs 3 mult ++ mult *.vel sub .up store
 *.type .queen sub sgn abs -- abs .fixpos store
 *.tiepres .tienum store
 500 rnd 500 add .dumpdist *.type .scout sub sgn abs -- abs mult store
 *.andrenaline *.venom sub .strvenom store
 .andrenaline *.andrenaline sgn mult dec
 .memtimer *.memtimer sgn mult dec
 -2 .venval store
 .shoot .vloc store
 .paralyzed .memloc store
stop

'Some idiot has tied to me!!
cond
 *.numties 0 !=
 *.type .scout !=
start
 *.tiepres .deltie store
stop

'I am a drone and should turn towards everything
cond
 *.eyef 0 !=
 *.type .drone =
start
 *.refxpos *.refypos angle .setaim store
stop

'I'm a worker/young queen, no point turning towards conspecs
cond
 *.eyef 0 !=
 *.type .worker =
 *.type .youngqueen = or
 *.out1 *.in1 !=
start
 *.refxpos *.refypos angle .setaim store
stop

'I am a young queen and are big and fat, so I mature
cond
 *.type .youngqueen =
 *.body 10000 >
start
 .fixpos inc
 .queen .type store
 *.xpos .queenxpos store
 *.ypos .queenypos store
 32000 rnd .hiveid store
stop

'I have no hive and you are a queen, I'll join yours
cond
 *.queenxpos 0 =
 *.queenypos 0 =
 *.type .queen !=
 *.type .youngqueen !=
 *.in2 .queen =
start
 *.refxpos .queenxpos store
 *.refypos .queenypos store
 *.in4 .hiveid store
stop

'Mature queens turn so there's enough reproduction space.
cond
 *.type .queen =
start
 20 .aimdx store
 50 *.shell sub .mkshell store
stop

'Drones and workers feed the queen
cond
 *.in1 *.out1 =
 *.in4 *.hiveid =
 *.type .drone =
 *.type .worker = or
 *.in2 .queen =
 *.nrg 500 >
 *.eye5 40 >
start
 *.nrg 500 sub 1000 ceil .shootval store
 -2 .shoot store
stop

'The queen is dead, I am a huge drone sitting in her place, I think I'll become the new queen.
cond
 *.type .drone =
 *.queenxpos *.queenypos dist 15 <
 *.in2 .queen !=
 *.nrg 30000 >=
start
 .fixpos inc
 .queen .type store
stop

'Drones harvest food from workers to bring to the queen so workers can keep harvesting
cond
 *.hiveid *.in4 =
 *.type .drone =
 *.in2 .worker =
 *.eye5 40 >
 *.refnrg 1000 >
start
 -1 .shoot store
stop

'I am a drone near a queen, but have no food, so I'll move away.
cond
 *.in1 *.out1 =
 *.in2 .queen =
 *.type .drone =
 *.nrg 500 <=
start
 *.maxvel *.velup add .dn store
stop

'I am a huge Drone/Worker, better go and give some of that food I harvested to the Queen.
cond
 *.type .drone =
 *.nrg 15000 > and
 *.type .worker =
 *.body 1000 > and or
start
 *.queenxpos *.queenypos angle .setaim store
stop

'Oooh, lots of food, let's share!
cond
 *.type .worker =
 *.in1 *.out1 !=
 *.refnrg 20000 >
start
 10 .memtimer store
 *.refxpos .foodxpos store
 *.refypos .foodypos store
stop

'You know where food is, I'll remember where.
cond
 *.type .worker =
 *.in1 *.out1 =
 *.in2 .worker =
 *.in6 *.memtimer >
start
 *.in6 .memtimer store
 *.in7 .foodxpos store
 *.in8 .foodypos store
stop

'Forget it.
cond
 *.type .worker =
 *.memtimer 0 =
 *.foodxpos 0 !=
 *.foodypos 0 !=
start
 628 .aimdx store
 *.maxvel *.veldn add .up store
 0 .foodxpos store
 0 .foodypos store
stop

'I see no food, but know where some is, so I'll go find it.
cond
 *.type .worker =
 *.memtimer 0 >
 *.in1 *.out1 =
 *.eyef 0 = or
start
 *.foodxpos *.foodypos angle .setaim store
stop

'I am a scout and my cargo is near the queen, I'll dump it and go find some more.
''It's fixed, so it won't run away.
cond
 *.type .scout =
 *.numties 1 =
 *.treffixed 0 !=
start
 *.tiepres .deltie store
 314 .aimdx store
 20 .up store
stop

'I am a scout without cargo and see food, let's get it!
cond
 *.type .scout =
 *.numties 0 =
 *.in1 *.out1 !=
 *.reffixed 0 =
 *.nrg 0 >
 *.eyef 0 >
start
 *.refxpos *.refypos angle .setaim store
stop

'I am a scout without cargo and am close to food, so I'll tie to it.
cond
 *.type .scout =
 *.in1 *.out1 !=
 *.nrg 0 >
 *.eye5 40 >
 *.reffixed 0 =
 *.refshoot 0 =
 *.numties 0 =
start
 .tie inc
stop

'I am a scout with cargo, better bring it back so the others can eat it.
''Might as well take some of the spoils myself so the load isn't as heavy.
cond
 *.type .scout =
 *.numties 1 =
start
 *.queenxpos *.queenypos angle .setaim store
 40 .sharenrg store
 1 .sharewaste store
stop

'I am a scout and my cargo is near the queen, I'll dump it and go find some more
''Let's fix it in place so it doesn't run away.
cond
 *.type .scout =
 *.numties 1 =
 *.queenxpos *.queenypos dist *.dumpdist <
start
 .fixpos .tieloc store
 .tieval inc
stop

'I'm not a scout and I see food, let's eat it!
cond
 *.eye5 40 >
 *.out1 *.in1 !=
 *.type .scout !=
start
 -6 .shoot store
stop

'I am a drone under attack, take countermeasures
''Part 1:If attacked, make andrenaline.
cond
 *.type .drone =
 *.shflav -1 =
 *.shflav -6 = or
start
 *.andrenaline 5 add .andrenaline store
 *.shang .setaim store
 0 .shflav store
stop

''Part 2:If venom is stored due to andrenaline, spit it at the enemy.
cond
 *.eye5 40 >
 *.out1 *.in1 !=
 *.type .drone =
 *.refshoot 0 >
 *.venom 0 >
 *.memval 0 !=
start
 *.venom .shootval store
 -3 .shoot store
stop

''Part 3:You're angry, so I'll be as angry as you.
cond
 *.in1 *.out1 =
 *.in2 .drone =
 *.type .drone =
 *.in5 *.andrenaline >
start
 *.in5 .andrenaline store
stop

'I should really evolve a toilet...
cond
 *.waste 200 >
start
 *.waste .shootval store
 -4 .shoot store
stop

'I am a Queen, so I should really make a colony
cond
 *.type .queen =
 *.nrg 5000 >
start
 5 .repro store
stop

48
The Gene depository / OCULUS II
« on: April 29, 2008, 08:00:29 PM »
This must be my most elaborate and unreadable code I ever produced. I checked over it twice (a very tedious job!!!) and found no errors, so should work. OCULUS I turned towards the thing it needed to turn least towards to face it; OCULUS II faces towards the closest thing in sight, using the priority system of OCULUS I in case of conflicts.

-4 *.eye1 *.eye9 sub sgn 0 floor mult *.eye1 *.eye8 sub sgn 0 floor mult *.eye1 *.eye7 sub sgn 0    floor mult *.eye1 *.eye6 sub sgn 0 floor mult *.eye1 *.eye5 sub sgn 0 floor mult *.eye1 *.eye4 sub   sgn 0 floor mult *.eye1 *.eye3 sub sgn 0 floor mult *.eye1 *.eye2 sub sgn 0 floor mult 4 *.eye9     *.eye8 sub sgn 0 floor mult *.eye9 *.eye7 sub sgn 0 floor mult *.eye9 *.eye6 sub sgn 0 floor mult
 *.eye9 *.eye5 sub sgn 0 floor mult *.eye9 *.eye4 sub sgn 0 floor mult *.eye9 *.eye3 sub sgn 0 floor  mult *.eye9 *.eye2 sub sgn 0 floor mult *.eye9 *.eye1 sub sgn ++ sgn mult add -3 *.eye2 *.eye9 sub   sgn ++ sgn mult *.eye2 *.eye8 sub sgn 0 floor mult *.eye2 *.eye7 sub sgn 0 floor mult *.eye2 *.eye6  sub sgn 0 floor mult *.eye2 *.eye5 sub sgn 0 floor mult *.eye2 *.eye4 sub sgn 0 floor mult *.eye2    *.eye3 sub sgn 0 floor mult *.eye2 *.eye1 sub sgn ++ sgn mult add 3 *.eye8 *.eye9 sub sgn ++ sgn     mult *.eye8 *.eye7 sub sgn 0 floor mult *.eye8 *.eye6 sub sgn 0 floor mult *.eye8 *.eye5 sub sgn 0   floor mult *.eye8 *.eye4 sub sgn 0 floor mult *.eye8 *.eye3 sub sgn 0 floor mult *.eye8 *.eye2 sub   sgn ++ sgn mult *.eye8 *.eye1 sub sgn ++ sgn mult add -2 *.eye3 *.eye9 sub sgn ++ sgn mult *.eye3    *.eye8 sub sgn ++ sgn mult *.eye3 *.eye7 sub sgn 0 floor mult *.eye3 *.eye6 sub sgn 0 floor mult
 *.eye3 *.eye5 sub sgn 0 floor mult *.eye3 *.eye4 sub sgn 0 floor mult *.eye3 *.eye2 sub sgn ++ sgn   mult *.eye3 *.eye1 sub sgn ++ sgn mult add 2 *.eye7 *.eye9 sub sgn ++ sgn mult *.eye7 *.eye8 sub     sgn ++ sgn mult *.eye7 *.eye7 sub sgn 0 floor mult *.eye7 *.eye6 sub sgn 0 floor mult *.eye7 *.eye5  sub sgn 0 floor mult *.eye7 *.eye4 sub sgn ++ sgn mult *.eye7 *.eye2 sub sgn ++ sgn mult *.eye7     *.eye1 sub sgn ++ sgn mult add -1 *.eye4 *.eye9 sub sgn ++ sgn mult *.eye4 *.eye8 sub sgn ++ sgn     mult *.eye4 *.eye7 sub sgn ++ sgn mult *.eye4 *.eye6 sub sgn 0 floor mult *.eye4 *.eye5 sub sgn 0    floor mult *.eye4 *.eye3 sub sgn ++ sgn mult *.eye4 *.eye2 sub sgn ++ sgn mult *.eye4 *.eye1 sub     sgn ++ sgn mult add 1 *.eye4 *.eye9 sub sgn ++ sgn mult *.eye4 *.eye8 sub sgn ++ sgn mult *.eye4    *.eye7 sub sgn ++ sgn mult *.eye4 *.eye6 sub sgn ++ sgn mult *.eye4 *.eye5 sub sgn 0 floor mult
 *.eye4 *.eye3 sub sgn ++ sgn mult *.eye4 *.eye2 sub sgn ++ sgn mult *.eye4 *.eye1 sub sgn ++ sgn     mult add 0 *.eye5 *.eye9 sub sgn ++ sgn mult *.eye5 *.eye8 sub sgn ++ sgn mult *.eye5 *.eye7 sub     sgn ++ sgn mult *.eye5 *.eye6 sub sgn ++ sgn mult *.eye5 *.eye4 sub sgn ++ sgn mult *.eye5 *.eye3   sub sgn ++ sgn mult *.eye5 *.eye2 sub sgn ++ sgn mult *.eye5 *.eye1 sub sgn ++ sgn mult add .focuseye store

49
Interesting behaviour bots / Antbot v1.1
« on: April 28, 2008, 08:26:08 PM »
This is my latest version of Antbot. It is more heavily documented, has faster and more efficient scouts, and interacts only with members of the same hive. I'm still itching to use that communication channel for something. Could someone please run this to give me some feedback on what that might be? Ideal conditions are one or two initial bots with only alga minimalis as other species, map size 8 with 1000 max veggies, 500 repop threshold and 200 per repop event, moderate friction and max collision elasticity.

Code: [Select]
'Antbot v1.1
'A simple group behaviour bot by Bacillus
'I/O channel 1: Species conspec
'I/O channel 2: Ant type
'I/O channel 3: Reserved for future use of communication
'I/O channel 4: Hive conspec

'vars
def youngqueen 0
def queen 1
def drone 2
def worker 3
def scout 4

'custom memory locations
def temp 990
def type 991
def queenxpos 992
def queenypos 993
def dumpdist 994
def hiveid 995

'Initialization
''What type of ant am I?
''Set eyes and conspec
cond
 *.robage 0 =
start
 1000 rnd .temp store
 .youngqueen *.temp sgn -- abs .type mult store
 .drone *.temp sgn .type mult store
 .scout *.temp 200 sub sgn 0 floor .type mult store
 .worker *.temp 300 sub sgn 0 floor .type mult store

 1235 .out1 store

 -436 .eye9dir store
 -327 .eye8dir store
 -218 .eye7dir store
 -109 .eye6dir store
  109 .eye4dir store
  218 .eye3dir store
  327 .eye2dir store
  436 .eye1dir store
 109 .eye1width store
 109 .eye2width store
 109 .eye3width store
 109 .eye4width store
 109 .eye5width store
 109 .eye6width store
 109 .eye7width store
 109 .eye8width store
 109 .eye9width store
stop

'First generation is always a queen
start
 *.thisgene .delgene store
 .youngqueen .type store
stop

'OCULUS
'Update bot
cond
start
 *.hiveid .out4 store
 *.type .out2 store
 *.nrg 3 div *.body sub dup .strbody store - .fdbody store
 -4 *.eye1 sgn mult *.eye2 sgn -- abs mult *.eye3 sgn -- abs mult  *.eye4 sgn -- abs mult *.eye5 sgn

 -- abs mult *.eye6 sgn -- abs mult  *.eye7 sgn -- abs mult *.eye8 sgn -- abs mult *.eye9 sgn -- abs

 mult  4 *.eye9 sgn mult *.eye2 sgn -- abs mult *.eye3 sgn -- abs mult   *.eye4 sgn -- abs mult

*.eye5  sgn -- abs mult *.eye6 sgn -- abs mult  *.eye7 sgn -- abs mult *.eye8 sgn -- abs mult add -3

*.eye2  sgn mult  *.eye3 sgn -- abs mult *.eye4 sgn -- abs mult *.eye5 sgn -- abs mult   *.eye6 sgn

-- abs   mult *.eye7 sgn -- abs mult *.eye8 sgn -- abs   mult add 3 *.eye8 sgn mult *.eye3 sgn --

abs mult   *.eye4  sgn --   abs mult *.eye5 sgn -- abs mult *.eye6 sgn -- abs mult *.eye7 sgn --   

abs mult add -2  *.eye3 sgn mult *.eye4 sgn -- abs mult *.eye5 sgn --  abs mult *.eye6 sgn -- abs

mult *.eye7 sgn --  abs mult add 2 *.eye7   sgn mult *.eye4 sgn -- abs mult *.eye5 sgn -- abs mult

*.eye6 sgn --   abs mult add -1  *.eye4 sgn mult *.eye5 sgn -- abs mult *.eye6 sgn --  abs mult add

1 *.eye6 sgn mult *.eye5   sgn --  abs mult add 0 *.eye5  sgn mult add .focuseye store

12 *.type .scout sub sgn abs -- abs 3 mult ++ mult *.vel sub .up store
*.type .queen sub sgn abs -- abs .fixpos store
*.tiepres .tienum store
500 rnd 500 add .dumpdist *.type .scout sub sgn abs -- abs mult store
stop

'I am a drone and should turn towards everything
cond
 *.eyef 0 !=
 *.type .drone =
start
 *.refxpos *.refypos angle .setaim store
stop

'I'm a worker/young queen, no point turning towards conspecs
cond
 *.eyef 0 !=
 *.type .worker =
 *.type .youngqueen = or
 *.out1 *.in1 !=
start
 *.refxpos *.refypos angle .setaim store
stop

'I am a young queen and are big and fat, so I mature
cond
 *.type .youngqueen =
 *.body 10000 >
start
 .fixpos inc
 .queen .type store
 *.xpos .queenxpos store
 *.ypos .queenypos store
 32000 rnd .hiveid store
stop

'I have no hive and you are a queen, I'll join yours
cond
 *.queenxpos 0 =
 *.queenypos 0 =
 *.type .queen !=
 *.type .youngqueen !=
 *.in2 .queen =
start
 *.refxpos .queenxpos store
 *.refypos .queenypos store
 *.in4 .hiveid store
stop

'Mature queens turn so there's enough reproduction space.
cond
 *.type .queen =
start
 20 .aimdx store
stop

'Drones and workers feed the queen
cond
 *.in1 *.out1 =
 *.in4 *.hiveid =
 *.type .drone =
 *.type .worker = or
 *.in2 .queen =
 *.nrg 500 >
start
 *.nrg 500 sub 1000 ceil .shootval store
 -2 .shoot store
stop

'The queen is dead, I am a huge drone sitting in her place, I think I'll become the new queen.
cond
 *.type .drone =
 *.queenxpos *.queenypos dist 15 <
 *.in2 .queen !=
 *.nrg 30000 >=
start
 .fixpos inc
 .queen .type store
stop

'Drones harvest food from workers to bring to the queen so workers can keep harvesting
cond
 *.hiveid *.in4 =
 *.type .drone =
 *.in2 .worker =
 *.eye5 40 >
 *.refnrg 1000 >
start
 -1 .shoot store
stop

'I am a drone near a queen, but have no food, so I'll move away.
cond
 *.in1 *.out1 =
 *.in2 .queen =
 *.type .drone =
 *.nrg 500 <=
start
 *.maxvel *.velup add .dn store
stop

'I am a huge Drone/Worker, better go and give some of that food I harvested to the Queen.
cond
 *.type .drone =
 *.nrg 15000 > and
 *.type .worker =
 *.body 1000 > and or
start
 *.queenxpos *.queenypos angle .setaim store
stop

'I am a scout and my cargo is near the queen, I'll dump it and go find some more.
''It's fixed, so it won't run away.
cond
 *.type .scout =
 *.numties 1 =
 *.treffixed 0 !=
start
 *.tiepres .deltie store
 314 .aimdx store
 20 .up store
stop

'I am a scout without cargo and see food, let's get it!
cond
 *.type .scout =
 *.numties 0 =
 *.in1 *.out1 !=
 *.reffixed 0 =
 *.nrg 0 >
 *.eyef 0 >
start
 *.refxpos *.refypos angle .setaim store
stop

'I am a scout without cargo and am close to food, so I'll tie to it.
cond
 *.type .scout =
 *.in1 *.out1 !=
 *.nrg 0 >
 *.eye5 40 >
 *.reffixed 0 =
 *.numties 0 =
start
 .tie inc
stop

'I am a scout with cargo, better bring it back so the others can eat it.
''Might as well take some of the spoils myself so the load isn't as heavy.
cond
 *.type .scout =
 *.numties 1 =
start
 *.queenxpos *.queenypos angle .setaim store
 40 .sharenrg store
 1 .sharewaste store
stop

'I am a scout and my cargo is near the queen, I'll dump it and go find some more
''Let's fix it in place so it doesn't run away.
cond
 *.type .scout =
 *.numties 1 =
 *.queenxpos *.queenypos dist *.dumpdist <
start
 .fixpos .tieloc store
 .tieval inc
stop

'I'm not a scout and I see food, let's eat it!
cond
 *.eye5 40 >
 *.out1 *.in1 !=
 *.type .scout !=
start
 -6 .shoot store
stop

'I should really evolve a toilet...
cond
 *.waste 200 >
start
 *.waste .shootval store
 -4 .shoot store
stop

'I am a Queen, so I should really make a colony
cond
 *.type .queen =
 *.nrg 5000 >
start
 5 .repro store
stop

50
Interesting behaviour bots / Antbot v1.0
« on: April 28, 2008, 07:30:50 PM »
Code: [Select]
'vars
def youngqueen 0
def queen 1
def drone 2
def worker 3
def scout 4

'custom memory locations
def temp 990
def type 991
def queenxpos 992
def queenypos 993

'Initialization
''What type of ant am I?
''Set eyes and conspec
cond
 *.robage 0 =
start
 1000 rnd .temp store
 .youngqueen *.temp sgn -- abs .type mult store
 .drone *.temp sgn .type mult store
 .scout *.temp 200 sub sgn 0 floor .type mult store
 .worker *.temp 300 sub sgn 0 floor .type mult store

 1235 .out1 store

 -436 .eye9dir store
 -327 .eye8dir store
 -218 .eye7dir store
 -109 .eye6dir store
  109 .eye4dir store
  218 .eye3dir store
  327 .eye2dir store
  436 .eye1dir store
 109 .eye1width store
 109 .eye2width store
 109 .eye3width store
 109 .eye4width store
 109 .eye5width store
 109 .eye6width store
 109 .eye7width store
 109 .eye8width store
 109 .eye9width store
stop

'First generation is always a queen
start
 *.thisgene .delgene store
 .youngqueen .type store
stop

'OCULUS
'Update bot
cond
start
 *.type .out2 store
 *.nrg 3 div *.body sub dup .strbody store - .fdbody store
 -4 *.eye1 sgn mult *.eye2 sgn -- abs mult *.eye3 sgn -- abs mult  *.eye4 sgn -- abs mult *.eye5 sgn

 -- abs mult *.eye6 sgn -- abs mult  *.eye7 sgn -- abs mult *.eye8 sgn -- abs mult *.eye9 sgn -- abs

 mult  4 *.eye9 sgn mult *.eye2 sgn -- abs mult *.eye3 sgn -- abs mult   *.eye4 sgn -- abs mult

*.eye5  sgn -- abs mult *.eye6 sgn -- abs mult  *.eye7 sgn -- abs mult *.eye8 sgn -- abs mult add -3

*.eye2  sgn mult  *.eye3 sgn -- abs mult *.eye4 sgn -- abs mult *.eye5 sgn -- abs mult   *.eye6 sgn

-- abs   mult *.eye7 sgn -- abs mult *.eye8 sgn -- abs   mult add 3 *.eye8 sgn mult *.eye3 sgn --

abs mult   *.eye4  sgn --   abs mult *.eye5 sgn -- abs mult *.eye6 sgn -- abs mult *.eye7 sgn --   

abs mult add -2  *.eye3 sgn mult *.eye4 sgn -- abs mult *.eye5 sgn --  abs mult *.eye6 sgn -- abs

mult *.eye7 sgn --  abs mult add 2 *.eye7   sgn mult *.eye4 sgn -- abs mult *.eye5 sgn -- abs mult

*.eye6 sgn --   abs mult add -1  *.eye4 sgn mult *.eye5 sgn -- abs mult *.eye6 sgn --  abs mult add

1 *.eye6 sgn mult *.eye5   sgn --  abs mult add 0 *.eye5  sgn mult add .focuseye store

12 *.vel sub .up store
*.type .queen sub sgn abs -- abs .fixpos store
*.tiepres .tienum store
stop

'I am a drone and should turn towards everything
cond
 *.eyef 0 !=
 *.type .drone =
start
 *.refxpos *.refypos angle .setaim store
stop

'I'm a worker/young queen, no point turning towards conspecs
cond
 *.eyef 0 !=
 *.type .worker =
 *.type .youngqueen = or
 *.out1 *.in1 !=
start
 *.refxpos *.refypos angle .setaim store
stop

'I am a young queen and are big and fat, so I mature
cond
 *.type .youngqueen =
 *.body 10000 >
start
 .fixpos inc
 .queen .type store
 *.xpos .queenxpos store
 *.ypos .queenypos store
stop

'I have no hive and you are a queen, I'll join yours
cond
 *.queenxpos 0 =
 *.queenypos 0 =
 *.type .queen !=
 *.type .youngqueen !=
 *.in2 .queen =
start
 *.refxpos .queenxpos store
 *.refypos .queenypos store
stop

'Mature queens turn so there's enough reproduction space.
cond
 *.type .queen =
start
 20 .aimdx store
stop

'Drones and workers feed the queen
cond
 *.type .drone =
 *.type .worker = or
 *.in2 .queen =
 *.nrg 500 >
start
 *.nrg 500 sub 1000 ceil .shootval store
 -2 .shoot store
stop

'The queen is dead, I am a huge drone sitting in her place, I think I'll become the new queen.
cond
 *.type .drone =
 *.queenxpos *.queenypos dist 15 <
 *.in2 .queen !=
 *.nrg 30000 >=
start
 .fixpos inc
 .queen .type store
stop

'Drones harvest food from workers to bring to the queen so workers can keep harvesting
cond
 *.type .drone =
 *.in2 .worker =
 *.eye5 40 >
 *.refnrg 1000 >
start
 -1 .shoot store
stop

'I am a drone near the queen, but have no food, so I'll move away.
cond
 *.in2 .queen =
 *.type .drone =
 *.nrg 500 <=
start
 *.maxvel *.velup add .dn store
stop

'I am a huge Drone/Worker, better go and give some of that food I harvested to the Queen.
cond
 *.type .drone =
 *.nrg 15000 > and
 *.type .worker =
 *.body 1000 > and or
start
 *.queenxpos *.queenypos angle .setaim store
stop

'I am a scout and my cargo is near the queen, I'll dump it and go find some more.
''It's fixed, so it won't run away.
cond
 *.type .scout =
 *.numties 1 =
 *.treffixed 0 !=
start
 *.tiepres .deltie store
stop

'I am a scout without cargo and see food, let's get it!
cond
 *.type .scout =
 *.numties 0 =
 *.in1 *.out1 !=
 *.reffixed 0 =
 *.nrg 0 >
 *.eyef 0 >
start
 *.refxpos *.refypos angle .setaim store
stop

'I am a scout without cargo and am close to food, so I'll tie to it.
cond
 *.type .scout =
 *.in1 *.out1 !=
 *.nrg 0 >
 *.eye5 40 >
 *.reffixed 0 =
 *.numties 0 =
start
 .tie inc
stop

'I am a scout with cargo, better bring it back so the others can eat it.
cond
 *.type .scout =
 *.numties 1 =
start
 *.queenxpos *.queenypos angle .setaim store
stop

'I am a scout and my cargo is near the queen, I'll dump it and go find some more
''Let's fix it in place so it doesn't run away.
cond
 *.type .scout =
 *.numties 1 =
 *.queenxpos *.queenypos dist 100 1000 rnd <
start
 .fixpos .tieloc store
 .tieval inc
stop

'I'm not a scout and I see food, let's eat it!
cond
 *.eye5 40 >
 *.out1 *.in1 !=
 *.type .scout !=
start
 -6 .shoot store
stop

'I should really evolve a toilet...
cond
 *.waste 200 >
start
 *.waste .shootval store
 -4 .shoot store
stop

'I am a Queen, so I should really make a colony
cond
 *.type .queen =
 *.nrg 5000 >
start
 5 .repro store
stop

51
Interesting behaviour bots / Antbot v0.1
« on: April 28, 2008, 05:54:18 PM »
This bot is nowhere near complete; I just thought I'd post it so I could get feedback on improvements. Note that this is not a competitive bot, but part of what I hope to be a very elaborate environment. Changes I'm hoping to make are:
  • Hive conspecifics-Drones only take nrg from their own hive
  • A use for the out3 communication channel-I cut it out because I didn't use it
  • Scouts-tie to veggies and bring them back to the colony
This bot looks really cool in Smiley Mode. Thanks EricL!

Code: [Select]
'vars
def youngqueen 0
def queen 1
def drone 2
def worker 3

'custom memory locations
def temp 990
def type 991
def queenxpos 992
def queenypos 993

cond
 *.robage 0 =
start
 1000 rnd .temp store
 .youngqueen *.temp sgn -- abs .type mult store
 .drone *.temp sgn .type mult store
 .worker *.temp 200 sub sgn 0 floor .type mult store

 1235 .out1 store

 -436 .eye9dir store
 -327 .eye8dir store
 -218 .eye7dir store
 -109 .eye6dir store
  109 .eye4dir store
  218 .eye3dir store
  327 .eye2dir store
  436 .eye1dir store
 109 .eye1width store
 109 .eye2width store
 109 .eye3width store
 109 .eye4width store
 109 .eye5width store
 109 .eye6width store
 109 .eye7width store
 109 .eye8width store
 109 .eye9width store
stop

start
 *.thisgene .delgene store
 .youngqueen .type store
stop

cond
start
 *.type .out2 store
 *.nrg 3 div *.body sub dup .strbody store - .fdbody store
 -4 *.eye1 sgn mult *.eye2 sgn -- abs mult *.eye3 sgn -- abs mult 

*.eye4 sgn -- abs mult *.eye5 sgn  -- abs mult *.eye6 sgn -- abs mult 

*.eye7 sgn -- abs mult *.eye8 sgn -- abs mult *.eye9 sgn -- abs  mult 

4 *.eye9 sgn mult *.eye2 sgn -- abs mult *.eye3 sgn -- abs mult   

*.eye4 sgn -- abs mult *.eye5  sgn -- abs mult *.eye6 sgn -- abs mult 

*.eye7 sgn -- abs mult *.eye8 sgn -- abs mult add -3 *.eye2  sgn mult 

*.eye3 sgn -- abs mult *.eye4 sgn -- abs mult *.eye5 sgn -- abs mult   

*.eye6 sgn -- abs   mult *.eye7 sgn -- abs mult *.eye8 sgn -- abs   

mult add 3 *.eye8 sgn mult *.eye3 sgn -- abs mult   *.eye4  sgn --   

abs mult *.eye5 sgn -- abs mult *.eye6 sgn -- abs mult *.eye7 sgn --   

abs mult add -2  *.eye3 sgn mult *.eye4 sgn -- abs mult *.eye5 sgn -- 

abs mult *.eye6 sgn -- abs mult *.eye7 sgn --  abs mult add 2 *.eye7   

sgn mult *.eye4 sgn -- abs mult *.eye5 sgn -- abs mult *.eye6 sgn --   

abs mult add -1  *.eye4 sgn mult *.eye5 sgn -- abs mult *.eye6 sgn -- 

abs mult add 1 *.eye6 sgn mult *.eye5   sgn --  abs mult add 0 *.eye5 

sgn mult add .focuseye store

12 *.vel sub .up store
*.type .queen sub sgn abs -- abs .fixpos store
stop

cond
 *.eyef 0 !=
 *.type .worker !=
 *.type .queen !=
 *.type .youngqueen !=
start
 *.refxpos *.refypos angle .setaim store
stop

cond
 *.eyef 0 !=
 *.type .worker =
 *.type .youngqueen = or
 *.out1 *.in1 !=
start
 *.refxpos *.refypos angle .setaim store
stop

cond
 *.type .youngqueen =
 *.body 10000 >
start
 .fixpos inc
 .queen .type store
 *.xpos .queenxpos store
 *.ypos .queenypos store
stop
 
cond
 *.queenxpos 0 =
 *.queenypos 0 =
 *.type .queen !=
 *.type .youngqueen !=
 *.in2 .queen =
start
 *.refxpos .queenxpos store
 *.refypos .queenypos store
stop

cond
 *.type .queen =
 *.eye5 30 >
start
 20 .aimdx store
stop

'TODO worker and drone code

cond
 *.type .drone =
 *.in2 .queen =
 *.nrg 500 >
start
 *.nrg 500 sub 1000 ceil .shootval store
 -2 .shoot store
stop

cond
 *.type .drone =
 *.in2 .worker =
 *.eye5 40 >
 *.refnrg 1000 >
start
 -1 .shoot store
stop

cond
 *.in2 .queen =
 *.type .drone =
 *.nrg 500 <=
start
 *.maxvel *.velup add .dn store
stop

cond
 *.type .drone =
 *.nrg 15000 >
start
 *.queenxpos *.queenypos angle .setaim store
stop

cond
 *.eye5 40 >
 *.out1 *.in1 !=
start
 -6 .shoot store
stop

cond
 *.type .queen =
 *.nrg 5000 >
start
 5 .repro store
stop

52
Suggestions / Communal Bot League
« on: April 27, 2008, 06:21:25 PM »
Why not have a league for communal bots?
The only specifications would be that a bot has to show obvious pack hunting/colony behavior eg. communicate with others of its own species to aid conspecs. This would be a good place for bots like Spiral that are somewhere inbetween multibot and single bot.

53
Interesting behaviour bots / Amoeba
« on: April 26, 2008, 11:18:27 PM »
Code: [Select]
cond
 *.robage 0 =
start
 2468 .out1 store
 2468 .tout1 store
stop

cond
start
 .tie inc
 *.nrg 3 div *.body sub dup .strbody store - .fdbody store
 .tout4 *.tout4 sgn mult dec
 2 .up store
stop

cond
 *.tin1 *.tout1 !=
 *.trefnrg 0 >
start
 -1 .tieloc store
 -1000 .tieval store
stop

cond
 *.eye5 0 !=
 *.out1 *.in1 !=
start
 *.refxpos .tout2 store
 *.refypos .tout3 store
 10 .out4 store
stop

cond
 *.tout4 0 =
start
 0 .tout2 store
 0 .tout3 store
stop

cond
 *.tin1 *.tout1 =
 *.tin2 0 !=
 *.tin3 0 !=
start
 *.tin4 .tout4 store
 *.tin2 .tout2 store
 *.tin3 .tout3 store
stop

cond
 *.tout2 0 !=
 *.tout3 0 !=
start
 *.tout2 *.tout3 angle .setaim store
stop

cond
 *.refnrg 0 >
 *.eye5 40 >
 *.in1 *.out1 !=
start
 -6 .shoot store
stop

cond
 *.nrg 350 >
start
 50 .repro store
stop

54
Interesting behaviour bots / Collosus
« on: April 26, 2008, 11:17:20 PM »
start
 *.body 10 div *.shell sub  .mkshell store
 *.body 10 div *.slime sub .mkslime store
 *.body 10 div *.poison sub .strpoison store
 .shoot .ploc store
 10000 .out4 store
 *.body 250 div 2 floor .up store
 *.nrg *.body sub dup .strbody store - .fdbody store
 *.nrg 10 div *.eye5 31999 sub sgn 0 floor .shootval mult *.in4 *.out4 sub sgn abs mult store
 -6 *.eye5 40 sub sgn 0 floor .shoot mult *.in4 *.out4 sub sgn abs mult store
 -4 *.eye1 sgn mult *.eye2 sgn -- abs mult *.eye3 sgn -- abs mult  *.eye4 sgn -- abs mult *.eye5 sgn  -- abs mult *.eye6 sgn -- abs mult  *.eye7 sgn -- abs mult *.eye8 sgn -- abs mult *.eye9 sgn -- abs  mult  4 *.eye9 sgn mult *.eye2 sgn -- abs mult *.eye3 sgn -- abs mult   *.eye4 sgn -- abs mult  *.eye5  sgn -- abs mult *.eye6 sgn -- abs mult  *.eye7 sgn -- abs mult *.eye8 sgn -- abs mult add   -3 *.eye2  sgn mult  *.eye3 sgn -- abs mult *.eye4 sgn -- abs mult *.eye5 sgn -- abs mult   *.eye6   sgn -- abs mult *.eye7 sgn -- abs mult *.eye8 sgn -- abs mult add 3 *.eye8 sgn mult *.eye3 sgn --  abs mult   *.eye4  sgn -- abs mult *.eye5 sgn -- abs mult *.eye6 sgn -- abs mult *.eye7 sgn --    abs mult add -2  *.eye3 sgn mult *.eye4 sgn -- abs mult *.eye5 sgn --  abs mult *.eye6 sgn -- abs  mult *.eye7 sgn -- abs mult add 2 *.eye7   sgn mult *.eye4 sgn -- abs mult *.eye5 sgn -- abs mult  *.eye6 sgn -- abs mult add -1  *.eye4 sgn mult *.eye5 sgn -- abs mult *.eye6 sgn --  abs mult add 1  *.eye6 sgn mult *.eye5 sgn --  abs mult add 0 *.eye5  sgn mult add .focuseye store
 *.refxpos *.refypos angle .setaim *.eyef sgn mult *.out4 *.in4 sub sgn abs mult store
 *.waste *.waste 250 sub sgn 0 floor .shootval mult store
 -4 *.waste 250 sub sgn 0 floor .shoot mult store
 100 .dx *.eyef 20 sub sgn 0 floor mult *.out4 *.in4 sub sgn abs -- abs mult store
 400 .aimdx  *.eye5 sgn -- abs mult *.eye1 sgn -- abs mult *.eye2 sgn -- abs mult *.eye3 sgn -- abs   mult *.eye4 sgn -- abs mult *.eye6 sgn -- abs mult *.eye7 sgn -- abs mult *.eye8 sgn -- abs mult   *.eye9 sgn -- abs mult store
 3 *.body 31900 sub sgn 0 floor .repro mult store
stop

55
Interesting behaviour bots / Arsenal Arbitraris
« on: April 26, 2008, 11:16:08 PM »
'Arsenal Arbitraris
'V1.0
'Shoots a variety of viruses in a sythesized natural selection process.

'Core gene
''Set virus protection&conspec
''Make virus and delete potentially dangerous genes
''Move, shoot and tie-feed
''Reproduce
''Body Control
cond
start
 77 .out2 store
 77 .tout2 store
 *.thisgene ++ *.genes -- *.thisgene sub rnd *.thisgene ++ add

.mkvirus store
 *.thisgene -- .delgene store
 2 .up store
 *.nrg 7 div .vshoot store
 30 *.eye3 *.eye5 sub sgn 0 floor .aimsx store
 30 *.eye3 *.eye5 sub sgn 0 floor .aimdx store
 .tie inc
 *.tin2 *.tout2 sub sgn abs -- abs *.tiepres mult .deltie store
 99 .sharenrg store
 -1 .tieloc store
 -1000 .tieval store
 -6 .shoot *.out2 *.in2 sub sgn abs *.eye5 40 sub sgn 0 floor mult

mult store
 50 *.thisgene -- sgn abs -- abs *.nrg 2500 sub sgn 0 floor mult

.repro mult store
 *.nrg 3 div *.body sub dup .strbody store - .fdbody store
stop

'Virus 1 - kill shot
cond
 *.out2 77 !=
start
 *.thisgene .mkvirus store
 -32000 .vshoot store
stop

'Virus 2 - clears genes
cond
 *.out2 77 !=
start
 *.thisgene 1 rnd 2 mult -- add .delgene store
 *.thisgene .mkvirus store
 *.nrg 2 div .vshoot store
stop

'Virus 3 - ties to others
cond
 *.out2 77 !=
start
 *.thisgene .mkvirus store
 50 .vshoot store
 .tie inc
 -1 .tieloc store
 -1000 *.tin2 77 sub sgn abs 2 mult -- mult .tieval store
stop

'Virus 4 - Mass reproduction
cond
 *.out2 77 !=
start
 *.thisgene .mkvirus store
 20 *.nrg sub sgn 0 floor mult .repro store
 100 .vshoot store
stop

Virus 5 - Spreads virus to other areas
cond
 *.out2 77 !=
start
 20 .dx store
 20 .up store
 *.thisgene .mkvirus store
 50 .vshoot store
stop

56
The Gene depository / OCULUS
« on: April 26, 2008, 03:04:47 AM »
The OCULUS code snippet has quickly become a standard amongst my bots, mainly because of their amazing efficiency of using all eyes, and virtually no drawback apart from its size:

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']-4 *.eye1 sgn mult *.eye2 sgn -- abs mult *.eye3 sgn -- abs mult  *.eye4 sgn -- abs mult *.eye5 sgn  -- abs mult
*.eye6 sgn -- abs mult  *.eye7 sgn -- abs mult *.eye8 sgn -- abs mult *.eye9 sgn -- abs  mult  4 *.eye9 sgn mult *.eye2 sgn
 -- abs mult *.eye3 sgn -- abs mult   *.eye4 sgn -- abs mult *.eye5  sgn -- abs mult *.eye6 sgn -- abs mult  *.eye7 sgn --
abs mult *.eye8 sgn -- abs mult add -3 *.eye2  sgn mult  *.eye3 sgn -- abs mult *.eye4 sgn -- abs mult *.eye5 sgn -- abs
mult   *.eye6 sgn -- abs   mult *.eye7 sgn -- abs mult *.eye8 sgn -- abs   mult add 3 *.eye8 sgn mult *.eye3 sgn -- abs mult
  *.eye4  sgn --   abs mult *.eye5 sgn -- abs mult *.eye6 sgn -- abs mult *.eye7 sgn --   abs mult add -2  *.eye3 sgn mult
*.eye4 sgn -- abs mult *.eye5 sgn --  abs mult *.eye6 sgn -- abs mult *.eye7 sgn --  abs mult add 2 *.eye7   sgn mult
*.eye4 sgn -- abs mult *.eye5 sgn -- abs mult *.eye6 sgn --   abs mult add -1  *.eye4 sgn mult *.eye5 sgn -- abs mult
*.eye6 sgn --  abs mult add 1 *.eye6 sgn mult *.eye5   sgn --  abs mult add 0 *.eye5  sgn mult add .focuseye
store

this sets the focus eye; then you can decide whether it's worth turning towards because you can read a bot's vars even behind you. OCULUS is most efficient when broadening a bot's eyesight. To turn towards non-conspecs, add this code:


cond
'conspec code here
*.eyef 0 !=
start
 *.refxpos *.refypos angle .setaim store
stop


This is only a beta version that settles conflicts depending on whatever takes the least to turn towards; I'm trying to code a version that turns towards the closest thing relative to the bot.

57
Bot Tavern / Multibot Question
« on: April 26, 2008, 01:23:26 AM »
Does a bot that doesn't use ties, but sticks together in an organized fashion eg. a jellyfish count as a multibot?

58
F1 bots / Detonator v1.2(F1)(bacillus)-24.04.08
« on: April 23, 2008, 07:56:16 PM »
Code: [Select]
'Detonator v1.2
'A vicious pack hunter
'Uses poison to make enemies overshoot
'Tries to kill any tie parasites

'Initialize bot
cond
 *.robage 0 =
start
 80 .out3 store
 80 .eye1dir store
 60 .eye2dir store
 40 .eye3dir store
 20 .eye4dir store
 0 .eye5dir store
 -20 .eye6dir store
 -40 .eye7dir store
 -60 .eye8dir store
 -80 .eye9dir store
 10 .eye1width store
 10 .eye2width store
 10 .eye3width store
 10 .eye4width store
 10 .eye6width store
 10 .eye7width store
 10 .eye8width store
 10 .eye9width store
stop

cond
start
 -4 *.eye1 sgn mult *.eye2 sgn -- abs mult *.eye3 sgn -- abs mult
*.eye4 sgn -- abs mult *.eye5 sgn  -- abs mult *.eye6 sgn -- abs mult
*.eye7 sgn -- abs mult *.eye8 sgn -- abs mult *.eye9 sgn -- abs  mult
4 *.eye9 sgn mult *.eye2 sgn -- abs mult *.eye3 sgn -- abs mult
*.eye4 sgn -- abs mult *.eye5  sgn -- abs mult *.eye6 sgn -- abs mult
*.eye7 sgn -- abs mult *.eye8 sgn -- abs mult add -3 *.eye2  sgn mult
*.eye3 sgn -- abs mult *.eye4 sgn -- abs mult *.eye5 sgn -- abs mult
*.eye6 sgn -- abs   mult *.eye7 sgn -- abs mult *.eye8 sgn -- abs
mult add 3 *.eye8 sgn mult *.eye3 sgn -- abs mult   *.eye4  sgn --
abs mult *.eye5 sgn -- abs mult *.eye6 sgn -- abs mult *.eye7 sgn --
abs mult add -2  *.eye3 sgn mult *.eye4 sgn -- abs mult *.eye5 sgn --
abs mult *.eye6 sgn -- abs mult *.eye7 sgn --  abs mult add 2 *.eye7
sgn mult *.eye4 sgn -- abs mult *.eye5 sgn -- abs mult *.eye6 sgn --
abs mult add -1  *.eye4 sgn mult *.eye5 sgn -- abs mult *.eye6 sgn --
abs mult add 1 *.eye6 sgn mult *.eye5   sgn --  abs mult add 0 *.eye5
sgn mult add .focuseye store
 .fixpos store
 6 .up store
stop

'Communicate coords and set timer
cond
 *.eyef 0 !=
 *.out3 *.in3 !=
start
 *.refxpos .out1 store
 *.refypos .out2 store
 10 .out4 store
stop

'Reset coord
cond
 *.eyef 0 =
 *.out4 0 = or
start
 0 .out1 store
 0 .out2 store
stop

'Transfer coords from other bots
cond
 *.in3 *.out3 =
 *.in1 0 !=
 *.in2 0 !=
start
 *.in4 .out4 store
 *.in1 .out1 store
 *.in2 .out2 store
stop

'No more food; explosive outwards movement
cond
 *.in3 *.out3 =
 *.out4 0 =
start
 100 .dn store
stop

'Aim towards food
cond
 *.out1 0 !=
 *.out2 0 !=
start
 *.out1 *.out2 angle .setaim store
stop

'Update
cond
start
 .out4 *.out4 sgn mult dec
 *.nrg 3 div *.body sub dup .strbody store - .fdbody store
 2 .strvenom *.nrg 100 floor 100 sub sgn mult store
 .paralyzed .memloc store
 -32000 .venval store
 .shootval .vloc store
stop

'Tie defense system
cond
 *.numties 0 >
start
 99 .shareslime store
 99 .shareshell store
 99 .sharenrg store
 1 .sharewaste store
 -1 .tieloc store
 -1000 .tieval store
stop

'Attack veggies more agressively
cond
 *.eye5 40 >
 *.out3 *.in3 !=
 *.refshoot 0 =
 *.refmulti 0 =
 *.reffixed 0 !=
start
 16 .shootval store
stop

'Feeding
cond
 *.eye5 40 >
 *.out3 *.in3 !=
start
 .up store
 -6 .shoot store
stop

'Fix veggies in place
cond
 *.eye5 40 >
 *.out3 *.in3 !=
 *.refshoot 0 =
 *.refmulti 0 =
 *.reffixed 0 =
start
 .shootval inc
 .fixpos .shoot store
stop

'Paralyze enemies
cond
 *.eye5 40 >
 *.out3 *.in3 !=
 *.memval 0 =
 *.refshoot 0 >
start
 *.venom .shootval store
 -3 .shoot store
stop

'Reproduce
cond
 *.nrg 200 >
start
 50 .repro store
stop

59
F1 bots / Detonator v1.0(F1)(bacillus)24.04.08
« on: April 23, 2008, 07:22:34 PM »
I'm not sure whether the tie defense system makes it F2 eligible or not, because it feeds from ties etc, but does not make ties.



Code: [Select]
'Detonator
'A vicious pack hunter
'Uses poison to make enemies overshoot
'Tries to kill any tie parasites

'Initialize bot
cond
 *.robage 0 =
start
 80 .out3 store
 80 .eye1dir store
 60 .eye2dir store
 40 .eye3dir store
 20 .eye4dir store
 0 .eye5dir store
 -20 .eye6dir store
 -40 .eye7dir store
 -60 .eye8dir store
 -80 .eye9dir store
 10 .eye1width store
 10 .eye2width store
 10 .eye3width store
 10 .eye4width store
 10 .eye6width store
 10 .eye7width store
 10 .eye8width store
 10 .eye9width store
stop

'Set focus eye - Giving right side priority, going inwards
cond
 *.eye1 0 !=
 *.eye2 0 =
 *.eye3 0 =
 *.eye4 0 =
 *.eye5 0 =
 *.eye6 0 =
 *.eye7 0 =
 *.eye8 0 =
 *.eye9 0 =
start
 -4 .focuseye store
stop

cond
 *.eye2 0 =
 *.eye3 0 =
 *.eye4 0 =
 *.eye5 0 =
 *.eye6 0 =
 *.eye7 0 =
 *.eye8 0 =
 *.eye9 0 !=
start
 4 .focuseye store
stop

cond
 *.eye2 0 !=
 *.eye3 0 =
 *.eye4 0 =
 *.eye5 0 =
 *.eye6 0 =
 *.eye7 0 =
 *.eye8 0 =
start
 -3 .focuseye store
stop

cond
 *.eye3 0 =
 *.eye4 0 =
 *.eye5 0 =
 *.eye6 0 =
 *.eye7 0 =
 *.eye8 0 !=
start
 3 .focuseye store
stop

cond
 *.eye3 0 !=
 *.eye4 0 =
 *.eye5 0 =
 *.eye6 0 =
 *.eye7 0 =
start
 -2 .focuseye store
stop

cond
 *.eye4 0 =
 *.eye5 0 =
 *.eye6 0 =
 *.eye7 0 !=
start
 2 .focuseye store
stop

cond
 *.eye4 0 !=
 *.eye5 0 =
 *.eye6 0 =
start
 -1 .focuseye store
stop

cond
 *.eye5 0 =
 *.eye6 0 !=
start
 1 .focuseye store
stop

cond
 *.eye5 0 !=
start
 0 .focuseye store
stop

'Communicate coords and set timer
cond
 *.eyef 0 !=
 *.out3 *.in3 !=
start
 *.refxpos .out1 store
 *.refypos .out2 store
 10 .out4 store
stop

'Reset coord
cond
 *.eyef 0 =
 *.out4 0 = or
start
 0 .out1 store
 0 .out2 store
stop

'Transfer coords from other bots
cond
 *.in3 *.out3 =
 *.in1 0 !=
 *.in2 0 !=
start
 *.in4 .out4 store
 *.in1 .out1 store
 *.in2 .out2 store
stop

'No more food; explosive outwards movement
cond
 *.in3 *.out3 =
 *.out4 0 =
start
 100 .dn store
stop

'Aim towards food
cond
 *.out1 0 !=
 *.out2 0 !=
start
 *.out1 *.out2 angle .setaim store
stop

'Update
cond
start
 .fixpos store
 .out4 *.out4 sgn mult dec
 6 .up store
 *.nrg 3 div *.body sub dup .strbody store - .fdbody store
 2 .strvenom *.nrg 100 floor 100 sub sgn mult store
 .paralyzed .memloc store
 -32000 .venval store
 .shootval .vloc store
stop

'Tie defense system
cond
 *.numties 0 >
start
 99 .shareslime store
 99 .shareshell store
 99 .sharenrg store
 1 .sharewaste store
 -1 .tieloc store
 -1000 .tieval store
stop

'Attack veggies more agressively
cond
 *.eye5 40 >
 *.out3 *.in3 !=
 *.refshoot 0 =
 *.refmulti 0 =
 *.reffixed 0 !=
start
 16 .shootval store
stop

'Feeding
cond
 *.eye5 40 >
 *.out3 *.in3 !=
start
 .up store
 -6 .shoot store
stop

'Fix veggies in place
cond
 *.eye5 40 >
 *.out3 *.in3 !=
 *.refshoot 0 =
 *.refmulti 0 =
 *.reffixed 0 =
start
 .shootval inc
 .fixpos .shoot store
stop

'Paralyze enemies
cond
 *.eye5 40 >
 *.out3 *.in3 !=
 *.memval 0 =
 *.refshoot 0 >
start
 *.venom .shootval store
 -3 .shoot store
stop

'Reproduce
cond
 *.nrg 200 >
start
 50 .repro store
stop

60
Short bots / Singula Haloculus 2(F1)(bacillus)21.04.08
« on: April 21, 2008, 06:46:08 PM »
Code: [Select]
'Singula Haloculus 2
'Took out 360 degree eye
'Improved tie-feeding
'Kills bots that feed with shots
'Moves (!)
'Improved tie-conspec
cond
start
-32000 .shootval *.eye5 40 sub sgn 0 floor mult store
.shootval .shoot *.eye5 40 sub sgn 0 floor mult store
3 .up store
3 .sx store
24 999 store
*.nrg 3 div *.body sub dup .strbody store - .fdbody store
*.memval 24 sub sgn abs 41 add .tie store
*.eye5 sgn -- abs 1216 rnd mult .aimdx store
1000 .sharenrg store
1 .sharewaste store
41 .deltie store
-1 .tieloc store
-1000 .tieval store
100 .shareshell store
100 .shareslime store
*.nrg 200 sub sgn ++ sgn 50 mult .repro store
999 .memloc store
1 rnd ++ 2 mult 3 sub *.thisgene add .delgene store
stop

Pages: 1 2 3 [4] 5 6