Ok like the topic says the following are genes fora 360 degree vision seperated into 9 eyes I tried to build a
system that only changes the focuseye if a new possible hostile signal appears in one of its eyes, ignoring signals that are already friendly plz check if everything is correct:
nothing wild only the vision field:
'initializing eye configuration
cond
*.robage 0 =
start
420 .eye1dir store
315 .eye2dir store
210 .eye3dir store
105 .eye4dir store
-105 .eye6dir store
-210 .eye7dir store
-315 .eye8dir store
-420 .eye9dir store
105 .eye1width store
105 .eye2width store
105 .eye3width store
105 .eye4width store
105 .eye5width store
105 .eye6width store
105 .eye7width store
105 .eye8width store
105 .eye9width store
stop
Now this is a little more complicated, 51-59 are used to store the previous sensations of the *.eyeX's
61-69 store 1 for friend and 0 for enemy or unknown:
'setting friend "1" or foe "0" status
'if I see my own kind mark the current eye as friend
cond
*.refeye *.myeye =
start
1 *.eyef 60 add store
stop
'eye1 specific
'if there is a change larger than 5% but the signal fits within 5% to a friendly neighboor signal(comes from 'the side) this eye field becomes marked as friendly.
cond
*.eye1 *51 5 !~=
*.eye1 *52 5 ~=
*62 1 = and
*.eye1 *59 5 ~=
*69 1 = and or
start
1 61 store
stop
'if there is a change larger than 5% and the signal comes not from the neighboorhood this field gets
'marked as hostile or unknown
cond
*.eye1 *51 5 !~=
*.eye1 *52 5 !~=
*.eye1 *59 5 !~=
start
0 61 store
stop
'if an eye is empty its marked as hostile or unknown
cond
*.eye1 0 =
start
0 61 store
stop
.... and so on for all 9 eyes
The .focuseye is set to a non empty hostile eyefield:
cond
start
1 .focuseye *.eye1 sgn abs mult *61 1 sub abs mult store
2 .focuseye *.eye2 sgn abs mult *62 1 sub abs mult store
3 .focuseye *.eye3 sgn abs mult *63 1 sub abs mult store
4 .focuseye *.eye4 sgn abs mult *64 1 sub abs mult store
5 .focuseye *.eye5 sgn abs mult *65 1 sub abs mult store
6 .focuseye *.eye6 sgn abs mult *66 1 sub abs mult store
7 .focuseye *.eye7 sgn abs mult *67 1 sub abs mult store
8 .focuseye *.eye8 sgn abs mult *68 1 sub abs mult store
9 .focuseye *.eye9 sgn abs mult *69 1 sub abs mult store
stop
the new eye values are saved:
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
attached is a test version with simple aimshoot and fire every 20 cycle genes