Bots and Simulations > DNA - General

Eye template

(1/4) > >>

Testlund:
I made this for myself to have a better grip on how it works, but maybe it can be helpful for others too.


--- Code: ---'.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:
'
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

cond
 *.robage 2
start
 0 .focuseye store
stop

cond
 *.robage 4 mod 0 =
start
 -1 .focuseye store
stop

cond
 *.robage 4 mod 1 =
start
 1 .focuseye store
stop

cond
 *.robage 5 mod 0 =
start
 -4 .focuseye store
stop

cond
 *.robage 5 mod 1 =
start
 4 .focuseye store
stop

cond
 *.robage 6 mod 0 =
start
 -5 .focuseye store
stop

cond
 *.robage 6 mod 1 =
start
 2 .focuseye store
stop

cond
 *.robage 7 mod 0 =
start
 -2 .focuseye store
stop

cond
 *.robage 7 mod 1 =
start
 3 .focuseye store
stop

end

--- End code ---

Testlund:
Uuuhh... I just realised that anything based on .robage only works for 32000 cycles.  :glare:

Botsareus:
def robage2 998
def robage1 997
cond
start
.robage1 inc
stop

cond
*.robage1 32000 =
start
.robage2 inc
stop

'actual age =  *.robage *.robage2 32000 mult add 32000 mod
'close enough, play with it...

Testlund:
Wow! The bot gets a second childhood!  :D Thanks.

Shadowgod2:

--- Quote from: Botsareus on September 13, 2014, 06:09:32 PM ---def robage2 998
def robage1 997
cond
start
.robage1 inc
stop

--- End quote ---

may i modify this to:

cond
*.robage 32000 =
start
.robage1 inc
stop

but if we're going there how about this:

def robagemult 50
def robage1 51

cond
*.robage 32000 =
start
.robage1 inc
stop

cond
*.robage1 32000 =
start
0 .robage1 store
.robagemult inc
stop

now bots have 32000 childhoods :D (yes i have had some bots over 100,000 cycles old before usually bigbirthas)

Navigation

[0] Message Index

[#] Next page

Go to full version