Author Topic: Why is my .eye9 behaving different?  (Read 2788 times)

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
Why is my .eye9 behaving different?
« on: October 26, 2008, 06:37:52 PM »
Ok do not know if any of you remember my Beholder eye system , when I recycled it for some new bot I was making I came upon an irregularity, you see this eyesytem stores 1 in 61-69 for
eye1 - eye9  if the eye belonging to the number has a friend in there, however if the bot is only in eye9 for some reason he does not do that(although he sees something trough that eye (cause I let them store previous eyevalues in 51-59 I know that). So whats up with that? I already looked into several places in the code and can not find any mistake.

Below the code

Code: [Select]
cond
*.robage 9 <
start
105 .eye1width *.robage 9 mod add store
stop

cond
true
start
 420 *.aim sub 1256 mod .eye1dir store
 315 *.aim sub 1256 mod .eye2dir store
 210 *.aim sub 1256 mod .eye3dir store
 105 *.aim sub 1256 mod .eye4dir store
   0 *.aim sub 1256 mod .eye5dir store
-105 *.aim sub 1256 mod .eye6dir store
-210 *.aim sub 1256 mod .eye7dir store
-315 *.aim sub 1256 mod .eye8dir store
-420 *.aim sub 1256 mod .eye9dir store
stop


'setting friend "1" or foe "0" status


cond
*.refeye *.myeye =
start
1 *.focuseye 5 add 9 mod 60 add store
stop

'eye1 specific

cond
*.eye1 *51 5 !~=
*.eye1 *52 5 ~=
*62 1 = and
*.eye1 *59 5 ~=
*69 1 = and or
start
1 61 store
stop

cond
*.eye1 *51 5 !~=
*.eye1 *52 5 !~=
*.eye1 *59 5 !~=
start
0 61 store
stop

cond
*.eye1 0 =
start
0 61 store
stop

'eye2 specific

cond
*.eye2 *52 5 !~=
*.eye2 *53 5 ~=
*63 1 = and
*.eye2 *51 5 ~=
*61 1 = and or
start
1 62 store
stop

cond
*.eye2 *52 5 !~=
*.eye2 *53 5 !~=
*.eye2 *51 5 !~=
start
0 62 store
stop

cond
*.eye2 0 =
start
0 62 store
stop


'eye3 specific

cond
*.eye3 *53 5 !~=
*.eye3 *54 5 ~=
*64 1 = and
*.eye3 *52 5 ~=
*62 1 = and or
start
1 63 store
stop

cond
*.eye3 *53 5 !~=
*.eye3 *54 5 !~=
*.eye3 *52 5 !~=
start
0 63 store
stop

cond
*.eye3 0 =
start
0 63 store
stop

'eye4 specific

cond
*.eye4 *54 5 !~=
*.eye4 *55 5 ~=
*65 1 = and
*.eye4 *53 5 ~=
*63 1 = and or
start
1 64 store
stop

cond
*.eye4 *54 5 !~=
*.eye4 *55 5 !~=
*.eye4 *53 5 !~=
start
0 64 store
stop

cond
*.eye4 0 =
start
0 64 store
stop



'eye5 specific

cond
*.eye5 *55 5 !~=
*.eye5 *56 5 ~=
*66 1 = and
*.eye5 *54 5 ~=
*64 1 = and or
start
1 65 store
stop

cond
*.eye5 *55 5 !~=
*.eye5 *56 5 !~=
*.eye5 *54 5 !~=
start
0 65 store
stop

cond
*.eye5 0 =
start
0 65 store
stop

'eye6 specific

cond
*.eye6 *56 5 !~=
*.eye6 *57 5 ~=
*67 1 = and
*.eye6 *55 5 ~=
*65 1 = and or
start
1 66 store
stop

cond
*.eye6 *56 5 !~=
*.eye6 *57 5 !~=
*.eye6 *55 5 !~=
start
0 66 store
stop

cond
*.eye6 0 =
start
0 66 store
stop

'eye7 specific

cond
*.eye7 *57 5 !~=
*.eye7 *58 5 ~=
*68 1 = and
*.eye7 *56 5 ~=
*66 1 = and or
start
1 67 store
stop

cond
*.eye7 *57 5 !~=
*.eye7 *58 5 !~=
*.eye7 *56 5 !~=
start
0 67 store
stop

cond
*.eye7 0 =
start
0 67 store
stop

'eye8 specific

cond
*.eye8 *58 5 !~=
*.eye8 *59 5 ~=
*69 1 = and
*.eye8 *57 5 ~=
*67 1 = and or
start
1 68 store
stop

cond
*.eye8 *58 5 !~=
*.eye8 *59 5 !~=
*.eye8 *57 5 !~=
start
0 68 store
stop

cond
*.eye8 0 =
start
0 68 store
stop

'eye9 specific

cond
*.eye9 *59 5 !~=
*.eye9 *51 5 ~=
*61 1 = and
*.eye9 *58 5 ~=
*68 1 = and or
start
1 69 store
stop

cond
*.eye9 *59 5 !~=
*.eye9 *51 5 !~=
*.eye9 *58 5 !~=
start
0 69 store
stop

cond
*.eye9 0 =
start
0 69 store
stop

'the focuseye is set

cond
*.drafted 7 !=
start
5 .focuseye *.eye1 sgn abs mult *61 1 sub abs mult store
6 .focuseye *.eye2 sgn abs mult *62 1 sub abs mult store
7 .focuseye *.eye3 sgn abs mult *63 1 sub abs mult store
8 .focuseye *.eye4 sgn abs mult *64 1 sub abs mult store
9 .focuseye *.eye5 sgn abs mult *65 1 sub abs mult store
1 .focuseye *.eye6 sgn abs mult *66 1 sub abs mult store
2 .focuseye *.eye7 sgn abs mult *67 1 sub abs mult store
3 .focuseye *.eye8 sgn abs mult *68 1 sub abs mult store
4 .focuseye *.eye9 sgn abs mult *69 1 sub abs mult store
stop

cond
*.drafted 7 =
*.robage 40 mod 39 = or
start
5 .focuseye *.eye1 sgn abs mult *61 mult store
6 .focuseye *.eye2 sgn abs mult *62 mult store
7 .focuseye *.eye3 sgn abs mult *63 mult store
8 .focuseye *.eye4 sgn abs mult *64 mult store
9 .focuseye *.eye5 sgn abs mult *65 mult store
1 .focuseye *.eye6 sgn abs mult *66 mult store
2 .focuseye *.eye7 sgn abs mult *67 mult store
3 .focuseye *.eye8 sgn abs mult *68 mult store
4 .focuseye *.eye9 sgn abs mult *69 mult store
stop

'the visual memory is stored

cond
start
*.eye1 51 store
*.eye2 52 store
*.eye3 53 store
*.eye4 54 store
*.eye5 55 store
*.eye6 56 store
*.eye7 57 store
*.eye8 58 store
*.eye9 59 store
stop

end

Found the solution myself: 1 *.focuseye 5 add 9 mod 60 add store   has to be 1 *.focuseye 4 add 9 mod 61 add store
« Last Edit: October 28, 2008, 12:06:12 PM by Welwordion »

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Why is my .eye9 behaving different?
« Reply #1 on: October 29, 2008, 12:42:31 PM »
Yeah 9 mod returns a value from 0-8 and focus eye goes from -4 to 4, so there was 2 errors in there
It works as intended in the gene setting eyewidth because you're starting at the location of eye1width.

Also not sure if this is intentional (I looks like it's intentional from the order they're in), but you're storing values from 1-9 into focuseye.... it should work I think, since values above 4 are regulated, so 5 is -1 and 6 is -2 asf... and I supose 9 is 0... or atleast I hope so, or you'd be missing out on eye5... (I don't know exactly how they modify values outside the correct range)
So I think it should work, but keeping track of eyes this way is a litle harder so I thought I should mention it...

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
Why is my .eye9 behaving different?
« Reply #2 on: October 29, 2008, 02:25:28 PM »
Nah do not worry its like you said values above 4 are regulated, you are right that back when I designed it some time ago I first did not know that focuseye used negative values but I found out later and decided to let it stay as it is, its less confusing for me as I also use a 1-9 notation for memory spaces.