Author Topic: non-working conspec for advancedish sight system  (Read 4812 times)

Offline ashton15

  • Bot Builder
  • **
  • Posts: 99
    • View Profile
non-working conspec for advancedish sight system
« on: March 14, 2010, 12:44:04 PM »
It's roughly a combination of Bubble, Occulus 2 and Beholder though the conspec doesn't quite work though as it turns to friendlies as well, any ideas?  

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']'''''''''''''''''''''''''''''
''''----____SIGHT____----''''


''''---- Genes 1-1 ----''''

''''----Setup Eye Positions And Sizes----''''
cond
*.robage 0 =
start
  342 .eye1dir store
  152 .eye2dir store
  62 .eye3dir store
  20 .eye4dir store
 -20 .eye6dir store
 -62 .eye7dir store
 -152 .eye8dir store
 -342 .eye9dir store

 260 .eye1width store
 120 .eye2width store
 60 .eye3width store
 25 .eye4width store
 15 .eye5width store
 25 .eye6width store
 60 .eye7width store
 120 .eye8width store
 260 .eye9width store
stop

''''---- Genes 2-2 ----''''

''''----When Finished Looking Reset Sight To Centre Of Vision----''''
cond
 *.focuseye 0 !=
start
 0 .focuseye store
stop

''''---- Genes 3-10 ----''''

''''----Look At Whatever Is Closest To Centre Of Vision----''''
cond
 *.eye5 0 =
 *.eye4 0 !=
 *.eye4 *.eye1 >=
 *.eye4 *.eye2 >=
 *.eye4 *.eye3 >=
 *.eye4 *.eye6 >=
 *.eye4 *.eye7 >=
 *.eye4 *.eye8 >=
 *.eye4 *.eye9 >=
start
 -1 .focuseye store
stop

cond
 *.eye5 0 =
 *.eye6 0 !=
 *.eye6 *.eye1 >
 *.eye6 *.eye2 >=
 *.eye6 *.eye3 >=
 *.eye6 *.eye4 >=
 *.eye6 *.eye7 >=
 *.eye6 *.eye8 >=
 *.eye6 *.eye9 >=
start
 1 .focuseye store
stop

cond
 *.eye5 0 =
 *.eye3 0 !=
 *.eye3 *.eye1 >
 *.eye3 *.eye2 >
 *.eye3 *.eye4 >=
 *.eye3 *.eye6 >=
 *.eye3 *.eye7 >=
 *.eye3 *.eye8 >=
 *.eye3 *.eye9 >=
start
 -2 .focuseye store
stop

cond
 *.eye5 0 =
 *.eye7 0 !=
 *.eye7 *.eye1 >
 *.eye7 *.eye2 >
 *.eye7 *.eye3 >
 *.eye7 *.eye4 >=
 *.eye7 *.eye6 >=
 *.eye7 *.eye8 >=
 *.eye7 *.eye9 >=
start
 2 .focuseye store
stop

cond
 *.eye5 0 =
 *.eye2 0 !=
 *.eye2 *.eye1 >
 *.eye2 *.eye3 >
 *.eye2 *.eye4 >
 *.eye2 *.eye6 >
 *.eye2 *.eye7 >=
 *.eye2 *.eye8 >=
 *.eye2 *.eye9 >=
start
 -3 .focuseye store
stop

cond
 *.eye5 0 =
 *.eye8 0 !=
 *.eye8 *.eye1 >
 *.eye8 *.eye2 >
 *.eye8 *.eye3 >
 *.eye8 *.eye4 >
 *.eye8 *.eye6 >
 *.eye8 *.eye7 >=
 *.eye8 *.eye9 >=
start
 3 .focuseye store
stop

cond
 *.eye5 0 =
 *.eye1 0 !=
 *.eye1 *.eye2 >
 *.eye1 *.eye3 >
 *.eye1 *.eye4 >
 *.eye1 *.eye6 >
 *.eye1 *.eye7 >
 *.eye1 *.eye8 >
 *.eye1 *.eye9 >=
start
 -4 .focuseye store
stop

cond
 *.eye5 0 =
 *.eye9 0 !=
 *.eye9 *.eye1 >
 *.eye9 *.eye2 >
 *.eye9 *.eye3 >
 *.eye9 *.eye4 >
 *.eye9 *.eye6 >
 *.eye9 *.eye7 >
 *.eye9 *.eye8 >
start
 4 .focuseye store
stop

'''''''''''''''''''''''''''''''
''''----____TURNING____----''''


''''---- Genes 11-18 ----''''

''''----Turn To Something You Are Looking At If It Is Not The Same Species As You----''''
cond
 *.focuseye -1 =
 *.refeye *.myeye !=
start
 *.aim 20 add .setaim store
stop

cond
 *.focuseye 1 =
 *.refeye *.myeye !=
start
 *.aim -20 add .setaim store
stop

cond
 *.focuseye -2 =
 *.refeye *.myeye !=
start
 *.aim 62 add .setaim store
stop

cond
 *.focuseye 2 =
 *.refeye *.myeye !=
start
 *.aim -62 add .setaim store
stop

cond
 *.focuseye -3 =
 *.refeye *.myeye !=
start
 *.aim 152 add .setaim store
stop

cond
 *.focuseye 3 =
 *.refeye *.myeye !=
start
 *.aim -152 add .setaim store
stop

cond
 *.focuseye -4 =
 *.refeye *.myeye !=
start
 *.aim 342 add .setaim store
stop

cond
 *.focuseye 4 =
 *.refeye *.myeye !=
start
 *.aim -342 add .setaim store
stop
« Last Edit: March 14, 2010, 12:44:54 PM by ashton15 »

Offline ashton15

  • Bot Builder
  • **
  • Posts: 99
    • View Profile
non-working conspec for advancedish sight system
« Reply #1 on: March 14, 2010, 03:37:34 PM »
Ah!  I worked it out, it seems to be because of the order of actions, my solution was to do a little something with the timer and, hey presto. Anyone who manages to make it work can use the code in thier bot as a prize.  

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
non-working conspec for advancedish sight system
« Reply #2 on: March 15, 2010, 12:52:45 AM »
Personally, I'd avoid using built-in conspecs. Instead, use this:

cond
 *.robage 0 =
start
 X .out1 store    (X is any value other than zero)
stop

Two cells are conspecs if *.in1 *.out1 =

it's quite simple, really. put any value into your output (.in1 through to .in10), then compare your value to your output (.out1 to .out10, depending on where your output is). A similar method can be used with ties (.tinX/.outX). It's also more chameleon-proof, as you can set multiple conspecs, and also get one to generate a random number, then check if they don't match - you can generate a range from -32000 to 32000, so the probability of matching is one in 64000.

FINAL THOUGHT --> Always use *.refeye 0 != to make sure you're not staring into space.
« Last Edit: March 15, 2010, 12:53:06 AM by bacillus »
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline ashton15

  • Bot Builder
  • **
  • Posts: 99
    • View Profile
non-working conspec for advancedish sight system
« Reply #3 on: March 15, 2010, 01:00:44 PM »
Quote from: bacillus
Personally, I'd avoid using built-in conspecs. Instead, use this:

cond
 *.robage 0 =
start
 X .out1 store    (X is any value other than zero)
stop

Two cells are conspecs if *.in1 *.out1 =

it's quite simple, really. put any value into your output (.in1 through to .in10), then compare your value to your output (.out1 to .out10, depending on where your output is). A similar method can be used with ties (.tinX/.outX). It's also more chameleon-proof, as you can set multiple conspecs, and also get one to generate a random number, then check if they don't match - you can generate a range from -32000 to 32000, so the probability of matching is one in 64000.

FINAL THOUGHT --> Always use *.refeye 0 != to make sure you're not staring into space.

I was going to do this in combination with memloc/memval though I checked the wiki and it says that .focuseye only works for refvars; as I normally need to conspec things not nescisarilly in front of me and so I figured using *.refeye *.myeye != would be better...  

If I could do it though it would work well  
« Last Edit: March 15, 2010, 01:01:42 PM by ashton15 »

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
non-working conspec for advancedish sight system
« Reply #4 on: March 15, 2010, 02:30:59 PM »
The refeye reads everything concerning the other bot...
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline ashton15

  • Bot Builder
  • **
  • Posts: 99
    • View Profile
non-working conspec for advancedish sight system
« Reply #5 on: March 15, 2010, 03:19:41 PM »
What about it?

Offline Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
non-working conspec for advancedish sight system
« Reply #6 on: March 15, 2010, 03:28:51 PM »
Im confused   (again)
So you can change the focus eye, but if you do you can't do memloc/memval. That sucks.

Offline ashton15

  • Bot Builder
  • **
  • Posts: 99
    • View Profile
non-working conspec for advancedish sight system
« Reply #7 on: March 15, 2010, 03:41:07 PM »
Quote from: Houshalter
Im confused   (again)
So you can change the focus eye, but if you do you can't do memloc/memval. That sucks.

Pretty much, same for out and in and everything that uses eye5 apart from ref vars according to the wiki
« Last Edit: March 15, 2010, 03:41:25 PM by ashton15 »

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
non-working conspec for advancedish sight system
« Reply #8 on: March 16, 2010, 02:35:42 PM »
That I did not know...
...on the other hand, what's the last time I used memlocs?
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan