Darwinbots Forum
Bots and Simulations => Bot Tavern => Topic started by: Testlund on August 23, 2012, 08:40:12 PM
-
I'm trying to figure out a good conspecies reference to get THIS bot:
start
*.refxpos 0 >
*.refxpos *.refypos angle .setaim store and
*.ref? *.my? !=
8 .shootval store
-6 .shoot store
stop
start
*.nrg 16000 >
10 .strbody store
stop
start
*.body 16000 >
50 .repro store
15 .aimdx store
stop
start
*.shflav -1 =
25 .up store
stop
start
*.shflav -6 =
25 .dn store
stop
start
*.shflav 0 !=
*.shflav -2 != and
0 .shflav store
*.aim *.shang sub .setaim store
*.maxvel .dn store
-4 .shoot store
*.waste .shootval store
stop
..to leave it's own conspecies alone but shoot at these two:
' Alga minimalis
'
' Vegetable
'
' This robot has a single gene,
' necessary for it to reproduce.
' Energy is given to it by the program,
' by checking the "autotroph" box.
cond
*.nrg
6000
>
start
50
.repro
store
15
.aimdx
store
stop
end
'Animal_Minimalis
'By: Nums
'Good for mutation sims and for
'newbies to see how a basic bot works.
'Contains everything necessary for it
'to survive and reproduce.
' Gene 1 Food Finder
cond
*.eye5 0 >
*.refeye *.myeye !=
start
*.refveldx .dx store
*.refvelup 30 add .up store
stop
' Gene 2 Eat Food
cond
*.eye5 50 >
*.refeye *.myeye !=
start
-1 .shoot store
*.refvelup .up store
stop
' Gene 3 Avoiding Family
cond
*.eye5 0 =
*.refeye *.myeye = or
start
314 rnd .aimdx store
stop
' Gene 4 Reproduce
cond
*.nrg 20000 >
start
10 .repro store
stop
end
I thought using aim as a reference was a good idea but that doesn't work. It turns out looking like this in the sim:
*.refaim *0 !=
*.myaim gets changed to 0.
I also tried to use a custom label but I couldn't get that to work either. It seems very limited what you can use as conspecies reference. Maybe I have to add an eye command to Alga Minimalis just so my bot can shoot at it.
-
Nevermind, I solved it! This works:
cond
*.refxpos 0 > and
*.refdn *.mydn !=
start
*.refxpos *.refypos angle .setaim store
8 .shootval store
-6 .shoot store
stop
cond
*.nrg 16000 >
start
10 .strbody store
stop
cond
*.body 16000 >
start
50 .repro store
32 .aimdx store
stop
start
*.shflav -1 =
32 rnd .up store
stop
start
*.shflav -6 =
32 rnd .dn store
stop
start
*.shflav 0 !=
*.shflav -2 != and
0 .shflav store
*.aim *.shang sub .setaim store
*.maxvel .dn store
-4 .shoot store
*.waste .shootval store
stop
Now the bot will shoot at any bot that touches it that either doesn't have any .dn commands or the wrong amount and is a different species.