1
Newbie / Enemy Recognition.
« on: May 04, 2010, 07:37:49 PM »
So I've been fiddling around with a bit of code for a while, as I mentioned in my greeting message, so my bot uses more of its eyes to find food instead of spinning and moving around randomly.
So my bot's eyes are set up like so:
Eyes 3 and 9 aren't doing anything right now, but I'm considering doing something with them later.
Eyes 1 and 9 are moved further apart slightly to give a wider field of view.
I've set it up so that if it sees something in eye 1 or eye 2 (or indeed eyes 8 or 9), but not in eye 5 it'll turn to face it.
However no matter what I try, I can't make the bot not turn to face a member of its own species and as a result they'll often end up going around in circles with each other and getting eaten.
Here's an example of what I've been trying:
Does the condition *.refeye *.myeye != only work if it's referring to a robot in view of eye5?
I've been scratching my head and not getting very far because of this problem, can anyone hint as to what may be wrong?
Thanks.
So my bot's eyes are set up like so:
Code: [Select]
cond
start
628 .eye3dir store
90 .eye1dir store
-628 .eye7dir store
-90 .eye9dir store
stop
Eyes 3 and 9 aren't doing anything right now, but I'm considering doing something with them later.
Eyes 1 and 9 are moved further apart slightly to give a wider field of view.
I've set it up so that if it sees something in eye 1 or eye 2 (or indeed eyes 8 or 9), but not in eye 5 it'll turn to face it.
However no matter what I try, I can't make the bot not turn to face a member of its own species and as a result they'll often end up going around in circles with each other and getting eaten.
Here's an example of what I've been trying:
Code: [Select]
cond
*.refeye *.myeye !=
*.eye5 0 =
*.eye1 0 >
*.eye2 0 > or
start
100 .aimsx store
stop
Does the condition *.refeye *.myeye != only work if it's referring to a robot in view of eye5?
I've been scratching my head and not getting very far because of this problem, can anyone hint as to what may be wrong?
Thanks.