Darwinbots Forum
Welcome To Darwinbots => Newbie => Topic started by: Mozgic on April 26, 2006, 05:15:28 PM
-
I'm stuck with most basic function of all. The Eye function.
1. Am I right: If *.eye5 is less that 50 that means that center of my bot is less than 50 points distanced from center of other bot. Right?
2. Here is my question. When alga minimalis haves more energy it is bigger. So, my bot finds alga and it tryes to take energy. The condition is:
cond
*.eye5 50 <
start
-1 .shoot store
stop
But alga growes, and when alga and my bot are in touch, their distance is more than 50, so my bot tryes to go forward., adn it doesn't take energy.
It goes like this... . But wall is alga minimalis.
Here is my stupid bot:
'search
'------
cond
*.eye1
0
=
*.eye2
0
=
*.eye3
0
=
*.eye4
0
=
*.eye6
0
=
*.eye7
0
=
*.eye9
0
=
*.eye5
0
=
start
70
.up
store
100
.aimdx
store
70
.up
store
100
.aimsx
store
stop
'aim
'---
cond
*.eye1
0
!=
start
15
.aimsx
store
stop
cond
*.eye2
0
!=
start
15
.aimsx
store
stop
cond
*.eye3
0
!=
start
15
.aimsx
store
stop
cond
*.eye4
0
!=
start
15
.aimsx
store
stop
cond
*.eye6
0
!=
start
15
.aimdx
store
stop
cond
*.eye7
0
!=
start
15
.aimdx
store
stop
cond
*.eye8
0
!=
start
15
.aimdx
store
stop
cond
*.eye9
0
!=
start
15
.aimdx
store
stop
'hunt & kill
'-----------
cond
*.eye5
0
>
start
*.refveldx .dx store
*.refvelup 30 add .up store
stop
cond
*.refeye *.myeye !=
*.eye5
49
>
start
*.refvelup .up store
stop
cond
*.refeye *.myeye !=
*.eye5
0
>
*.nrg
500
>
*.refshoot 0 !=
start
-1 .shoot store
stop
'reproduce
'---------
cond
*.nrg 5000 >
start
50 .repro store
stop
end
-
No, the closer something is to you, the greater the number in *.eye5 will be
If *.eye5 is greater than 30, then the foe is in range
If *.eye5 is greater than 50, then you are nearly cretain to hit them
cond
*.eye5 50 >
start
-1 .shoot store
stop
^ This gene will shoot if something comes in range (it will also shoot conspecs so watch out!)
cond
*.eye5 50 >
*.refeye *.myeye !=
start
-1 .shoot store
stop
^ With added conspec recognition
-
The whole eye distance thing is weird, to be perfectly honest.
It's something like:
RobSize (Robsize is 120) * 100 / distance
-
FYI, this is changing some in 2.42.3
eyevalue = RobSize * 100 / (RobSize - rob(n1).radius - rob(N2).radius + 1 / invdist)
If eyevalue > 32000 Then eyevalue = 32000
-
The point of the above fix was to make it so bots that are huge don't go sumo trying to eat each other.