Darwinbots Forum
Welcome To Darwinbots => Newbie => Topic started by: Tj3 on March 12, 2010, 10:22:54 PM
-
Hi.... I just got darwinbots and it's great. I just made my first bot. Its just a basic bot, but it is actually pretty good. Here's the code. If you could help me make it better that would be great!
'Animal_Simpilisis
'A basic but powerful animal bot.
'It will find food and reproduce.
def speciesid 101
' Gene 1 Species ID
cond
*.robage 0 =
start
99 .speciesid store
.speciesid .memloc store
stop
' Gene 2 Follow food
cond
*.eye5 0 >
*.memval *.speciesid !=
start
*.refveldx .dx store
*.refvelup 30 add .up store
stop
' Gene 3 Find food
cond
*.eye5 0 =
*.memval *.speciesid =
or
start
157 314 rnd sub .aimdx store
10 .up store
stop
' Gene 4 Eat food
cond
*.eye5 50 >
*.memval *.speciesid !=
start
-1 .shoot store
*.refvelup .up store
stop
' Gene 5 Eliminate waste
cond
*.waste 100 >
start
1 .backshot store
-4 .shoot store
*.waste .shootval store
stop
' Gene 6 Reproduction
cond
*.nrg 20000 >
*.eye5 50 <
start
25 .mrepro store
stop
end
-
hey
just wondering why you're using mrepro for reproduction? The chances are that you'll just get broken bots instead of useful mutations.
Personally what I would do is:
cond
*.totalmyspecies 99 >
*.nrg 5000 >
start
25 .mrepro store
stop
cond
*.nrg 5000 >
*.totalmyspecies 100 <
start
25 .repro store
stop
-
try this:
cond
nrg 200 <
*.robage 200 >
start
99 .mrepro store
stop
And this makes your bot poisoness:
cond
*.ploc .shoot !=
start
.shoot .ploc store
stop
cond
*.poison 100 <
*.nrg 1000 >
start
100 .strpoison store
stop
Hope it works
-
Thanks! The poison worked great, and gave it a huge advantage.
And the idea to only mrepro with over 100 population was a really smart idea! Im really glad the community is so helpful here.
-
It looks cool. Pity I haven't got a version of DB on me to test it