Author Topic: 360 degree, 9 eye vision, focuseye change plz check  (Read 3052 times)

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
360 degree, 9 eye vision, focuseye change plz check
« on: December 04, 2007, 02:32:54 PM »
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

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

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

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

Code: [Select]
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
« Last Edit: December 10, 2007, 11:47:43 AM by Welwordion »

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
360 degree, 9 eye vision, focuseye change plz check
« Reply #1 on: December 07, 2007, 04:51:09 AM »
Ok the eye systems seems finally to be working, however I still have some problems  with the movement sytem due to the fact I am not sure what value exactly angle returns  (angle between what?)

tried to write a movement gene like this which did not work correctly:

*.refxpos *.refypos angle dup dup 314 ceil swapint
314 floor 942 ceil 314 sub sub swapint
942 floor 942 sub add
.sx store

*.refxpos *.refypos angle dup 628 ceil -1 mult 314 add swapint
628 floor 628 sub add
.dn store
stop

If I get the movment working next I will try to build swarming behaviour into them.
« Last Edit: December 07, 2007, 11:31:10 AM by Welwordion »

Offline rsucoop

  • Bot Destroyer
  • ***
  • Posts: 166
    • View Profile
360 degree, 9 eye vision, focuseye change plz check
« Reply #2 on: February 09, 2008, 11:36:37 PM »
Quote from: Welwordion
Ok the eye systems seems finally to be working, however I still have some problems  with the movement sytem due to the fact I am not sure what value exactly angle returns  (angle between what?)

tried to write a movement gene like this which did not work correctly:

*.refxpos *.refypos angle dup dup 314 ceil swapint
314 floor 942 ceil 314 sub sub swapint
942 floor 942 sub add
.sx store

*.refxpos *.refypos angle dup 628 ceil -1 mult 314 add swapint
628 floor 628 sub add
.dn store
stop

If I get the movment working next I will try to build swarming behaviour into them.

Dude, nice genes. I was able to simply replace my crappy and defective eye system for Slim Evo 2 and the movement genes worked like a charm.