It's a litle hard to see exactly how it works since you didn't post the eye widths and directions.
But it looks like it's just a priority list where certain eyes are more important than others.
And it sounds like a good idea to find a more clever priority since it can be realy hard to determine which eye is more important.
Distance can ofcourse be a factor (Check out excalibur, it actualy turns towards the closest in sight with just 4 simple genes.)
But IMO distance is not enough, just because something is closer it doesn't always mean it's more important. Often the closest bots will be friendlies and it will distract your bot from incoming enemies.
Also you need to secure against endless loops where you keep switching between 2 friendlies...
I know movement prevents most kind of loops, but it's still anoying when your bot is spending too much time looking at it's own.
In Pacifist I used a very simple gene to switch the eyes, and oddly enough none of the more clever methods I tryed could beat it. It just seems like constantly switching the eyefocus was more effective than trying to pick "the right eye".
I even tryed something involving timestampt for eyes getting checked and prioriti lists that would make sure everything in sight got checked... and it worked fine, but had no noticable diference compared to just switching every cycle.
Used this gene :
cond
*.eyef 0 =
*.refshoot *.myshoot = or 'or whatever your conspec is
start
*.robage 9 mod 4 sub .focuseye store
stop
And believe I know how this looks, but as people keep saying, KISS (Keep It Simple Stupid).
It works, better than most systems I made, and aswell as the best one I could make at the time.
And it can beraly get any simpler.
In case someone is confused about the mod operator (Noticed noone ever uses it), it's realy simple, there is nothing advanced about mod (modulus).
*.robage 9 mod : The simples way I can explain this is that it will substract 9 as many times as possible without turning negative. So 18 9 mod would return 0, 20 9 mod would return 2, and so forth.
I have however finaly managed to get a better eye system to work, it worked well enough t build an entire bot from the way the eyes worked. It's the fastest way I've found to spot enemies so far, not perfect but the code I made is designed to be easy to tweek and adjust so people can find the perfect combination.
It basicaly moves all the eyes to one side and uses eye9 as focuseye, it allows you to choose a width and spread for the eyes, and the it simply jumps to the next eye that isn't empty if theres no enemy in eye9.
Again this sounds very simple, because it is, but it works realy well, and much better than what I was trying with distance.
The thing is it doesn't realy matter how far away something is, what matters is to find out what everything around you is as fast as possible, so you can engage first.
The new eye system is the one used in Spinner. I'd recomend trying it out and see if you get inspired.
The first version of spinner has the eyes and not much else (And actualy does rather well dispite the short and simple code in it). The newer version do more stuff... I'm not sure if v1.2 is actualy better than v1.1... I think I'll tweek v1.2 this weekend, I think the reason v1.2 sometimes has problems is some bad tweeks in it's new functions. (v1.2 has a nice conspec and is generaly easy to change and tweek)
Either way I recomend taking a look at Spinner and maybe playing around with the constants, you can change the whole setup for the eyes by changing one or two values, the setup used is faily rough and can easily miss something, the point of the initial setup was to be the first to reach the alge, but I'm considering changing the eyes along the way as the situation changes...