Darwinbots Forum
Bots and Simulations => DNA - General => Topic started by: Testlund on September 12, 2014, 02:00:46 PM
-
I can't get this bot to turn towards food that appears to the right or left of it. It moves forward and shoots instead. Also the reverse polish notation here don't seems to work as expected. Check the dna in DB how the "OR" command is placed between the eye commands. :banghead:
start
250 .eye3dir store
75 .eye4dir store
-75 .eye6dir store
-250 .eye7dir store
stop
start
250 .eye3width store
100 .eye4width store
45 .eye5width store
100 .eye6width store
250 .eye7width store
stop
cond
*.eye3 0 >
*.eye4 0 > or
*.eye5 0 > or
*.eye6 0 > or
*.eye7 0 > or
*.reftype 1 !=
*.refeye *.myeye <
start
*.refxpos *.refypos angle .setaim store
*.refveldx .dx store
*.refvelup 32 add .up store
-6 .shoot store
stop
-
..and vision distance is a lot less than the vision grid shows.
-
Edit: BAH!
-
OK, so vision is getting better over here, but I'm not quite there yet. :P
start
250 .eye3dir store
75 .eye4dir store
-75 .eye6dir store
-250 .eye7dir store
stop
start
250 .eye3width store
100 .eye4width store
45 .eye5width store
100 .eye6width store
250 .eye7width store
stop
cond
*.robage 0 =
start
628 .aimdx store
stop
'Sweep the eyes
cond
*.robage 2 mod 0 =
start
-6 .focuseye store
stop
cond
*.robage 2 mod 1 =
start
6 .focuseye store
stop
cond
*.eyef 0 >
*.reftype 1 !=
*.refeye *.myeye <
start
*.refxpos *.refypos angle .setaim store
*.refveldx .dx store
*.refvelup 32 add .up store
-6 .shoot store
stop
-
I can't seem to focus more eyes than two at a time. I want it to focus all the eyes that I have adjusted width and direction for.
-
Ha! I finally got it right! I just had to keep changing the numbers, but the pattern doesn't seem logical to me. I expected the number marked with red to be 6.
start
250 .eye3dir store
75 .eye4dir store
-75 .eye6dir store
-250 .eye7dir store
stop
start
250 .eye3width store
100 .eye4width store
45 .eye5width store
100 .eye6width store
250 .eye7width store
stop
Sweep the eyes
cond
*.robage 2
start
0 .focuseye store
stop
cond
*.robage 4 mod 0 =
start
-1 .focuseye store
stop
cond
*.robage 4 mod 1 =
start
1 .focuseye store
stop
cond
*.robage 6 mod 0 =
start
-6 .focuseye store
stop
cond
*.robage 6 mod 1 =
start
[color=red]2[/color] .focuseye store
stop
cond
*.eyef 0 >
*.reftype 1 !=
*.refeye *.myeye <
start
*.refxpos *.refypos angle .setaim store
*.refveldx .dx store
*.refvelup 32 add .up store
-6 .shoot store
stop
Actually colors don't work in code format, but you see where it says [color].