Bots and Simulations > DNA - General
Eye template
Testlund:
--- Quote from: Shadowgod2 on September 13, 2014, 10:13:37 PM ---it doesn't seem to be storing anything in .robagemult though
--- End quote ---
So it seems. Your example doesn't work beyond 32000 cycles either.
Testlund:
OK, I think this is good enough. The rotating eyes will stop after 32000 cycles but the eye sweeping will continue.
--- Code: ---'============
'EYE TEMPLATE
'============
'
'.eye1 through 9 are located clockwise in numerical order.
'
'Positive numbers are anti-clockwise and negative numbers are clockwise.
'
'Default positions of the eyes are:
'
'.eye1 = 140
'.eye2 = 105
'.eye3 = 70
'.eye4 = 35
'.eye5 = 0
'.eye6 = -35
'.eye7 = -70
'.eye8 = -105
'.eye9 = -140
'
'Eye width:
'
'Smallest = -34
'Default = 0
'Widest = 1221
'
'Below is an example of eye settings.
'
'=====================
'Maximum surveillance:
'
def robagemult 50
def robage1 51
start
50 .eye5width store
240 .eye4width store
240 .eye6width store
277 .eye1width store
277 .eye9width store
-20 .eye3width store
-20 .eye2width store
-20 .eye7width store
-20 .eye8width store
stop
start
145 .eye4dir store
-145 .eye6dir store
333 .eye1dir store
-333 .eye9dir store
stop
start
*.robage .eye3dir store
stop
start
*.robage sub .eye2dir store
stop
start
*.robage .eye7dir store
stop
start
*.robage sub .eye8dir store
stop
'The next four genes makes it possible to sweep the eyes beyond 32000 cycles.
start
*.robage 9 mod 4 sub .focuseye store
stop
start
*.robage1 *.robagemult 32000 mult add *.robage add 9 mod 4 sub .focuseye store
stop
cond
*.robage 32000 =
start
.robage1 inc
stop
cond
*.robage1 32000 =
start
0 .robage1 store
.robagemult inc
stop
'The gene below puts the eyes back in their default positions.
cond
*.robage 32000 =
start
0 .eye1dir store
0 .eye2dir store
0 .eye3dir store
0 .eye4dir store
0 .eye6dir store
0 .eye7dir store
0 .eye8dir store
0 .eye9dir store
0 .eye1width store
0 .eye2width store
0 .eye3width store
0 .eye4width store
0 .eye5width store
0 .eye6width store
0 .eye7width store
0 .eye8width store
0 .eye9width store
stop
end
--- End code ---
Testlund:
I've been trying another crazy eye idea. I want the eyes to be like antennas on an insect scanning the area in front of it. I'm halfway there, but I'm wondering if there are limitations to what can be calculated here, because the eyes use negative values for half of their possible positions and it might not be possible to use that in the custom labels here.
To properly see how it works so far you need to pause the simulation, set it to the slowest speed, click on the bot before you start the sim.
--- Code: ---def anticlockwise 100
start
280 .eye1width store
190 .eye2width store
-24 .eye3width store
-16 .eye4width store
140 .eye5width store
-16 .eye6width store
-24 .eye7width store
190 .eye8width store
280 .eye9width store
stop
start
333 .eye1dir store
95 .eye2dir store
-95 .eye8dir store
-333 .eye9dir store
stop
'Eye 3 moves anticlockwise a short distance and then stops. When it stops it must mean that it's value is no longer below 70.
cond
*.anticlockwise 70 <
start
.eye3dir inc
.anticlockwise inc
stop
'If it's not below 70 it must be above 70, so why doesn't it move back again here?
cond
*.anticlockwise 70 >
start
.eye3dir dec
.anticlockwise dec
stop
--- End code ---
Shadowgod2:
this is very similar to what i will be doing. so far i just have the start pos
Testlund:
OK, but the eyes don't move. I was thinking something more like this:
Navigation
[0] Message Index
[*] Previous page
Go to full version