Author Topic: Eyes and reverse polish notation issue  (Read 612 times)

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
    • Games And Electronica
Eyes and reverse polish notation issue
« 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:

Code: [Select]
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

« Last Edit: September 12, 2014, 02:05:46 PM by Testlund »
"God is an ever receding pocket of scientific ignorence." - Neil DeGrasse Tyson

"God is a kid with an ant farm" - Constantine

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
    • Games And Electronica
Re: Eyes and reverse polish notation issue
« Reply #1 on: September 12, 2014, 02:11:23 PM »
..and vision distance is a lot less than the vision grid shows.
"God is an ever receding pocket of scientific ignorence." - Neil DeGrasse Tyson

"God is a kid with an ant farm" - Constantine

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
    • Games And Electronica
Re: Eyes and reverse polish notation issue
« Reply #2 on: September 12, 2014, 02:21:05 PM »
Edit: BAH!
« Last Edit: September 12, 2014, 02:23:35 PM by Testlund »
"God is an ever receding pocket of scientific ignorence." - Neil DeGrasse Tyson

"God is a kid with an ant farm" - Constantine

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
    • Games And Electronica
Re: Eyes and reverse polish notation issue
« Reply #3 on: September 12, 2014, 02:36:28 PM »
OK, so vision is getting better over here, but I'm not quite there yet.  :P

Code: [Select]
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
"God is an ever receding pocket of scientific ignorence." - Neil DeGrasse Tyson

"God is a kid with an ant farm" - Constantine

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
    • Games And Electronica
Re: Eyes and reverse polish notation issue
« Reply #4 on: September 12, 2014, 03:05:15 PM »
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.
"God is an ever receding pocket of scientific ignorence." - Neil DeGrasse Tyson

"God is a kid with an ant farm" - Constantine

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
    • Games And Electronica
Re: Eyes and reverse polish notation issue
« Reply #5 on: September 12, 2014, 03:24:21 PM »
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.

Code: [Select]
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].
« Last Edit: September 12, 2014, 03:26:03 PM by Testlund »
"God is an ever receding pocket of scientific ignorence." - Neil DeGrasse Tyson

"God is a kid with an ant farm" - Constantine