Author Topic: Circle Feeder  (Read 2437 times)

Offline Prsn828

  • Bot Destroyer
  • ***
  • Posts: 139
    • View Profile
Circle Feeder
« on: May 13, 2009, 03:14:22 PM »
It doesn't do what I planned it to do, but it does work very well under harsh condition (ie. outnumbered 100 to 5)
Run it in leagues if you want, but it is definitely a good eco-sim bot, as it seems to avoid causing (complete) extinction of other species.
It is quite odd, using both sexual and asexual(only when endangered though) reproduction.
Also is a good example of using ties effectively(More so than the last bot) as well as some boolean logic.

Anyway, here is the code:
Code: [Select]
'CircleFeeder
'
'Will connect to two bots using ties
'
'Will not make a third tie to bots of its own species, but will tie to one bot of another species
'
'Uses sexrepro by attempting to link with bots of opposite gender




'Define
def friendlink1 222
def friendlink2 223
def foelink 304
def gender 403
def male 10
def female 11

'Tie opposite gender
cond
*.eye5 0 >
*.in1 *.gender sub abs 1 =
start
1 .up store
clearbool
*.gender .male =
dupbool
-10 .shootval store
-8 .shoot store
*.friendlink1 0 =
dupbool
dupbool
.friendlink1 .tie store
.friendlink1 inc
not
*.friendlink2 0 =
and
dupbool
.friendlink2 .tie store
.friendlink2 inc
stop





'check fertilized
cond
*.nrg 1000 >
*.body 200 >
*.fertilized 0 = not
start
50 .sexrepro store
stop



'Tie enemy
cond
*.eye5 0 >
*.in1 *.gender sub abs 1 >
*.tie 0 =
start
.foelink .tie store
stop


'prevent unwelcome ties
cond
*.tiepres .friendlink1 =
not
*.tiepres .friendlink2 =
not
*.tiepres .foelink =
not
start
*.tiepres .deltie store
stop


'adjust ties to rotate
cond
*.refeye 0 >
start
*.refxpos *.refypos angle .setaim store
stop

cond
*.refeye 0 =
start
10 .aimdx store
stop


'set gender
cond
*.gender 0 =
start
2 rnd 1 =
dupbool
.male .gender store

not
.female .gender store

stop


cond
*.nrg 2000 >
start
10 .strbody
stop

cond
*.nrg 1500 <
start
100 .fdbody store
stop

'feed
cond
start
.foelink .tienum store
-20 .tieval store
-1 .tieloc store
stop



'share
cond
start
99 .sharenrg store
01 .sharewaste store
99 .shareshell store
99 .shareslime store
stop


'tell gender
cond
*.out1 *.gender = not
start
*.gender .out1 store
stop


'If our population is too low, then allow nonsexrepro, but do a thorough prevention check
cond
*.totalmyspecies 10 <
*.robage 0 >
start
50 .repro store
stop
So, what will it be? Will you submit to my will, or must I bend reality to suit my needs?
Better answer before I do BOTH!