cond
0 .eyefocus store
*.refeye *.myeye !=
*.eye5 6 >
start
*.refxpos *.refypos angle .setaim store
*.refxpos *.refypos angle *.refaim *.refvel mult 40 *.refxpos *.xpos sub 2 pow *.refypos *.ypos sub 2 pow add sqr div mult 60 *.focuseye mult mult .aimdx store
*.refxpos *.refypos angle `(*.refaim *.aim sub abs mult) .aimshot store
-8 .shootval store
*.refshell sgn -1 add 5 mult -1 add .shoot store
*.refvelup .up store
stop
You have a few problems in this gene from what I can tell :
- You have a store in the part of your gene that handles conditions. (0 .eyefocus store)
Also .focuseye is 0 to begin with, and since you don't store anything else in there then theres no point in storing a 0.
- You set your aim using .setaim, then you change .aimdx on the next line using some combination of the oponents aim and the distance and your focus eye...
It seems to me the second line isn't doing anything usefull, the first line setting .setaim is all you realy need to aim at an enemy, if the enemy is moving you will get the x and y pos of the next turn, so it will be easy to track using just the first line.
- You're using a negative shootval while using -1 and -6 shots. I'm not realy sure what happens from this, but I would sugest using a positive boost value for your -1 and -6 shots...
-.aimshot is spelled .aimshoot, but again theres no point in aiming towards your oponent and then turn away your canon to face the other way, so I would cut that line too.
Also I feel I should comment on a couple of things :
If eye5 is larger than 0 then there's something there, to check that it's larger than 6 seems a litle odd, since a value above 6 doesn't realy mean you're much closer than above 0...
You're tracking the oponents .up movement, but no sideways movement, it would be more effective if you also had a line to follow .dx or .sx movement.
And when you follow the oponents .up value you won't get any closer, so you may want to go faster untill you're within range of shooting...
So basicaly if I had to "refactor" that gene I would go for something along this :
cond
*.refeye *.myeye !=
*.eye5 0 >
start
*.refxpos *.refypos angle .setaim store
8 .shootval store
*.refshell sgn -1 add 5 mult -1 add .shoot store
*.refvelup 0 floor 10 add .up store
*.refveldx .dx store
*.eye5 30 >
*.refvelup .up store
stop