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

Pages: 1 2 3 [4] 5 6 ... 17
46
Bug reports / When a bot wins the league
« on: January 17, 2007, 06:37:02 AM »
Minor bug, when a bot wins the league a match is played between the original 29th and 30th bot before you can save the new league rankings.

47
F2 bots / Simplebot1-20 (F2)-PY (17-01-2007)
« on: January 17, 2007, 02:01:23 AM »
All the simplebots can be found here

Qualifying simple-bot 20 for the F2 league, edit by Bots.

Code: [Select]
' Gene 12 tie to parent
cond
*.robage 0 =
start
.tie inc
stop

' Gene 13 sever tie to parent
cond
*.robage 1 =
start
.deltie inc
stop

' Gene 7 wide search 1
cond
*.eye1 *.eye5 >
start
mult -140
stop

' Gene 8 wide search 2
cond
*.eye9 *.eye5 >
start
mult 140
stop

' Gene1. Simple search pattern.
cond
  *.eye4 *.eye6 >
start
mult -35
stop

' Gene2. Simple search pattern part 2
cond
  *.eye6 *.eye4 >
start
mult 35
stop

' Gene 3. Move forward
cond
  *.vel 40 <
  *.refeye *.myeye !=
start
  40 *.vel sub 2 div .up store
stop

' Gene 4. Shoot the food
cond
  *.eye5 40 >
  *.refeye *.myeye !=
start
  -1 .shoot store
stop

' Gene 6. Avoid conspecifics
cond
*.refeye *.myeye =
start
mult 180
stop

' Gene 14 rotate back and continue feeding
cond
*50 0 >
start
mult 628
50 dec
stop

' Gene 5. Reproduce
cond
*.nrg 5000 >
start
50 .repro store
mult 628
50 inc

stop



'Gene 9. Get rid of that waste
cond
*.waste 100 >
start
1 .backshot store
-4 .shoot store
*.waste .shootval store
stop

' Gene 10. Perform the rotation
cond
start
.aimdx store
stop

' Gene 11. slide to the side.
cond
*.aimdx 0 !=
*.aimdx 180 !=
start
*.aimdx 10 div .dx store
stop

end

48
Bug reports / Neverending league match
« on: January 14, 2007, 01:16:09 PM »
First F1 league match between Vex mk1 and the new T. Mosquito.

Everytime Mosquito won five matches it would start the same match again at round 1.  
The only thing I can think of that I have done differently to normal is putting Mosquito straight into the league folder, can't see that being reason though.

Not expecting this to be repeatable, first time I've noticed anything like that happening. Will shut DB down and try again with my fingers crossed!

EDIT:
So much for superstition coming to my aid, the problem stayed even after restarts and moving the robot file out of the league folder. Even to the point of not being a problem if I entered a different bot then reappearing when mosquito was reentered.
I think there is another buddy drop I can try so I'll download that and see if it still causes problems.
The league folder and league.txt I am using are identical to the ones posted a couple of days ago as zips on the f1 league page.
(same problem with .9t, I guess I'll just run Mosquito through the shorbots league for now. )

Pff! Same problem appeared there. Seing as a couple of people have already run this bot through the F1 league I am perplexed.  

49
Interesting behaviour bots / Black ant (IB)(Eight)-03.10.04
« on: January 13, 2007, 11:17:17 AM »
'Topic: Ant bot
' Black Ant by Eight 03.10.04
'
' repro basics/angle-calc lifted from PY's ant bot
' these broadcast knowledge of food locations
' so friendlies will find the exact spot

def qx 50
def qy 51
def cycle 52
def type 53
' 0 = none
' 1 = worker
' 2 = queen
' 3 = nomadic queen
def gear 54
def tick 55
def pattern 56
' 0 = initialize to 1
' 1 = search
' 2 = eat food
' 3 = return home
' 4 = avoid friends
' 5 = seek target food
def alone 57
def egg 58
def see 59
def fx 60
def fy 61
def gear2 62

' waste
cond
*.waste 100 >
*.eye5 0 =
start
100 .shootval store
-4 .shoot store
stop

'clockwork
cond
*.type 2 =
*.gear2 0 =
start
50 .gear2 store
stop

cond
*.type 2 =
*.gear2 0 >
start
.gear2 dec
stop

'gear left
cond
*.type 1 =
*.tick 0 =
*.gear 50 =
start
.tick inc
.cycle dec
stop

'right
cond
*.type 1 =
*.tick 1 =
*.gear 0 >
start
.gear dec
stop

'left
cond
*.type 1 =
*.tick 0 =
*.gear 50 <
start
.gear inc
stop

'gear right
cond
*.type 1 =
*.gear 0 =
start
.tick dec
stop

'initialize
cond
*.robage 0 =
start
0 .type store
0 .pattern store
stop

'initialize
cond
*.robage 2 =
*.numties 0 =
start
2 .type store
1 .fixpos store
stop

'queen where am I
cond
*.type 2 =
*.qx 0 =
*.qy 0 =
start
*.xpos .qx store
*.ypos .qy store
stop

'send coordinates
cond
*.type 2 =
*.eye5 70 >
*.refup *.myup =
*.refaimdx *.myaimdx =
*.refage 300 <
start
*.qx .out1 store
*.qy .out2 store
stop

'receive coordinates
cond
*.type 0 =
*.eye5 70 >
*.refup *.myup =
*.refaimdx *.myaimdx =
*.in1 0 >
*.in2 0 >
start
*.in1 .qx store
*.in2 .qy store
.type inc
stop

'sever birth tie
cond
*.type 2 =
*.egg 43 =
start
.deltie inc
stop

'adjust counters
cond
*.egg 0 >
start
.egg dec
stop

'reproduce as queen
cond
*.robage 300 <
*.eye5 30 <
*.type 2 =
*.nrg 2500 >
*.gear2 25 =
*.egg 0 =
start
mult
50 .repro store
45 .egg store
stop

'reproduce as queen
cond
*.eye5 30 <
*.type 2 =
*.nrg 5000 >
*.body 5000 >
*.gear2 25 =
*.egg 0 =
start
mult
10 .repro store
45 .egg store
stop

'spin queen
cond
*.type 2 =
*.see 0 =
start
20 .aimdx store
stop

'queen attack
cond
*.type 2 =
*.eye5 50 >
*.refup *.myup !=
*.refaimdx *.myaimdx !=
start
-6 .shoot store
stop

'remove behavior from new queens
cond
*.type 2 =
*.pattern 0 !=
start
0 .pattern store
stop

'initialize worker behavior
cond
*.type 1 =
*.pattern 0 =
start
.pattern inc
stop

'behavior
cond
*.pattern 1 =
*.vel 3 <
start
*.nrg 1000 div .up store
stop

'behavior
cond
*.pattern 1 =
*.see 0 =
*.tick 0 =
start
10 .aimsx store
stop

'behavior
cond
*.pattern 1 =
*.see 0 =
*.tick 1 =
start
10 .aimdx store
stop

'behavior
cond
*.pattern 1 =
*.eye5 0 >
*.refup *.myup =
*.refaimdx *.myaimdx =
*.reffixed 0 =
*.in1 0 !=
*.in2 0 !=
start
*.in1 .fx store
*.in2 .fy store
5 .pattern store
stop

'behavior
cond
*.pattern 5 =
start
5 .up store
stop

'PYs Head for home gene modified
cond
*.pattern 5 =
*.fx 0 !=
*.fy 0 !=
start
*.fx *.fy angle .setaim store
stop

'at target
cond
*.pattern 5 =
*.xpos *.fx %=
*.ypos *.fy %=
start
0 .fx store
0 .fy store
1 .pattern store
stop

'behavior
cond
*.pattern 3 !=
*.pattern 4 !=
*.eye5 30 >
*.refup *.myup =
*.refaimdx *.myaimdx =
start
4 .pattern store
stop

'behavior
cond
*.pattern 4 =
*.fx 0 !=
*.fy 0 !=
start
314 rnd .aimdx store
5 .pattern store
stop

'behavior
cond
*.pattern 4 =
*.fx 0 =
*.fy 0 =
start
314 rnd .aimdx store
1 .pattern store
stop

'see foods
cond
*.eye5 40 >
*.refup *.myup !=
*.refaimdx *.myaimdx !=
start
*.xpos .fx store
*.ypos .fy store
1 .fixpos store
2 .pattern store
stop

'eat vegs
cond
*.pattern 2 =
*.eye5 40 >
*.refup 0 =
*.refup *.myup !=
*.refaimdx *.myaimdx !=
start
-1 .shoot store
stop

'eat enemies
cond
*.pattern 2 =
*.see 3 >
*.refup 0 >
*.refup *.myup !=
*.refaimdx *.myaimdx !=
start
-6 .shoot store
stop

'full
cond
*.pattern 2 =
*.nrg 20000 >
start
.pattern inc
stop

'nothing
cond
*.pattern 2 =
*.see 0 =
start
.pattern dec
stop

'advance
cond
*.pattern 2 =
*.vel 0 =
*.see 0 !=
*.fixed 0 =
start
5 .up store
stop

'unfix
cond
*.type 2 !=
*.eye5 40 <
*.fixed 1 =
start
0 .fixpos store
stop

'PYs Head for home gene modified
cond
*.pattern 3 =
*.qx 0 !=
*.qy 0 !=
start
*.qx *.qy angle .setaim store
stop

'behavior
cond
*.pattern 3 =
start
5 .up store
*.fx .out1 store
*.fy .out2 store
stop

'see the queen
cond
*.pattern 3 =
*.eye5 50 >
*.refup *.myup =
*.refaimdx *.myaimdx =
*.nrg 3000 >
*.reffixed 1 =
start
1 .fixpos store
500 .shootval store
-2 .shoot store
stop

'queen's not here
cond
*.pattern 3 =
*.xpos *.qx =
*.ypos *.qy =
start
1 .fixpos store
2 .type store
stop

'done
cond
*.pattern 3 =
*.nrg 3000 <
*.fx 0 >
*.fy 0 >
start
5 .pattern store
stop

'done
cond
*.pattern 3 =
*.nrg 3000 <
*.fx 0 =
*.fy 0 =
start
1 .pattern store
stop


'queen grow
cond
*.type 2 =
*.robage 300 >
*.body 31000 <
*.nrg 5000 >
start
100 .strbody store
stop

'slim down the workers until they get older
cond
*.robage 600 <
*.type 1 =
*.body 100 >
start
100 .fdbody store
stop

'hungry queen
cond
*.type 2 =
*.nrg 500 <
*.body 500 >
start
100 .fdbody store
stop

'starving queen turns worker
cond
*.type 2 =
*.nrg 500 <
*.body 500 <
start
0 .qx store
0 .qy store
.type dec
stop

'colony health
cond
*.type 2 =
*.gear2 25 =
start
.alone inc
stop

'queen is happy
cond
*.type 2 =
*.pleas 100 >
start
0 .alone store
stop

'where are my workers? fine I'll go solo
cond
*.type 2 =
*.alone 50 >
start
0 .qx store
0 .qy store
1 .type store
stop

'nomad queen settles
cond
*.type 1 =
*.nrg 30000 >
start
.type inc
stop

'detected
cond
*.type 1 =
*.eye4 *.eye6 !=
start
.see inc
stop

'nothing
cond
*.see 0 >
*.eye4 0 =
*.eye6 0 =
start
0 .see store
stop

'left
cond
*.eye4 *.eye6 >
start
10 .aimsx store
stop

cond
*.type 2 !=
*.see 0 =
*.eye1 *.eye9 >
start
60 .aimsx store
5 .sx store
stop

'right
cond
*.eye6 *.eye4 >
start
10 .aimdx store
stop

cond
*.type 2 !=
*.see 0 =
*.eye9 *.eye1 >
start
60 .aimdx store
5 .dx store
stop

'feel
cond
*55 0 =
*.shdn 0 !=
start
628 .aimdx store
stop

'feel
cond
*55 0 =
*.shsx 0 !=
start
200 .aimsx store
stop

'feel
cond
*55 0 =
*.shdx 0 !=
start
200 .aimdx store
stop

'shell
cond
*.nrg 2000 >
*.shell 20 <
start
20 .mkshell store
stop


end

50
Interesting behaviour bots / Ant ver 0.2 (IB)(ChromiumDragon)-01.10.04
« on: January 13, 2007, 11:07:13 AM »
'Topic: Ant bot
'ChromiumDragon

'Needs the 2.33 version (with angle command)

'Ant Ver. 0.2

'Defines
def bottype 59
'Stores if bot is motile or immotile (1=immotile, 2=motile, 3=in flux)

def job 51
'Stores the current job
' Immotile (1,2,3=program child)
' Motile (1=store mother location, 2=hunt for food, 3=feed, 4=return to queen, 5=feed queen)

def botdata 60

'Initilizations
'--------------
'Queen Initilize
cond
*59 3 =
*.in1 0 =
*.in2 0 =
'Not looking at a queen
start
1 .bottype store
*.ypos .out1 store
*.xpos .out2 store
1 .fixpos store
stop

'Worker Initilize
cond
*.bottype 3 =
*.in1 0 !=
*.in2 0 !=
'Looking at a queen
start
2 .bottype store
*.in1 .out1 store
*.in2 .out2 store
1 .tie store
0 .fixpos store
stop

'Initilize
cond
*.robage 1 =
start
3 .bottype store
stop

'Basic Queen Controls
'--------------------
'Rotate to till clear vision
cond
*.bottype 1 =
*.eye5 30 >
*.job 0 =
start
250 .aimdx store
stop

'Program child
'-------------
'Sever programmed child
cond
*.bottype 1 =
*.job 2 =
*.tiepres 1 =
start
1 .tienum store
1 .deltie store
0 .job store
stop

'Program child 1
cond
*.bottype 1 =
*.job 1 =
start
1 .tienum store
.job .tieloc store
2 .tieval store
2 .job store
stop

'Breed Worker
'-------------------
'Breed
cond
*.bottype 1 =
*.botdata 10 <
*.nrg 10000 >
*.numties 0 =
*.eye5 40 <
*.job 1 !=
start
20 .repro store
*.botdata inc
1 .job store
stop


'Worker food gathering
'---------------------
'Turn away from friendly
cond
*.bottype 2 =
*.in1 *.out1 =
*.in2 *.out2 =
*.eye5 40 >
*.job 2 =
start
628 .aimdx store
0 .in1 store
0 .in2 store
stop

'Move if slow
cond
*.bottype 2 =
*.vel 20 <
*.job 2 =
start
20 *.vel sub .up store
stop

'Search for food wide
cond
*.bottype 2 =
*.job 2 =
*.in1 *.out1 !=
*.in2 *.out2 !=
*.eye3 *.eye7 !=
*.eye5 40 <
start
*.eye3 *.eye7 sub .aimsx store
*.eye3 *.eye7 sub 4 div .sx store
stop

'Search for food narrow
cond
*.bottype 2 =
*.job 2 =
*.in1 *.out1 !=
*.in2 *.out2 !=
*.eye4 *.eye6 !=
*.eye5 40 <
start
*.eye4 *.eye6 sub 2 div .aimsx store
*.eye4 *.eye6 sub 8 div .sx store
stop

'Found food
cond
*.bottype 2 =
*.job 2 =
*.in1 *.out1 !=
*.in2 *.out2 !=
*.eye5 40 >
start
1 .fixpos store
3 .job store
stop

'Out of food
cond
*.bottype 2 =
*.job 3 =
*.eye5 40 <
*.nrg 20000 <
start
0 .fixpos store
2 .job store
stop

'Feed
'----
'Shoot
cond
*.bottype 2 =
*.job 3 =
*.nrg 20000 <
start
-1 .shoot store
stop

'Full, start home
cond
*.bottype 2 =
*.job 3 =
*.nrg 20000 >
start
4 .job store
0 .fixpos store
stop

'Return to queen
'---------------
'Point at queen
cond
*.bottype 2 =
*.job 4 =
*.nrg 8000 >
start
*.out2 *.out1 angle .setaim store
stop

'Move towards queen
cond
*.bottype 2 =
*.job 4 =
*.nrg 8000 >
*.vel 20 <
start
20 *.vel sub .up store
stop

'Out of gas, start feeding again
cond
*.bottype 2 =
*.job 4 =
*.nrg 8000 <
start
2 .job store
stop

'Close to queen
cond
*.out1 *.ypos sub 10 div 0 %=
*.out2 *.xpos sub 10 div 0 %=
*.bottype 2 =
*.job 4 =
*.nrg 8000 >
*.in1 *.out1 =
*.in2 *.out2 =
start
1 .fixpos store
5 .job store
stop

'Queen gone
cond
*.out1 *.ypos sub 10 div 0 %=
*.out2 *.xpos sub 10 div 0 %=
*.bottype 2 =
*.job 4 =
*.nrg 8000 >
*.eye5 30 <
start
0 .job store
1 .bottype store
1 .fixpos store
stop

'Feed queen
'----------
'Feed
cond
*.bottype 2 =
*.job 5 =
*.nrg 8000 >
start
1000 .shootval store
-2 .shoot store
stop

'Done feeding
cond
*.bottype 2 =
*.job 5 =
*.nrg 8000 <
start
0 .fixpos store
2 .job store
stop

'Misc
'------------
'Clear in1
cond
*.in1 0 !=
start
0 .in1 store
stop

'Clear in2
cond
*.in2 0 !=
start
0 .in2 store
stop

cond
*.waste 100 >
start
100 .shootval store
-4 .shoot store
stop

end

51
Interesting behaviour bots / Ant-bot 4 (IB)(PY)-15.10.04
« on: January 13, 2007, 11:01:33 AM »
'Topic: Ant bot
'PY
'
'' Ant-Bot4
' Written by Purple Youko for version 2.33
' Use on size 2 or higher with plenty of veggies.
' now the Queen can hijack other workers

def type 50
' type 0 = worker
' type 1 = warrior
' type 2 = queen
' type 3 = new queen
def robid 51
' robid 1000 = makes new queen
' robid 900 - 999 makes warrior
' robid < 900 makes new worker
def queenx 52
def queeny 53
def newmom 54
def hfh 55
' Head For Home that is
' hfh 0 = search for food
' hfh 1 = head for home
' hfh 2 = feed the queen
def queenid 56
def feeding 57
def counter 58
def counter2 59
' used for breeding new workers if too long a delay.


' initialize at birth
cond
*.robage 0 =
start
1000 rnd .robid store
.tie inc
stop

cond
*.robage 50 =
*.robid 990 >
start
3 .type store
14000 rnd 100 add .queenx store
10000 rnd 100 add .queeny store
32000 rnd .queenid store
stop

'cond
'*.robage 0 =
'*.robid 990 >
'*.robid 1000 !=
'start
'1 .type store
'stop

' Copy queen's ID into out1
'cond
'*.robage 1 =
'*.eye5 0 !=
'start
'*.in1 .out1 store
'*.in2 .queenid store
'stop

' make new robots into queens at start of sim
' or when breeding ties go wrong
cond
*.robage 2 =
*.numties 0 =
start
3 .type store
'1 .fixpos store
32000 rnd 1 add .queenid store
*.queenid .out2 store
32000 rnd 1 add .out1 store
1000 .robid store
stop

' Queen programs young with her ID
cond
*.type 2 =
*.tiepres 1 =
*.newmom 41 =
start
1 .tienum store
*.out1 .tieval store
.out1 .tieloc store
stop

' Queen programs young with her ID
cond
*.type 2 =
*.tiepres 1 =
*.newmom 42 =
start
1 .tienum store
*.out2 .tieval store
.queenid .tieloc store
stop

' Queen programs young with her position
cond
*.type 2 =
*.tiepres 1 =
*.newmom 44 =
start
1 .tienum store
*.xpos .tieval store
.queenx .tieloc store
stop

cond
*.type 2 =
*.tiepres 1 =
*.newmom 43 =
start
1 .tienum store
*.ypos .tieval store
.queeny .tieloc store
stop

' sever birth tie. Off you go little worker
cond
*.type 2 =
*.newmom 40 =
start
.deltie inc
stop

' Adjust counters
cond
*.newmom 0 >
start
.newmom dec
stop

cond
start
.counter inc
.counter2 inc
stop

cond
*.counter 50 >
start
0 .counter store
stop

cond
*.type 2 !=
*.counter 20 =
*.hfh 2 !=
*.feeding 0 =
start
1 .fixpos store
stop

cond
*.type 2 !=
*.counter 21 =
*.hfh 1 =
start
0 .fixpos store
stop

' rotate as queen
cond
*.type 2 =
start
20 .aimdx store
stop

' initial reproduction for young queen
' need some little worker ants quickly
cond
*.eye5 30 <
*.type 2 =
*.nrg 2000 >
*.robage 100 <
*.newmom 0 =
start
' give away 500 body only.
' clear stack first though
mult mult
32000 *.body div .repro store
46 .newmom store
stop

' Breed new workers if none come back to feed queen
cond
*.eye5 30 <
*.type 2 =
*.nrg 2000 <
*.counter2 1000 >
*.newmom 0 =
start
' give away 500 body only.
' clear stack first though
mult mult
32000 *.body div .repro store
46 .newmom store
0 .counter2 store
stop

' Reset counter2 if queen gets fed
cond
*.pleas 0 >
start
0 .counter2 store
stop

' Reproduce as queen
cond
*.eye5 30 <
*.type 2 =
*.nrg 5000 >
*.body 5000 >
*.newmom 0 =
start
' give away 500 body only.
' clear stack first though
mult
32000 *.body div .repro store
46 .newmom store
stop

' Queen's defences
cond
*.type 2 =
*.poison 500 <
*.nrg 2000 >
start
10 .strpoison store
.shoot .ploc store
stop

' Queen shoots tie
cond
*.type 2 =
*.eye5 40 >
*.eye4 *.eye6 =
*.in1 *.out1 !=
*.newmom 0 =
start
1 .tie store
0 .aimdx store
46 .newmom store
stop

' Queeny gets fat
cond
*.type 2 =
*.body 32000 <
*.nrg 2000 >
start
10 .strbody store
stop

cond
*.type 3 =
*.body 10000 <
*.nrg 5000 >
start
100 .strbody store
stop

' Queen gets low on energy
cond
*.type 2 =
*.nrg 500 <
start
10 .fdbody store
stop

cond
*.type 2 =
*.body 32000 <
*.nrg 4500 >
start
100 .strbody store
stop

' worker trades body for energy
cond
*.type 0 =
*.body 100 >
start
100 .fdbody store
stop

' worker selects direction to head after birth
cond
*.robage 10 =
start
1256 rnd .setaim store
stop

' All ants reset in1 and out1 if nothing is visible
cond
*.eye5 0 =
*.in1 0 !=
start
0 .in1 store
0 .in2 store
stop

' worker has collected enough food
cond
*.type 0 =
*.nrg 20000 >
*.hfh 0 =
start
1 .hfh store
0 .fixpos store
0 .feeding store
stop

' Head for home
cond
*.type 2 !=
*.hfh 1 =
start
*.queenx *.queeny angle .setaim store
stop

' set worker velocity
cond
*.type 0 =
*.robage 5 >
*.numties 0 =
*.vel 10 <
*.fixed 0 =
*.eye5 51 <
start
10 *.vel sub .up store
stop

' what if sated worker is blocked
' choose a new random direction and accelerate in it
cond
*.type 0 =
*.hfh 1 =
*.eye5 41 >
*.in2 *.queenid !=
start
2 .sx store
stop


' worker searches for food
cond
*.type 0 =
*.hfh 0 =
*.in1 *.out1 !=
*.eye3 *.eye7 !=
*.eye5 50 <
start
*.eye3 *.eye7 sub .aimsx store
'1 .fixpos store
stop

' worker searches for food
cond
*.type 0 =
*.hfh 0 =
*.in1 *.out1 !=
*.eye4 *.eye6 !=
*.eye5 40 <
start
*.eye4 *.eye6 sub .aimsx store
'1 .fixpos store
stop

' worker avoids conspecs
cond
*.robage 10 >
*.type 0 =
*.hfh 0 =
*.in1 *.out1 =
*.eye5 40 >
start
200 .aimsx store
stop

' worker avoids queen while searching for food
cond
*.robage 100 >
*.type 0 =
*.hfh 0 =
*.in1 *.out1 =
*.in2 *.queenid =
start
628 .aimsx store
stop


' worker or new queen finds food
cond
*.type 2 !=
*.hfh 0 =
*.eye5 40 >
*.in1 *.out1 !=
*.feeding 0 =
start
1 .fixpos store
.feeding inc
stop

' worker or new queen shoots food
cond
*.type 2 !=
*.hfh 0 =
*.eye5 40 >
*.in1 *.out1 !=
start
-1 .shoot store
stop

' worker or new queen stops feeding
cond
*.type 2 !=
*.feeding 0 >
*.eye5 41 <
*.fixed 0 !=
start
.feeding dec
0 .fixpos store
stop

' worker runs out of energy while returning to queen
cond
*.type 0 =
*.hfh 1 =
*.nrg 3000 <
start
0 .hfh store
1256 rnd .setaim store
stop

' worker reaches queen
cond
*.type 0 =
*.hfh 1 =
*.in2 *.queenid =
*.eye5 50 >
start
2 .hfh store
1 .fixpos store
stop

' worker feeds queen
cond
*.type 0 =
*.hfh 2 =
*.nrg 3500 >
*.in2 *.queenid store
start
mult mult
500 .shootval store
-2 .shoot store
stop

' worker stops feeding queen
cond
*.type 0 =
*.hfh 2 =
*.nrg 3501 <
start
0 .hfh store
0.fixpos store
stop

' worker (or warrior) unfixes his position after birth or feeding the

queen
cond
*.type 2 !=
*.hfh 0 =
*.fixed 0 !=
*.feeding 0 =
start
0 .fixpos store
stop

' worker reaches queen's position to find her gone
cond
*.type 0 =
*.hfh 1 =
*.xpos *.queenx =
*.ypos *.queeny =
*.in2 *.queenid !=
start
' becomes new queen
1 .fixpos store
*.queenid .out2 store
2 .type store
stop

' new queen sets out to get some energy
cond
*.type 3 =
*.eye5 40 <
*.vel 20 <
*.robage 1000 <
start
20 *.vel sub .up store
stop

cond
*.type 3 =
*.hfh 1 =
start
5 .up store
stop

cond
*.type 3 =
*.eye8 *.eye2 !=
*.eye8 *.eye5 !=
*.hfh 0 =
start
*.eye2 *.eye8 sub .aimsx store
stop

cond
*.type 3 =
*.eye6 *.eye4 !=
*.eye6 *.eye5 !=
start
*.eye4 *.eye6 sub .aimsx store
stop

' new queen avoids conspecs
cond
*.type 3 =
*.eye5 40 >
*.in1 *.out1 =
start
320 .aimsx store
stop

' New queen has enough energy now
cond
*.type 3 =
*.nrg 30000 >
*.body 5000 >
start
1 .hfh store
stop

' New queen find home home
cond
*.type 3 =
*.hfh 1 =
*.xpos *.queenx %=
*.ypos *.queeny %=
start
1 .fixpos store
*.xpos .queenx store
*.ypos .queeny store
2 .type store
32000 rnd 1 add .out1 store
*.queenid .out2 store
stop

' get rid of waste. all types
cond
*.waste 100 >
start
100 .shootval store
-4 .shoot store
stop

end

52
Interesting behaviour bots / Ant-bot 2 (IB)(PY)-01.10.04
« on: January 13, 2007, 10:58:46 AM »
'Topic: Ant bot
'PY

' Ant-Bot2
' By PY
' Oct 1 2004
' Designed for V2.33 with angle function

def type 50
' type 0 = worker
' type 1 = warrior
' type 2 = queen
def robid 51
' robid 1000 = makes new queen
' robid 900 - 999 makes warrior
' robid < 900 makes new worker
def queenx 52
def queeny 53
def newmom 54
def hfh 55
' Head For Home that is
' hfh 0 = search for food
' hfh 1 = head for home
' hfh 2 = feed the queen
def queenid 56
def feeding 57
def counter 58


' initialize at birth
cond
*.robage 0 =
start
1000 rnd .robid store
.tie inc
stop

cond
*.robage 0 =
*.robid 1000 =
start
2 .type store
stop

cond
*.robage 0 =
*.robid 990 >
*.robid 1000 !=
start
1 .type store
stop

' Copy queen's ID into out1
cond
*.robage 1 =
*.eye5 0 !=
start
*.in1 .out1 store
*.in2 .queenid store
stop

' make new robots into queens at start of sim
' or when breeding ties go wrong
cond
*.robage 2 =
*.numties 0 =
start
2 .type store
1 .fixpos store
32000 rnd 1 add .queenid store
*.queenid .out2 store
32000 rnd 1 add .out1 store
stop

' Queen programs young with her position
cond
*.type 2 =
*.tiepres 1 =
*.newmom 44 =
start
1 .tienum store
*.xpos .tieval store
.queenx .tieloc store
stop

cond
*.type 2 =
*.tiepres 1 =
*.newmom 43 =
start
1 .tienum store
*.ypos .tieval store
.queeny .tieloc store
stop

' sever birth tie. Off you go little worker
cond
*.type 2 =
*.newmom 42 =
start
.deltie inc
stop

' Adjust counters
cond
*.newmom 0 >
start
.newmom dec
stop

cond
start
.counter inc
stop

cond
*.counter 50 >
start
0 .counter store
stop

cond
*.type 0 =
*.counter 20 =
*.hfh 2 !=
*.feeding 0 =
start
1 .fixpos store
stop

cond
*.type 0 =
*.counter 21 =
*.hfh 1 =
start
0 .fixpos store
stop

' rotate as queen
cond
*.type 2 =
start
20 .aimdx store
stop

' initial reproduction for young queen
' need some little worker ants quickly
cond
*.eye5 30 <
*.type 2 =
*.nrg 2000 >
*.robage 100 <
*.newmom 0 =
start
' give away 500 body only.
' clear stack first though
mult mult
32000 *.body div .repro store
46 .newmom store
stop

' Reproduce as queen
cond
*.eye5 30 <
*.type 2 =
*.nrg 5000 >
*.body 5000 >
*.newmom 0 =
start
' give away 500 body only.
' clear stack first though
mult
32000 *.body div .repro store
46 .newmom store
stop

' Queen's defences
cond
*.type 2 =
*.poison 500 <
*.nrg 2000 >
start
10 .strpoison store
.shoot .ploc store
stop

' Queen shoots back
cond
*.type 2 =
*.eye5 30 >
*.in1 *.out1 !=
*.newmom 0 =
start
-1 .shoot store
0 .aimdx store
stop

' Queeny gets fat
cond
*.type 2 =
*.body 32000 <
*.nrg 2000 >
start
10 .strbody store
stop

' Queen gets low on energy
cond
*.type 2 =
*.nrg 500 <
start
10 .fdbody store
stop

cond
*.type 2 =
*.body 32000 <
*.nrg 4500 >
start
100 .strbody store
stop

' worker trades body for energy
cond
*.type 0 =
*.body 100 >
start
100 .fdbody store
stop

' worker selects direction to head after birth
cond
*.robage 10 =
start
1256 rnd .setaim store
stop

' All ants reset in1 and out1 if nothing is visible
cond
*.eye5 0 =
*.in1 0 !=
start
0 .in1 store
0 .in2 store
stop

' worker has collected enough food
cond
*.type 0 =
*.nrg 20000 >
*.hfh 0 =
start
1 .hfh store
0 .fixpos store
0 .feeding store
stop

' Head for home
cond
*.type 0 =
*.hfh 1 =
start
*.queenx *.queeny angle .setaim store
stop

' set worker velocity
cond
*.type 0 =
*.robage 5 >
*.numties 0 =
*.vel 10 <
*.fixed 0 =
*.eye5 51 <
start
10 *.vel sub .up store
stop

' what if sated worker is blocked
' choose a new random direction and accelerate in it
cond
*.type 0 =
*.hfh 1 =
*.eye5 41 >
*.in2 *.queenid !=
start
2 .sx store
stop


' worker searches for food
cond
*.type 0 =
*.hfh 0 =
*.in1 *.out1 !=
*.eye3 *.eye7 !=
*.eye5 50 <
start
*.eye3 *.eye7 sub .aimsx store
'1 .fixpos store
stop

' worker searches for food
cond
*.type 0 =
*.hfh 0 =
*.in1 *.out1 !=
*.eye4 *.eye6 !=
*.eye5 40 <
start
*.eye4 *.eye6 sub .aimsx store
'1 .fixpos store
stop

' worker avoids conspecs
cond
*.robage 10 >
*.type 0 =
*.hfh 0 =
*.in1 *.out1 =
*.eye5 40 >
start
200 .aimsx store
stop

' worker avoids queen while searching for food
cond
*.robage 100 >
*.type 0 =
*.hfh 0 =
*.in1 *.out1 =
*.in2 *.queenid =
start
628 .aimsx store
stop


' worker finds food
cond
*.type 0 =
*.hfh 0 =
*.eye5 40 >
*.in1 *.out1 !=
*.feeding 0 =
start
1 .fixpos store
.feeding inc
stop

' worker shoots food
cond
*.type 0 =
*.hfh 0 =
*.eye5 40 >
*.in1 *.out1 !=
start
-1 .shoot store
stop

' worker stops feeding
cond
*.type 0 =
*.feeding 0 >
*.eye5 41 <
*.fixed 0 !=
start
.feeding dec
0 .fixang store
stop

' worker runs out of energy while returning to queen
cond
*.type 0 =
*.hfh 1 =
*.nrg 3000 <
start
0 .hfh store
1256 rnd .setaim store
stop

' worker reaches queen
cond
*.type 0 =
*.hfh 1 =
*.in2 *.queenid =
*.eye5 50 >
start
2 .hfh store
1 .fixpos store
stop

' worker feeds queen
cond
*.type 0 =
*.hfh 2 =
*.nrg 3500 >
*.in2 *.queenid store
start
mult mult
500 .shootval store
-2 .shoot store
stop

' worker stops feeding queen
cond
*.type 0 =
*.hfh 2 =
*.nrg 3501 <
start
0 .hfh store
0.fixpos store
stop

' worker (or warrior) unfixes his position after birth or feeding the queen
cond
*.type 2 !=
*.hfh 0 =
*.fixed 0 !=
*.feeding 0 =
start
0 .fixpos store
stop

' worker reaches queen's position to find her gone
cond
*.type 0 =
*.hfh 1 =
*.xpos *.queenx =
*.ypos *.queeny =
*.in2 *.queenid !=
start
' becomes new queen
1 .fixpos store
*.queenid .out2 store
2 .type store
stop

' get rid of waste. all types
cond
*.waste 100 >
start
100 .shootval store
-4 .shoot store
stop
end

53
Interesting behaviour bots / Ant-bot 1 (IB)(PY)-30.09.04
« on: January 13, 2007, 10:55:20 AM »
'Topic: Ant bot
'PY

' Ant-Bot 1

def type 50
' type 0 = worker
' type 1 = warrior
' type 2 = queen
def robid 51
' robid 1000 = makes new queen
' robid 900 - 999 makes warrior
' robid < 900 makes new worker
def queenx 52
def queeny 53
def newmom 54
def hfh 55
' Head For Home that is
' hfh 0 = search for food
' hfh 1 = head for home
' hfh 2 = feed the queen
def queenid 56


' initialize at birth
cond
*.robage 0 =
start
1000 rnd .robid store
.tie inc
stop

cond
*.robage 0 =
*.robid 1000 =
start
2 .type store
stop

cond
*.robage 0 =
*.robid 900 >
*.robid 1000 !=
start
1 .type store
stop

' Copy queen's ID into out1
cond
*.robage 1 =
*.eye5 0 !=
start
*.in1 .out1 store
*.in2 .queenid store
stop

' make new robots into queens at start of sim
' or when breeding ties go wrong
cond
*.robage 2 =
*.numties 0 =
start
2 .type store
1 .fixpos store
32000 rnd 1 add .queenid store
*.queenid .out2 store
32000 rnd 1 add .out1 store
stop

' Queen programs young with her position
cond
*.type 2 =
*.tiepres 1 =
*.newmom 4 =
start
1 .tienum store
*.xpos .tieval store
.queenx .tieloc store
stop

cond
*.type 2 =
*.tiepres 1 =
*.newmom 3 =
start
1 .tienum store
*.ypos .tieval store
.queeny .tieloc store
stop

' sever birth tie. Off you go little worker
cond
*.type 2 =
*.newmom 2 =
start
.deltie inc
stop

' Adjust counters
cond
*.newmom 0 >
*.tiepres 0 !=
start
.newmom dec
stop

' Reset counters if they get messed up
cond
*.newmom 0 >
*.numties 0 =
start
.newmom dec
stop

' rotate as queen if field of vision is not clear
cond
*.eye5 30 >
*.type 2 =
start
100 .aimsx store
stop

' Reproduce as queen
cond
*.eye5 30 <
*.type 2 =
*.nrg 5000 >
*.counter 0 =
*.newmom 0 =
start
10 .repro store
6 .newmom store
stop

' Queeny gets fat
cond
*.type 2 =
*.body 32000 <
*.nrg 2000 >
start
20 .strbody store
stop

' worker sheds body
cond
*.type 0 =
*.body 100 >
start
100 .fdbody store
stop

' worker selects direction to head after birth
cond
*.robage 10 =
start
1256 rnd .setaim store
stop

' All ants reset in1 and out1 if nothing is visible
cond
*.eye5 0 =
*.in1 0 !=
start
0 .in1 store
0 .in2 store
stop

' worker has collected enough food
cond
*.type 0 =
*.nrg 10000 >
*.hfh 0 =
start
1 .hfh store
stop

' Head for home
cond
*.type 0 =
*.hfh 1 =
start
*.queenx *.queeny angle .setaim store
stop

' set worker velocity
cond
*.type 0 =
*.robage 5 >
*.numties 0 =
*.vel 10 <
start
10 *.vel sub .up store
stop

' what if sated worker is blocked
' choose a new random direction and accelerate in it
cond
*.type 0 =
*.hfh 1 =
*.eye5 41 >
*.in2 *.queenid !=
start
1256 rnd .setaim store
2 .up store
stop

' worker avoids conspecs
cond
*.robage 10 >
*.type 0 =
*.hfh 0 =
*.in1 *.out1 =
start
1256 rnd .setaim store
stop

' worker searches for food
cond
*.type 0 =
*.hfh 0 =
*.in1 *.out1 !=
*.eye3 *.eye7 !=
*.eye5 30 <
start
*.eye3 *.eye7 sub .aimsx store
*.eye3 *.eye7 sub 4 div .sx store
stop

' worker searches for food
cond
*.type 0 =
*.hfh 0 =
*.in1 *.out1 !=
*.eye4 *.eye6 !=
*.eye5 30 <
start
*.eye4 *.eye6 sub 2 div .aimsx store
*.eye4 *.eye6 sub 8 div .sx store
stop

' worker shoots food
cond
*.type 0 =
*.hfh 0 =
*.eye5 40 >
*.in1 *.out1 !=
start
-1 .shoot store
stop

' worker reaches queen
cond
*.type 0 =
*.hfh 1 =
*.in2 *.queenid =
*.eye5 50 >
start
2 .hfh store
1 .fixpos store
stop

' worker feeds queen
cond
*.type 0 =
*.hfh 2 =
*.nrg 3500 >
*.in2 *.queenid store
start
mult mult
500 .shootval store
-2 .shoot store
stop

' worker stops feeding queen
cond
*.type 0 =
*.hfh 2 =
*.nrg 3001 <
start
0 .hfh store
stop

' worker (or warrior) unfixes his position after birth or feeding the queen
cond
*.type 2 !=
*.hfh 0 =
*.fixed 0 !=
start
0 .fixpos store
stop

' worker reaches queen's position to find her gone
cond
*.type 0 =
*.hfh 1 =
*.xpos *.queenx =
*.ypos *.queeny =
*.in2 *.queenid !=
start
' becomes new queen
1 .fixpos store
*.queenid .out2 store
3 .type store
stop

' get rid of waste. all types
cond
*.waste 100 >
start
100 .shootval store
-4 .shoot store
stop

end

54
Interesting behaviour bots / Ant Alpha (IB)(K0zm0)-21.08.04
« on: January 13, 2007, 10:53:38 AM »
'Topic: Interesting group behaviour  
'K0zm0

cond
*.robage 21 >
*972 0 =
*973 0 =
*.eye5 0 >
*.refeye 0 =
start
*.xpos 972 store
*.ypos 973 store

'Hrani se, ko si doma
cond
*.xpos *972 %=
*.ypos *973 %=
*.nrg 1000 <
*.eye5 25 >
*.refeye *.myeye !=
start
-1 .shoot store
stop

'Zbiraj vege in jih pripelji domov

cond
*80 6 =
start
1 .deltie store
0 80 store
stop

cond
*80 5 =
start
0 .tieval store
.fixpos .tieloc store
80 inc
stop

cond
*80 4 =
*.xpos *972 %=
start
80 inc
stop

cond
*80 4 =
*.xpos *972 !%=
start
15 *.vel sub 2 div .up store
stop

cond
*80 3 =
*.xpos *972 >
start
628 .setaim store
80 inc
stop

cond
*80 3 =
*.xpos *972 <
start
0 .setaim store
80 inc
stop


cond
*80 2 =
*.ypos *973 %=
start
80 inc
stop

cond
*80 2 =
*.ypos *973 !%=
start
15 *.vel sub 2 div .up store
stop

cond
*80 1 =
*.ypos *973 >
start
314 .setaim store
80 inc
stop

cond
1 *.multi =
start
628 .fixang store
stop

cond
*80 1 =
*.ypos *973 <
start
932 .setaim store
80 inc
stop

cond
*80 0 =
*.numties 0 >
start
.fixpos .tieloc store
0 .tieval store
80 inc
stop

cond
*80 0 =
*.eye5 30 >
*.refeye 0 =
start
1 .tienum store
1 .tie store
stop
end

55
Multi-Bots / Updated Gaesum (MB)(Shen)-13.08.04
« on: January 11, 2007, 08:13:12 AM »
Code: [Select]
'Topic: 3 cell bot
'Shen
' Updated Gaesum
' Improved repro genes
' Better tracking and navigation
'
'
'
' --==-- Reproduction loop --==--
'
' Using *50 for role assignment
' 0 will only rotate and try to repro its head
' 10 is the Head
' 20 is the Tail
' 100 is Temp Head
' 200 is Temp Tail
'
' - Unmake Slime -
cond
*.slime 0 >
*.numties 0 =
start
*.slime *.slime *.slime add sub .mkslime store
stop

' - Lone bots repro Heads and becomes Temp Tail -
cond
*.numties 0 =
*.eye5 30 <
*.nrg 500 >
*.vel 20 <
start
50 .repro store
200 50 store
stop

' - Child ties to parent and becomes Temp Head -
cond
*.robage 0 =
start
100 .tie store
100 50 store
stop

' - Temp Head aligns and becomes Head -
cond
*.multi 1 =
*50 100 =
start
100 .readtie store
100 .tienum store
628 .fixang store
200 .fixlen store
35 .stifftie store
10 50 store
stop

' - Temp Tail aligns and becomes Tail -
cond
*.multi 1 =
*50 200 =
start
100 .readtie store
100 .tienum store
628 .fixang store
20 50 store
stop

' - Rescue lost bots -
cond
*.numties 0 =
*.vel 2 <
*.robage 10 >
start
10 .aimdx store
stop

' - Detach multi headed bots -
cond
*.numties 1 >
' *.tiepres 100 =
start
*.tiepres .deltie store
200 50 store
stop

' - Start Repro Loop -
cond
*.multi 1 =
*.nrg 5000 >
*.eye5 20 <
*.body 400 >
start
100 .deltie store
stop


' --==-- Navigation --==--

' -=- Head Nav -=-

' - Approach Enemy -
cond
*.eye5 0 >
*.eye5 30 <
*.refeye *.myeye !=
*.vel 40 <
*.multi 1 =
*50 10 =
start
10 .up store
stop

' - Search -
cond
*.eye5 0 =
*.refeye *.myeye !=
*.eye3 *.eye 7 =
*.vel 30 <
*.multi 1 =
*50 10 =
start
10 .up store
30 rnd 30 rnd sub .aimdx store
stop

' --==-- Distant Tracking --==--

' - Wide -
cond
*.eye5 30 <
*.refeye *.myeye !=
*.eye7 *.eye3 !=
*.multi 1 =
*50 10 =
start
*.eye7 *.eye3 sub 2 mult .aimdx store
*.eye7 *.eye3 sub 2 div .dx store
stop

' - Narrow -
cond
*.eye5 30 <
*.refeye *.myeye !=
*.eye6 *.eye4 !=
*.multi 1 =
*50 10 =
start
*.eye6 *.eye4 sub 2 mult .aimdx store
*.eye6 *.eye4 sub 2 div .dx store
stop


' --==-- Close Tracking --==--

' - Wide -
cond
*.eye5 30 >
*.refeye *.myeye !=
*.eye7 *.eye3 !=
*.multi 1 =
*50 10 =
start
*.eye7 *.eye3 sub 3 div .aimdx store
*.eye7 *.eye3 sub 4 div .dx store
stop

' - Narrow -
cond
*.eye5 30 >
*.refeye *.myeye !=
*.eye6 *.eye4 !=
*.multi 1 =
*50 10 =
start
*.eye6 *.eye4 sub 3 div .aimdx store
*.eye6 *.eye4 sub 4 div .dx store
stop


' --==-- Conspecifics --==--

' - Avoid Close Friend -
cond
*.eye5 30 >
*.refeye *.myeye =
*.multi 1 =
*50 10 =
start
*.eye4 *.eye6 sub .aimdx store
*.eye4 *.eye6 sub 5 div .dx store
stop

' - Ignore Distant Friend -
cond
*.eye5 30 <
*.refeye *.myeye =
*.vel 30 <
*.multi 1 =
*50 10 =
start
10 .up store
30 rnd 30 rnd sub .aimdx store
stop


' -=- Tail Nav -=-

' - Narrow -
cond
*.eye5 30 >
*.eye6 *.eye4 !=
*.refeye *.myeye !=
*.multi 1 =
*50 20 =
start
*.eye6 *.eye4 sub .aimdx store
*.eye6 *.eye4 sub 4 div .dx store
stop

' - Wide -
cond
*.eye5 30 >
*.eye7 *.eye3 !=
*.refeye *.myeye !=
*.multi 1 =
*50 20 =
start
*.eye7 *.eye3 sub .aimdx store
*.eye7 *.eye3 sub 4 div .dx store
stop


' --==-- Defence --==--

' - Eat -
cond
*.eye5 29 >
*.refeye *.myeye !=
*.multi 1 =
start
-1 .shoot store
stop

' - Make shell -
cond
*.nrg 1000 >
*.shell 50 <
*.multi 1 =
start
10 .mkshell store
stop

' - Make slime -
cond
*.nrg 500 >
*.slime 190 <
*.multi 1 =
start
200 *.slime sub .mkslime store
stop


' --==-- Other Stuff --==--

' - Sharing -
cond
*.nrg *.trefnrg !%=
*.multi 1 =
start
50 .sharenrg store
50 .shareslime store
50 .shareshell store
stop

' - Make Body -
cond
*.nrg 4500 >
*.body 500 <
start
50 .strbody store
stop

' - Feed from Body -
cond
*.nrg 1000 <
*.body 10 >
start
100 .fdbody store
stop

' Waste disposal
cond
*.waste 400 >
start
-4 .shoot store
*.waste .shootval store
stop

end

56
Multi-Bots / Oranje bot (MB)(Henk)-24.07.04
« on: January 11, 2007, 08:12:37 AM »
Code: [Select]
' Topic: My attempt at a MultiBot 
'Henk

' Oranje_Bot
' attemp at a multibot
' by Henk

' tie 1 = A tie to a friend
' tie 2 = ATTACK

'Tie at birth
cond
*.robage 0 =
start
1 .tie store
1 .readtie store
123 .out1 store
stop

' set length
cond
*.numties 1 =
*.multi 1 =
*.trefage *.robage >
start
1 .tienum store
200 .fixlen store
stop

' move when untied
cond
*.numties 0 =
*.robage 2 >
start
*.maxvel *.vel sub .up store
stop

' follow when not tied
' **************************
cond
*.eye1 *.eye9 >
*.eye1 *.eye5 >
*.numties 0 =
start
-128 .aimdx store
4 .sx store
stop

cond
*.eye9 *.eye1 >
*.eye9 *.eye5 >
*.numties 0 =
start
128 .aimdx store
4 .dx store
stop

cond
*.eye4 *.eye6 >
*.eye4 *.eye5 >
*.numties 0 =
start
-26 .aimdx store
stop

cond
*.eye6 *.eye4 >
*.eye6 *.eye5 >
*.numties 0 =
start
26 .aimdx store
stop

cond
*.numties 0 >
start
628 .fixang store
stop

' follow when tied
' *********************
cond
*.eye1 *.eye9 >
*.eye1 *.eye5 >
*.numties 0 >
*.trefage *.robage <
start
500 .fixang store
-135 .aimdx store
-5 .dx store
stop

cond
*.eye9 *.eye1 >
*.eye9 *.eye5 >
*.numties 0 >
*.trefage *.robage <
start
756 .fixang store
135 .aimdx store
5 .dx store
stop

cond
*.eye4 *.eye6 >
*.eye4 *.eye5 >
*.numties 0 >
*.trefage *.robage <
start
1230 .fixang store
-35 .aimdx store
-1 .dx store
stop

cond
*.eye6 *.eye4 >
*.eye6 *.eye5 >
*.numties 0 >
*.trefage *.robage <
start
26 .fixang store
35 .aimdx store
1 .dx store
stop

' Share energy with partner
cond
*.numties 1 =
*.trefnrg *.nrg !%=
*.trefage *.robage <
*.trefnrg 7000 <
*.tiepres 2 !=
*.robage 50 >
start
50 .sharenrg store
stop

' Share slime with partner
cond
*.numties 1 =
*.trefnrg *.nrg !%=
*.trefage *.robage >
*.robage 50 >
start
50 .shareslime store
stop

' Share shell with partner
cond
*.numties 1 =
*.trefnrg *.nrg !%=
*.trefage *.robage <
*.robage 50 >
start
50 .shareshell store
stop

cond
*.numties 1 =
*.trefage *.robage <
*.shell 90 <
*.robage 50 >
start
100 *.shell sub .mkshell store
stop

cond
*.numties 1 =
*.trefage *.robage <
*.slime 90 <
*.robage 50 >
start
200 *.slime sub .mkslime store
stop

' repro for sole bot.
cond
*.nrg 8000 >
*.numties 0 =
start
50 .repro store
stop

' FORWARD killing
cond
*.numties 1 =
*.trefage *.robage <
*.robage 20 >
*.eye5 35 >
*.refeye *.myeye !=
start
-1 .shoot store
stop

' Killing for lonesome cowboys
cond
*.numties 0 =
*.in1 123 !=
*.eye5 35 >
*.robage 20 >
start
2 .tie store
stop

' aft killing
cond
*.in1 123 !=
*.eye5 35 >
*.trefage *.robage >
*.multi 1 =
*.robage 5 >
start
2 .tie store
stop

' eat through tie
cond
*.numties 0 >
*.tiepres 2 =
start
2 .tienum store
-1 .tieloc store
-1000 .tieval store
stop

cond
*.waste 0 >
*.eye5 30 >
*.refeye 0 =
*.robage 1 >
start
-4 .shoot store
1 .shootval store
stop

cond
*.waste 50 >
start
.backshot inc
-4 .shoot store
*.waste .shootval store
stop

' move as multibot
cond
*.numties 1 =
*.trefage *.robage <
*.robage 20 >
start
*.maxvel *.vel sub .up store
stop

' TIE ang reinitiation gene
cond
*.robage 1 =
start
*.robage 50 add 41 store
stop

cond
*.robage *41 >
*.robage 2 >
*.numties 0 >
start
628 .fixang store
*.robage 40 add 41 store
stop

' ************************
' reproduction for aft bot
cond
*.trefage *.robage >
*.nrg 8000 >
*.numties 1 =
*.robage 50 >
start
50 .repro store
' I dont wanna keep my child
2 55 store
stop

' restore cell 55 when alone
cond
*.numties 0 =
*55 0 !=
start
0 55 store
stop

' REMOVE SHELL WHEN NOT IN MULTIBOT
cond
*.shell 0 >
*.numties 0 =
start
0 *.shell sub .mkshell store
stop

' avoid friends when I'm tied
cond
*.eye5 0 >
*.in1 123 =
*.numties 1 =
*.trefage *.robage <
start
314 .aimdx store
stop

cond
*.eye5 0 >
*.in1 123 =
*.numties 0 =
start
314 .aimdx store
stop

cond
*.robage 4 =
*.numties 1 =
start
55 .tmemloc store
stop

cond
*.robage 5 =
*.numties 1 =
start
55 .tmemloc store
stop

cond
*.robage 6 =
*.numties 1 =
start
55 .tmemloc store
stop

cond
*.robage 6 =
*.numties 1 =
*.tmemval 2 =
start
1 .deltie store
stop

' reset trefage when untied
cond
*.numties 0 =
*.trefage 0 !=
start
0 .trefage store
stop

' Anti tie gene
' Evil anti-tie gene.
cond
*.tiepres 1 !=
*.tiepres 2 !=
*.numties 0 >
start
*.tiepres .tienum store
.tieval .tieloc store
1000 .tieval store
stop
end

57
Multi-Bots / Hexagonis1 (MB)(PY)-12.08.04
« on: January 11, 2007, 08:11:55 AM »
Code: [Select]
'Topic: 3 cell bot 
'PY
'hexagonis
'
' first robot stores value in 50 to identify itself
' then reproduces
cond
*.numties 0 =
*.robage 0 !=
*.eye5 10 <
*.nrg 100 >
start
3 50 store
80 .repro store
stop

' lone robot needs to move away from objects before breeding
cond
*.numties 0 =
*.robage 0 !=
*.eye5 10 >
start
-5 .up store
stop

' first robot rotates to face away from the circle
cond
*50 3 =
*.robage 10 >
start
419 .aimsx store
4 50 store
stop

cond
*.numties 1 =
*.robage 10 >
*.eye5 40 >
*50 1 !=
start
419 .aimsx store
stop

'dismantle a faulty structure
cond
*.robage 100 >
*.numties 1 =
*.multi 1 =
start
1 .deltie store
stop

' new baby ties to parent
cond
*.robage 0 =
start
1 .tie store
1 .readtie store
40 .stifftie store
stop

cond
*.robage 1 =
*50 1 !=
start
419 .aimsx store
stop

cond
*.robage 2 =
start
50 .memloc store
stop

' last robot ties to original parent.
cond
*.memval 4 =
*.eye5 30 >
*.numties 1 =
start
1 .tie store
stop

cond
*.robage 2 =
*.eye5 30 <
*50 0 =
*.memval 2 !=
start
80 .repro store
stop

cond
*.robage 2 >
*.robage 10 <
*.numties 2 =
*50 1 !=
start
415 .aimsx store
1 50 store
stop

' Use some body reserves to stay alive
cond
*.nrg 500 <
*.body 100 >
start
100 .fdbody store
stop

' Store body away in times of plenty
cond
*.nrg 5000 >
*.body 100 <
start
100 .strbody store
stop

' Store body away when even more stuffed with energy
cond
*.nrg 10000 >
*.body 1000 <
start
100 .strbody store
stop

cond
*.nrg *.trefnrg >
*.multi 1 =
*.robage 30 >
start
50 .sharenrg store
stop

'Reproduce to form new hexagonis
cond
*.nrg 15000 >
*.body 500 >
*50 2 =
*.numties 2 =
start
80 .repro store
stop

cond
*.robage 1 >
*.robage 10 <
*.memval 2 =
start
1 .deltie store
-10 .up store
0 50 store
stop


' set tie angles to zero
' set tie length too
cond
*.multi 1 =
*.robage 30 =
start
1 .tienum store
628 .fixang store
100 .fixlen store
50 inc
stop

cond
*.eye5 20 >
*.refaimsx *.myaimsx !=
*.refeye *.myeye !=
start
-1 .shoot store
stop

cond
*50 2 >
*.eye5 40 <
*.multi 1 =
*.robage 30 >
*.nrg 100 >
*.pain 0 >
start
8 .up store
stop

cond
*.multi 1 =
*.numties 2 =
*.nrg 1000 >
start
10 .mkslime store
stop

cond
*.multi 1 =
*.numties 2 =
*.eye4 *.eye6 !=
start
*.eye4 *.eye6 sub 10 div .tieang store
stop

end

58
Multi-Bots / Hexagonis (MB)(PY)-12.08.04
« on: January 11, 2007, 08:11:17 AM »
Code: [Select]
'Topic: 3 cell bot 
'PY
'Hexagonis
'
' first robot stores value in 50 to identify itself
' then reproduces
cond
*.numties 0 =
*.robage 0 !=
start
3 50 store
50 .repro store
stop

' first robot rotates to face away from the circle
cond
*50 3 =
*.robage 10 >
start
419 .aimsx store
4 50 store
stop

'cond
'*50 1 =
'*.numties 2 =
'start
'419 .aimsx store
'2 50 store
'stop

' new baby ties to parent
cond
*.robage 0 =
start
1 .tie store
1 .readtie store
40 .stifftie store
stop

cond
*.robage 1 =
*50 1 !=
start
419 .aimsx store
stop

cond
*.robage 2 =
start
50 .memloc store
stop

' last robot ties to original parent.
cond
*.memval 4 =
*.eye5 30 >
*.numties 1 =
start
1 .tie store
stop

cond
*.robage 2 =
*.eye5 30 <
*50 0 =
start
50 .repro store
stop

cond
*.robage 2 >
*.robage 10 <
*.numties 2 =
*50 1 !=
start
415 .aimsx store
1 50 store
stop

' Use some body reserves to stay alive
cond
*.nrg 500 <
*.body 100 >
start
100 .fdbody store
stop

' Store body away in times of plenty
cond
*.nrg 5000 >
*.body 100 <
start
100 .strbody store
stop

' Store body away when even more stuffed with energy
cond
*.nrg 10000 >
start
100 .strbody store
stop

cond
*.nrg *.trefnrg >
*.multi 1 =
*.robage 30 >
start
50 .sharenrg store
stop


' set tie angles to zero
' set tie length too
cond
*.multi 1 =
*.robage 30 =
start
1 .tienum store
628 .fixang store
100 .fixlen store
50 inc
stop

cond
*.multi 1 =
*.eye5 40 >
*.refaimsx *.myaimsx !=
*.refeye *.myeye !=
start
-1 .shoot store
stop

cond
*50 2 >
*.eye5 40 <
*.multi 1 =
*.robage 30 >
start
5 .up store
stop

end

59
F1 bots / Group minded bot (MB)(K0zm0)-08.10.04
« on: January 11, 2007, 08:10:47 AM »
'Topic: Ant bot
'K0zm0
'
'
Code: [Select]
cond
*.eye5 0 >
*.refeye *.myeye =
start
*.refaim .setaim store
stop

cond
*.eye5 0 >
*.refeye *.myeye !=
*.refeye 0 !=
start
*.refaim .setaim store
stop

cond
*.eye3 *.eye5 >
start
45 .aimsx store
stop

cond
*.eye7 *.eye5 >
start
45 .aimdx store
stop

cond
*.eye1 *.eye5 >
start
75 .aimsx store
stop

cond
*.eye9 *.eye5 >
start
75 .aimdx store
stop

cond
*.refeye *.myeye !=
*.eye5 34 >
start
-1 .shoot store
stop

cond
*.fixed 0 =
*.vel 15 <
start
1 .up store
stop

cond
*.eye5 35 >
*.fixed 0 =
start
1 .fixpos store
stop

cond
*.eye5 36 <
*.fixed 1 =
start
0 .fixpos store
stop

cond
*.nrg 6000 >
start
50 .repro store
stop
end

60
Interesting behaviour bots / Group Mind Bot (MB)(K0zxm0)-04.08.04
« on: January 11, 2007, 08:10:09 AM »
Code: [Select]
'Topic: Interesting group behaviour 
'Group Mind Bot
'Made by k0zm0
'made: 4.aug.2004
'changed :5.aug.2004
cond
*.robage 50 =
start
1256 rnd .aimsx store
999 rnd .out1 store
stop

cond
*.eye5 0 >
*.refeye *.myeye =
start
*.aim *.refaim sub .aimdx store
stop

cond
*.eye5 20 >
*.refeye 0 !=
*.refeye *.myeye !=
start
-1 .shoot store
stop

cond
*.in1 0 =
*.refeye 0 =
*.eye5 30 >
start
*.out1 .shootval store
.out1 .shoot store
stop

cond
*.refnrg 1000 >
*.in1 *.out1 =
*.refeye 0 =
*.eye5 30 >
start
-1 .shoot store
stop

cond
*.in1 0 !=
*.in1 *.out1 !=
*.refeye 0 =
*.eye5 30 >
start
-1 .shoot store
stop

cond
*.in1 *.out1 !=
*.refeye *.myeye =
*.eye5 30 >
start
*.out1 .shootval store
.out1 .shoot store
stop

cond
*.vel 10 <
start
10 *.vel sub 2 div .up store
stop

cond
*.nrg 6000 >
*.eye5 50 <
start
50 .repro store
stop
end

Pages: 1 2 3 [4] 5 6 ... 17