Hello.
Im attaching new side.
Please include it in next Top9 tournament.
Regards,
Borg
----------
#side Borg (v1)
#color 000
#seed 2 3 1 1 1
#comment
feed levels
1 - emergency feed
3 - defenders (< 700)
5 - constructor (< 1000)
6 - defenders (> 700)
7 - constructor (> 1000)
radio channels
1 - feed
2 - alert
;#
#code
#const Harvester 1
#const Constructor 2
#const Defender 3
#const Battery 4
#const Bomber 5
#const tmFood 500
#const tmEat 50
#const mbc 11
#const mcc 12
#var preth
#var think
#var thtm
#var sntm
#var mktm
#var tm1
#var tm2
#var tm3
#var c1tm
#var c2tm
#const eatmb 101
#const dngmb 201
#const fdmb 301
#const almb 401
#const basmb 501
#var curmi
#var oldmi -1
#var mi2 -1
sleep:
do dup while
sync
1 -
loop
drop
return
in-curr-rect:
curmi 10 mod 10 * 5 + curmi 10 / floor 10 * 5 + v-
abs 5 < swap abs 5 < and 1 0 ifev
return
get-pos:
dup 10 mod 10 * 5 + swap 10 / floor 10 * 5 +
return
get-idx:
10 / floor 10 * swap 10 / floor +
return
get-posx:
10 mod 10 * 5 +
return
get-posy:
10 / floor 10 * 5 +
return
; mem val
mark-mem:
sync
time +
swap write
return
; mb val
mark-cmem:
sync
time +
swap curmi + write
return
; idx mb val
mark-smem:
sync
time +
rrot + write
return
; mem
clr-mem:
sync
0 swap write
return
; mb
clr-cmem:
sync
curmi + 0 swap write
return
; idx mb
clr-smem:
sync
+ 0 swap write
return
; mark if timer expired
; mem val
mark-mem-if-exp:
sync
time +
swap dup
read time > if
2drop
0 return
fi
write
1 return
; mark if timer expired
; mb val
mark-cmem-if-exp:
sync
time +
swap curmi + dup
read time > if
2drop
0 return
fi
write
1 return
; mark if timer expired
; idx mb val
mark-smem-if-exp:
sync
time +
rrot + dup
read time > if
2drop
0 return
fi
write
1 return
get-rnd-idx:
; W
curmi get-posx 10 > if
0.25 random-bool if
curmi 1 - 1 return
fi
fi
; S
curmi get-posy 90 < if
0.25 random-bool if
curmi 10 + 1 return
fi
fi
; E
curmi get-posx 90 < if
0.25 random-bool if
curmi 1 + 1 return
fi
fi
; N
curmi get-posy 10 > if
0.25 random-bool if
curmi 10 - 1 return
fi
fi
; SW
curmi get-pos 90 < swap 10 > and if
0.25 random-bool if
curmi 9 + 1 return
fi
fi
; SE
curmi get-pos 90 < swap 90 < and if
0.25 random-bool if
curmi 11 + 1 return
fi
fi
; NE
curmi get-pos 10 > swap 90 < and if
0.25 random-bool if
curmi 9 - 1 return
fi
fi
; NW
curmi get-pos 10 > swap 10 > and if
0.25 random-bool if
curmi 11 - 1 return
fi
fi
0 return
get-rnd-idx2:
mi2 -1 = if
curmi mi2!
fi
; W
mi2 get-posx 10 > if
0.25 random-bool if
mi2 1 - dup mi2! 1 return
fi
fi
; S
mi2 get-posy 90 < if
0.25 random-bool if
mi2 10 + dup mi2! 1 return
fi
fi
; E
mi2 get-posx 90 < if
0.25 random-bool if
mi2 1 + dup mi2! 1 return
fi
fi
; N
mi2 get-posy 10 > if
0.25 random-bool if
mi2 10 - dup mi2! 1 return
fi
fi
; SW
mi2 get-pos 90 < swap 10 > and if
0.25 random-bool if
mi2 9 + dup mi2! 1 return
fi
fi
; SE
mi2 get-pos 90 < swap 90 < and if
0.25 random-bool if
mi2 11 + dup mi2! 1 return
fi
fi
; NE
mi2 get-pos 10 > swap 90 < and if
0.25 random-bool if
mi2 9 - dup mi2! 1 return
fi
fi
; NW
mi2 get-pos 10 > swap 10 > and if
0.25 random-bool if
mi2 11 - dup mi2! 1 return
fi
fi
0 return
#type Harvester
#hardware
processor 25
engine 0.09
energy 700 50
food-sensor 7 4
shot-sensor 7
;robot-sensor 10 4
eater 2.0
armor 80
repair-rate 0.05
syphon 1.5 50
#code
#vector wv
#vector fv
#vector bv
#vector evec
#vector evel
#vector ch1v
#var ch1l
#var sl
#var st
#vector sv
#var rs
#var mi
find-food:
fire-food-sensor sync
food-found
do while
food-position get-idx mi!
food-velocity norm 0.01 < if mi dngmb + read time < and-if mi basmb + read
time < and-if
mi eatmb 50 mark-smem-if-exp if
food-position fv!
food-found negate mi fdmb + write
1 return
fi
fi
next-food
loop
fdmb 500 mark-cmem
0 return
scan-shots:
15 periodic-shot-sensor drop
shot-found nif
0 return
fi
shot-side side = nif
shot-type 3 < shot-power 1 > and shot-type 3 > or if
position shot-position v- unitize 8 vs* position v+ seek-location
0 syphon-rate!
time c2tm > if
shot-position get-idx 1 2 2 send
shot-position get-idx dngmb 1000 mark-smem
dngmb 1000 mark-cmem
time 50 + c2tm!
fi
1 return
fi
0 return
fi
shot-type 3 < if
position shot-position v- unitize 8 vs* position v+ seek-location
0 syphon-rate!
1 return
fi
0 return
scan-enemy:
evec norm 9 30 ifev rs!
rs periodic-robot-sensor drop
robot-found
do while
robot-shield-fraction 0.5 > if
robot-position evec!
robot-velocity evel!
evec position v- rect-to-polar
;enemy-syphon-direction! enemy-syphon-distance!
;enemy-syphon-max-rate enemy-syphon-rate!
time c2tm > if
robot-position get-idx 1 2 2 send
time 50 + c2tm!
fi
return
fi
next-robot
loop
0 0 evec!
;0 enemy-syphon-rate!
return
chk-feed-chan:
1 receive nif
0 ch1l!
return
fi
ch1l! ch1v!
return
chk-feed-info:
ch1l if
sl if
ch1l sl < if ch1v position dist syphon-range < and-if
ch1v sv!
ch1l sl!
0 0 bv!
fi
else
ch1v position dist syphon-range < if
ch1v sv!
ch1l sl!
0 0 bv!
else
ch1v bv!
fi
fi
fi
sl if
sv position v- rect-to-polar syphon-direction! syphon-distance!
syphon-max-rate negate syphon-rate!
fi
return
set-food-wander:
dup oldmi = if
drop 0 return
fi
dup basmb + read time > if
drop 0 return
fi
dup dngmb + read time > if
drop 0 return
fi
dup eatmb + read time > if
drop 0 return
fi
dup fdmb + read time > if
drop 0 return
fi
dup get-pos wv!
fdmb 100 mark-smem
curmi oldmi!
1 return
th-feed-wander:
scan-shots ifr
bv norm if
bv seek-location
position bv syphon-range 5 - in-range if
0 0 bv!
0 engine-power!
th-food-find& think!
return
fi
return
fi
0 engine-power!
energy 200 < if
0 0 bv!
th-food-find& think!
fi
return
th-food-wander:
scan-shots if
0 0 wv!
return
fi
wv norm if
wv get-idx eatmb + read time > if
0 0 wv!
0 engine-power!
return
fi
wv seek-location
position wv 1 in-range if
0 0 wv!
0 engine-power!
th-food-find& think!
return
fi
return
fi
get-rnd-idx if
set-food-wander if
-1 mi2!
return
fi
fi
get-rnd-idx2 if
set-food-wander if
return
fi
fi
time thtm > if time sntm > and-if
time 30 + sntm!
find-food if
fv seek-location
0 preth!
th-food-eat& think!
return
fi
fi
return
th-food-find:
0 0 wv!
find-food nif
th-food-wander& think!
time 50 + thtm!
return
fi
th-food-eat& think!
return
th-food-eat:
scan-shots if
0 preth!
th-food-wander& think!
200 thtm!
return
fi
energy 690 > if sl not and-if bv norm and-if
fv get-idx eatmb clr-smem
0 preth!
th-feed-wander& think!
return
fi
fv seek-location
time mktm > if
fv get-idx eatmb 50 mark-smem
time 30 + mktm!
fi
speed 0.03 < position fv dist radius < and if
food-collision nif
fv get-idx eatmb clr-smem
th-food-find& think!
fi
fi
return
th-energy:
energy 30 > if
0 preth!
th-food-wander& think!
200 thtm!
return
fi
0 engine-power!
time c1tm > if
position 1 3 1 send
time 50 + c1tm!
fi
return
#start
main:
-1 mi2!
1 shot-sensor-sees-friendly!
position 10 / floor 10 * swap 10 / floor + curmi!
;time 2 < if
; id 3 * sleep
;fi
th-food-find& think!
do
position 10 / floor 10 * swap 10 / floor + curmi!
syphon-rate if syphoned -0.3 >= and-if
0 syphon-rate!
0 sl!
fi
chk-feed-chan
energy 100 > if
armor max-armor < if
max-repair-rate repair-rate!
fi
chk-feed-info
else
0 repair-rate!
0 syphon-rate!
0 sl!
fi
energy 1 < if
0 preth!
th-energy& think!
fi
preth dup ifc
think dup ifc
forever
#type Constructor
#decoration 00f x
#hardware
processor 25
energy 1600 50
armor 100
eater 1.0
food-sensor 15 4
repair-rate 0.10
constructor 4.0
force-field 0.05 15
#code
#var c1tm
#var c2tm
#vector fv
#var fd
#var fm
#var fp
#var fpd
#var bi -1
#vector wv
#var mi5 -1
get-rnd-idx5:
mi5 -1 = if
curmi mi5!
fi
; W
mi5 get-posx 20 > if
0.25 random-bool if
mi5 2 - dup mi5! 1 return
fi
fi
; S
mi5 get-posy 80 < if
0.25 random-bool if
mi5 20 + dup mi5! 1 return
fi
fi
; E
mi5 get-posx 80 < if
0.25 random-bool if
mi5 2 + dup mi5! 1 return
fi
fi
; N
mi5 get-posy 20 > if
0.25 random-bool if
mi5 20 - dup mi5! 1 return
fi
fi
; SW
mi5 get-pos 80 < swap 20 > and if
0.25 random-bool if
mi5 18 + dup mi5! 1 return
fi
fi
; SE
mi5 get-pos 80 < swap 80 < and if
0.25 random-bool if
mi5 22 + dup mi5! 1 return
fi
fi
; NE
mi5 get-pos 20 > swap 80 < and if
0.25 random-bool if
mi5 18 - dup mi5! 1 return
fi
fi
; NW
mi5 get-pos 20 > swap 20 > and if
0.25 random-bool if
mi5 22 - dup mi5! 1 return
fi
fi
0 return
find-food:
fire-food-sensor sync
food-found
do while
food-position position dist radius > if food-velocity norm 0.01 < and-if
food-mass 25 < and-if
food-position get-idx
dup curmi = if
drop
food-position fv!
food-mass 1 max fm!
1 return
fi
eatmb 50 mark-smem-if-exp if
food-position fv!
food-mass 1 max fm!
1 return
fi
fi
next-food
loop
0 return
pre-construct:
energy 300 > if constructor-type not and-if
Constructor type-population 3 > if
Harvester type-population Constructor type-population 1.5 * < Harvester 0
ifev
dup 0 = if
drop
energy 1300 > if Constructor type-population 9 < and-if
mcc 1000 mark-mem-if-exp if
Constructor constructor-type!
return
fi
fi
3 5 random-int
dup Defender = Defender type-population Constructor type-population 2.0 *
>= and Bomber rot ifev
dup Bomber = Battery type-population Bomber type-population 3.0 * < and
Battery rot ifev
dup Battery = Battery type-population 90 > and Bomber rot ifev
dup Bomber = Bomber type-population 60 > and 0 rot ifev
fi
constructor-type!
return
fi
Constructor type-population 1 > if
Harvester type-population Constructor type-population 3.0 * < Harvester
Battery ifev
dup Battery = Defender type-population Constructor type-population 3.0 * <
and Defender rot ifev
dup Battery = Battery type-population Constructor type-population 4.0 * >=
and 0 rot ifev
dup 0 = if
drop
energy 1300 > if
mcc 1000 mark-mem-if-exp if
Constructor constructor-type!
return
fi
fi
3 5 random-int
dup Defender = Defender type-population Constructor type-population 4.0 *
>= and Bomber rot ifev
dup Bomber = Battery type-population Bomber type-population 4.0 * < and
Battery rot ifev
dup Battery = Battery type-population 90 > and Bomber rot ifev
dup Bomber = Bomber type-population 40 > and 0 rot ifev
fi
constructor-type!
return
fi
Harvester type-population Constructor type-population 4.0 * < Harvester
Constructor ifev
dup Constructor = Defender type-population Constructor type-population 3.0 * <
and Defender rot ifev
dup Defender = Harvester type-population Defender type-population 2.0 * < and
Harvester rot ifev
constructor-type!
fi
return
th-food-find:
thtm time > ifr
find-food nif
time 30 + thtm!
return
fi
fv position dist fd!
fv position v- unitize fv!
0.75 fm sqrt / fp!
fp 2 / fd force-field-range / * fp fm 20 / * + fpd!
th-food-grab& think!
return
th-food-grab:
fd force-field-max-power 30 * radius + < if
time 30 + tm2!
th-food-grab2& think!
return
fi
position fv fd vs* v+ fv vnegate rect-to-polar
swap drop set-force-field
fpd 0.00 > if
fd fp fpd - - fd!
fpd 0.015 - fpd!
else
fd fp - fd!
fi
return
th-food-grab2:
tm2 time > nif
0 force-field-power!
th-food-find& think!
return
fi
position fv force-field-max-power 30 * radius + vs* v+ fv vnegate rect-to-polar
swap drop set-force-field
return
pre-think:
energy 1500 < if time c1tm > and-if
position
energy 1000 < 5 7 ifev
energy 300 < 4 rot ifev
3 1 send
time 50 + c1tm!
fi
pre-construct
return
th-find-base:
wv norm if
position wv position v- rect-to-polar
swap drop set-force-field
position wv dist 3 min 3 / force-field-max-power * force-field-power!
position wv 0.5 in-range if speed 0.03 < and-if
0 force-field-power!
pre-think& preth!
;0 think!
th-food-find& think!
return
fi
return
fi
basmb 50 mark-cmem-if-exp if
curmi bi!
curmi get-pos wv!
return
fi
get-rnd-idx5 if
dup oldmi = if
drop return
fi
dup basmb 50 mark-smem-if-exp nif
drop return
fi
dup bi!
get-pos wv!
curmi oldmi!
-1 mi5!
return
fi
th-energy:
energy 30 > if
th-find-base& think!
return
fi
time c1tm > if
position 1 3 1 send
time 50 + c1tm!
fi
return
#start
main:
position 10 / floor 10 * swap 10 / floor + curmi!
0 preth!
th-energy& think!
do
position 10 / floor 10 * swap 10 / floor + curmi!
mktm time > nif
bi -1 = nif
bi basmb 50 mark-smem
fi
time 30 + mktm!
fi
time tm1 > if
constructor-type Constructor = if
mcc 500 mark-mem
fi
time 100 + tm1!
fi
energy 100 > if
armor max-armor < if
max-repair-rate repair-rate!
fi
constructor-type if
constructor-max-rate constructor-rate!
fi
else
0 repair-rate!
0 constructor-rate!
fi
bi -1 = nif position wv 0.5 in-range and-nif
0 preth!
th-find-base& think!
fi
energy 1 < if
0 preth!
th-energy& think!
fi
preth dup ifc
think dup ifc
forever
#type Defender
#decoration f00 triangle
#hardware
processor 50
engine 0.14
energy 900 50
robot-sensor 12 4
shot-sensor 7
armor 250
repair-rate 0.25
blaster 20 8 10
#code
#const alst 300
#const almt 150
#var myang
#var dgang
#var dg
#var dgtm
#var rstm
#vector fv
#vector evec
#vector evel
#var emass
#vector evec2
#vector evel2
#var ecnt
#vector av
#vector wv
#vector bv
#var am
#var al
#var ch2m
#var ch2l 0
chk-alert:
2 receive if
ch2l!
ch2m!
else
0 ch2l!
return
fi
ch2l 5 > ifr
al if
ch2l al <= ifr
ch2m get-pos position dist am get-pos position dist > ifr
ch2m almb almt mark-smem-if-exp nifr
ch2m am!
ch2l al!
return
fi
ch2m almb almt mark-smem-if-exp nifr
ch2m am!
ch2l al!
return
scan-shots:
15 periodic-shot-sensor drop
shot-found nif
0 return
fi
shot-side side = nif
shot-type 3 < shot-power 1 > and shot-type 3 > or if
position shot-position v- unitize 8 vs* position v+ seek-location
time c2tm > if
;shot-position get-idx 5 2 2 send
shot-position get-idx dngmb 1000 mark-smem
dngmb 1000 mark-cmem
time 50 + c2tm!
fi
1 return
fi
0 return
fi
shot-type 3 < if
position shot-position v- unitize 8 vs* position v+ seek-location
1 return
fi
0 return
get-enemy:
0 0 evec!
0 0 evec2!
0 emass!
fire-robot-sensor sync
robot-found dup ecnt!
do while
robot-shield-fraction 0.5 > if
robot-mass emass > if
robot-position evec!
robot-velocity evel!
robot-mass emass!
ecnt 4 < ifr
fi
else
evec2 norm nif
robot-position evec2!
robot-velocity evel2!
fi
fi
next-robot
loop
evec norm ifr
Defender type-population 10 >= if evec2 norm and-if
evec2 evec!
evel2 evel!
fi
return
shot-enemy:
blaster-cooldown rstm time > or if
0 return
fi
get-enemy
time evec norm 10 30 ifev + rstm!
evec norm if
evec evel lead-blaster
time c2tm > if
evec get-idx ecnt 3 > 6 5 ifev 2 2 send
time 30 + c2tm!
fi
energy 400 > armor 180 > and if
0 preth!
th-fight& think!
1 return
fi
fi
0 return
fire-enemy:
time rstm < ifr
blaster-cooldown 1 > ifr
get-enemy
time 9 + rstm!
evec norm if
evec evel lead-blaster
time c2tm > if
evec get-idx ecnt 3 > 6 5 ifev 2 2 send
time 30 alst ecnt / max + c2tm!
fi
return
fi
return
th-fight:
energy 200 < armor 100 < or if
th-go-charge& think!
return
fi
fire-enemy
evec norm nif
pre-think& preth!
th-go-charge& think!
return
fi
time dgtm > if
dg negate dg!
time 20 + dgtm!
fi
position evec v- 2dup norm 7 > if
unitize 6 vs* evec v+ evel seek-moving-location
return
fi
unitize 2dup 6 vs* evec v+
2swap swap negate dg vs* v+ evel seek-moving-location
return
th-alert-wander:
energy 400 < if
0 0 wv!
0 preth!
th-go-charge& think!
return
fi
energy 50 > if
shot-enemy ifr
fi
scan-shots ifr
wv seek-location
curmi basmb + read time > if
curmi get-pos bv!
fi
position wv 1 in-range if
0 al!
0 engine-power!
th-go-charge& think!
return
fi
return
pre-think:
energy 300 < if
0 preth!
return
fi
armor 230 > if
chk-alert
al if
am get-pos wv!
0 preth!
th-alert-wander& think!
return
fi
else
2 clear-messages
fi
return
th-go-away:
wv norm if
wv seek-location
0.07 engine-power!
position wv 1 in-range if
0 0 wv!
0 engine-power!
th-charge& think!
return
fi
return
fi
get-rnd-idx if
dup oldmi = if
drop return
fi
get-pos wv!
curmi oldmi!
return
fi
return
th-go-charge:
0 al!
energy 50 > if
shot-enemy if
0 preth!
th-fight& think!
return
fi
fi
bv norm if
bv seek-location
position bv 20 in-range if
0 engine-power!
th-charge& think!
return
fi
return
else
th-charge& think!
return
fi
return
th-charge:
energy 50 > if
shot-enemy ifr
fi
scan-shots ifr
preth nif energy 600 > and-if
2 clear-messages
pre-think& preth!
fi
0 engine-power!
energy 850 < if time c1tm > and-if
armor 150 > if
position energy 600 < 3 6 ifev 3 1 send
else
position energy 300 < 5 8 ifev 3 1 send
fi
time 50 + c1tm!
fi
curmi basmb + read time > if
curmi get-pos bv!
0 0 wv!
th-go-away& think!
return
fi
return
th-energy:
energy 30 > if
0 0 wv!
th-charge& think!
return
fi
0 engine-power!
time c1tm > if
position 1 3 1 send
time 50 + c1tm!
fi
2 clear-messages
return
#start
main:
0 shot-sensor-sees-friendly!
position 10 / floor 10 * swap 10 / floor + curmi!
random-angle 5 / myang!
pi/2 dgang!
2 dg!
curmi get-pos bv!
th-energy& think!
do
position 10 / floor 10 * swap 10 / floor + curmi!
energy 100 > if
armor max-armor < if
max-repair-rate repair-rate!
fi
else
0 repair-rate!
fi
energy 1 < if
0 preth!
th-energy& think!
fi
preth dup ifc
think dup ifc
forever
#type Battery
#decoration 0f0 square
#hardware
processor 25
engine 0.05
energy 500 0
solar-cells 0.50
shot-sensor 7
armor 150
repair-rate 0.10
syphon 0.75 40
#code
#vector wv
#vector ch1v
#var ch1l
#var sl
#vector sv
scan-shots:
15 periodic-shot-sensor drop
shot-found nif
0 return
fi
shot-side side = nif
shot-type 3 < shot-power 1 > and shot-type 3 > or if
position shot-position v- unitize 8 vs* position v+ seek-location
0 syphon-rate!
time c1tm > if
shot-position get-idx 2 2 2 send
dngmb 1000 mark-cmem
time 50 + c1tm!
fi
1 return
fi
0 return
fi
shot-type 3 < if
position shot-position v- unitize 8 vs* position v+ seek-location
0 syphon-rate!
1 return
fi
0 return
chk-feed-chan:
1 receive nif
0 ch1l!
return
fi
ch1l! ch1v!
return
chk-feed-info:
ch1l if
sl if
ch1l sl < if ch1v position dist syphon-range < and-if
ch1v sv!
ch1l sl!
fi
else
ch1v position dist syphon-range < if
ch1v sv!
ch1l sl!
fi
fi
fi
sl if
sv position v- rect-to-polar syphon-direction! syphon-distance!
syphon-max-rate negate syphon-rate!
fi
return
th-circle:
wv norm if
wv seek-location
position wv 0.5 in-range if speed 0.03 < and-if
0 engine-power!
th-idle& think!
return
fi
return
fi
id 3 mod pi/2 *
0 89 random-int pi 18 / *
+ reorient
1
do while
8 over polar-to-rect
curmi get-pos v+ 2dup
dup 5 > swap 95 < and swap dup 5 > swap 95 < and and if
0
else
2drop
pi/2 + reorient
1
fi
loop
wv!
drop
return
th-idle:
scan-shots ifr
0 engine-power!
return
#start
main:
1 shot-sensor-sees-friendly!
position 10 / floor 10 * swap 10 / floor + curmi!
th-circle& think!
do
position 10 / floor 10 * swap 10 / floor + curmi!
syphon-rate if syphoned -0.3 >= and-if
0 syphon-rate!
0 sl!
fi
chk-feed-chan
energy 5 > if
armor max-armor < if
max-repair-rate repair-rate!
fi
chk-feed-info
else
0 repair-rate!
0 syphon-rate!
0 sl!
fi
wv norm if position wv 3.0 in-range and-nif
th-circle& think!
fi
preth dup ifc
think dup ifc
forever
#type Bomber
#decoration ff5 triangle
#hardware
processor 50
engine 0.14
energy 900 50
robot-sensor 12 4
shot-sensor 7
armor 250
repair-rate 0.25
grenades 20 9 10
#code
#const alst 300
#const almt 30
#var myang
#var dgang
#var dg
#var dgtm
#var rstm
#vector fv
#vector evec
#vector evel
#var emass
#vector evec2
#vector evel2
#var ecnt
#vector av
#vector wv
#vector bv
#var am
#var al 0
#var ch2m
#var ch2l 0
#var c1tm
#var c2tm
chk-alert:
2 receive if
ch2l!
ch2m!
else
0 ch2l!
return
fi
ch2l 5 < ifr
al if
ch2m al <= ifr
ch2m get-pos position dist am get-pos position dist > ifr
ch2m almb almt mark-smem-if-exp nifr
ch2m am!
ch2l al!
return
fi
ch2m almb almt mark-smem-if-exp nifr
ch2m am!
ch2l al!
return
scan-shots:
15 periodic-shot-sensor drop
shot-found nif
0 return
fi
shot-side side = nif
shot-type 3 < shot-power 1 > and shot-type 3 > or if
position shot-position v- unitize 8 vs* position v+ seek-location
time c2tm > if
shot-position get-idx 6 2 2 send
shot-position get-idx dngmb 1000 mark-smem
dngmb 1000 mark-cmem
time 50 + c2tm!
fi
1 return
fi
0 return
fi
shot-type 3 < if
position shot-position v- unitize 8 vs* position v+ seek-location
1 return
fi
0 return
get-enemy:
0 0 evec!
0 0 evec2!
0 emass!
fire-robot-sensor sync
robot-found ecnt!
robot-found
do while
robot-shield-fraction 0.5 > if
robot-mass emass > if
robot-position evec!
robot-velocity evel!
robot-mass emass!
ecnt 4 < ifr
fi
else
evec2 norm nif
robot-position evec2!
robot-velocity evel2!
fi
fi
next-robot
loop
evec norm ifr
Defender type-population 10 >= if evec2 norm and-if
evec2 evec!
evel2 evel!
fi
return
shot-enemy:
grenades-cooldown rstm time > or if
0 return
fi
get-enemy
time evec norm 10 30 ifev + rstm!
evec norm if
evec evel lead-grenade
time c2tm > if
evec get-idx 6 2 2 send
time 30 + c2tm!
fi
energy 400 > armor 180 > and if
0 preth!
th-fight& think!
1 return
fi
fi
0 return
fire-enemy:
time rstm < ifr
grenades-cooldown 1 > ifr
get-enemy
time 9 + rstm!
evec norm if
evec evel lead-grenade
time c2tm > if
evec get-idx 6 2 2 send
time 30 alst ecnt / max + c2tm!
fi
return
fi
return
th-fight:
energy 200 < armor 100 < or if
th-go-charge& think!
return
fi
fire-enemy
evec norm nif
pre-think& preth!
th-go-charge& think!
return
fi
time dgtm > if
dg negate dg!
time 20 + dgtm!
fi
position evec v- 2dup norm 8 > if
unitize 7 vs* evec v+ evel seek-moving-location
return
fi
unitize 2dup 7 vs* evec v+
2swap swap negate dg vs* v+ evel seek-moving-location
return
th-alert-wander:
energy 400 < if
0 0 wv!
0 preth!
th-go-charge& think!
return
fi
energy 50 > if
shot-enemy ifr
fi
scan-shots ifr
wv seek-location
curmi basmb + read time > if
curmi get-pos bv!
fi
position wv 1 in-range if
0 al!
0 engine-power!
th-go-charge& think!
return
fi
return
pre-think:
energy 300 < if
0 preth!
return
fi
armor 230 > if
chk-alert
al if
am get-pos wv!
0 preth!
th-alert-wander& think!
return
fi
else
2 clear-messages
fi
return
th-go-away:
wv norm if
wv seek-location
0.07 engine-power!
position wv 1 in-range if
0 0 wv!
0 engine-power!
th-charge& think!
return
fi
return
fi
get-rnd-idx if
dup oldmi = if
drop return
fi
get-pos wv!
curmi oldmi!
return
fi
return
th-go-charge:
energy 50 > if
shot-enemy if
0 preth!
th-fight& think!
return
fi
fi
bv norm if
bv seek-location
position bv 20 in-range if
0 engine-power!
th-charge& think!
return
fi
return
else
th-charge& think!
return
fi
return
th-charge:
energy 50 > if
shot-enemy ifr
fi
scan-shots ifr
preth nif energy 600 > and-if
2 clear-messages
pre-think& preth!
fi
0 engine-power!
energy 850 < if time c1tm > and-if
armor 150 > if
position energy 600 < 3 6 ifev 3 1 send
else
position energy 300 < 5 8 ifev 3 1 send
fi
time 50 + c1tm!
fi
curmi basmb + read time > if
curmi get-pos bv!
0 0 wv!
th-go-away& think!
return
fi
return
th-energy:
energy 30 > if
0 0 wv!
th-charge& think!
return
fi
0 engine-power!
time c1tm > if
position 1 3 1 send
time 50 + c1tm!
fi
2 clear-messages
return
#start
main:
0 shot-sensor-sees-friendly!
position 10 / floor 10 * swap 10 / floor + curmi!
random-angle 5 / myang!
pi/2 dgang!
2 dg!
curmi get-pos bv!
th-energy& think!
do
position 10 / floor 10 * swap 10 / floor + curmi!
energy 100 > if
armor max-armor < if
max-repair-rate repair-rate!
fi
else
0 repair-rate!
fi
energy 1 < if
0 preth!
th-energy& think!
fi
preth dup ifc
think dup ifc
forever
#end
[Non-text portions of this message have been removed]
Jon Distad wrote:
> I've written a vim syntax file for grobots.
I don't use vim, but I made a crude Emacs mode:
(define-generic-mode grobots-mode
'(";")
'("if" "nif" "and-if" "else" "then"
"do" "forever" "while" "until" "while-loop" "until-loop" "loop")
'(("^#[a-z]+" . font-lock-preprocessor-face)) ;fontlocks
'(".*\.gb")
'() ;functions
"Generic mode for Grobots sides.")
raszul_666 wrote:
> In my opinion the page could definitely use a complete
> makeover. It's functional as is and gives of a nostalgic
> feel of sorts, though I'd prefer if the page were a little
> more easy to navigate and the information more readily
> available.
Yeah, it's a bit crude. It would also be nice if the documentation were more up
to date, and the tutorial information were better. As long as the website has a
single point of procrastination (me) this is unlikely to improve, so we need a
way for other people to edit the website. The obvious way is a wiki, and as it
happens Sourceforge provides MediaWiki, so I just turned it on for Grobots:
http://sourceforge.net/apps/mediawiki/grobots/
There's nothing there yet, but we could move most of the website over, which
would help with the out-of-dateness problem and also provide an easy way for
users to upload their own sides and tournament results.
However, it's really slow at the moment - 7 seconds latency - so it'll only be
useful if that's not normal.
> PS: please don't be offended by this suggestion.
I'm not; I long ago assimilated the peculiar open-source custom of hearing "ur
doin it rong" as helpful information, not an insult. (My delay in responding was
out of simple procrastination, not offense.)
We were going to have another Newbie Tournament, right? Since I've recently
received a few new sides, it's time to schedule it. Newbie Tournament 6 will be
next Sunday, 13 September. Send sides to me or to the list to have them
included.
I've written a vim syntax file for grobots. I can't guarantee that it's
perfect, but it's up on github, so feel free to make it better and send pull
requests! Anyway, here's the link:
http://github.com/jondistad/grobots-vim
Jon
I've been reading some of the posts on game-theory, arena size and balancing
shields and had some (well... quite a few) ideas.
************Implementing Periodic Boundaries****************
---A possible convenience to help with the added navigation complication would
be to add angular-position registers and converters. I.e. the x and y get
converted to theta and phi ranging from 0 to 2pi (like spherical coordinates
since the topology essentially becomes a torus).
---Alternately implement a "v_rescale" command which will rescale (if needed) an
x,y vector to fit within the boundaries. Also, add commands such as
virtual_robot_position. When the nearest distance wraps over a boundary,
position would be calculated by adding the remainder after wrap around so that
the position returned would be in the adjoining virtual world. I.e. a robot
whose x position is 1 unit from the left bound would see a robot 1 unit from the
right bound as having an x coordinate of -2 rather than world_width - 1. I.e.
virtual_robot_position v_rescale would then yield the same thing as
robot_position, but virtual_robot_position would be more useful for aiming and
navigation. Alternately, the definition for position could be chaned to be like
virtual_position and a new register called absolute_position could be added to
act like the current position register (which may help prevent breaking existing
sides).
---Also, add a relative_position command which takes 2 vectors and returns the
relative position of the second wrt. the first, taking boundaries into account.
---Update v= to automatically account for periodic boundaries and add v=_abs
which works like the current v=.
********Ideas for balancing Shields*************
-One idea for a counter for shields would be to introduce an armor piercing or
feedback option on weapons or an armor piercing / feedback weapon.
---Armor Piercing: a blaster or grenade with points in armor piercing would
bypass some of the shielding based on the level of armor piercing but would cost
more to buy and fire based on the level of armor piercing. E.g. .1 armor
piercing would reduce effective shielding by .1 but would increase cost of the
weapon by a factor cost*(1 + k*AP) for instance. Thus robots with armor piercing
have a definite advantage vs shields, but suffer vs unshielded opponents since
they wont do as much damage as they would if they had no armor piercing. This
would force sides to decide whether or not to spend money on AP or shields based
on what else is around.
---Feedback: deals additional damage, unmodified by shields, equal to
Feedback*k*shieldLevel. Could be its own weapon, or added as an additional
option on blasters and grenades. Like armor piercing, it would be good for
fighting shielded targets, but would be detrimental vs unshielded sides since it
would require higher costs to buy and fire weapons with feedback equiped.
Alternative feedback rule: adds a cumulative feedback charge to shielded targets
which slowly degrades once shields are lowered. Accumulated charge could:
1) do damage each frame, or
2) increase the energy cost for maintaining shields, or
3) lower effective cpu speed of target's brain, reduce sensor range, slow down
constructors, etc.
---Another idea: Passive robot scanners - work like robot sensors, but in a
variable arc angle (possibly limited between a min and max angle to prevent
abuse) with effective range scaled so that a finite area (sector) is detected
rather than a full disc. I.e. if used to detect a 90 degree arc instead of 360,
the range would be 4 times larger than a sensor of equivalent mass. Would cost
nothing to use but could only detect robots that are shielded or actively using
a sensor at the time (or possibly fired a weapon or syphon, sent a radio message
/ written to shared memory, collided with a robot or wall, etc.). The effective
range could also depend on the sensor range / shield level of the robot being
scanned for.
---Rework of shield rules: Shields have 2 parameters: charge (and max_charge)
and absorption. Absorption works the same as now, but robots must charge their
shields. The energy needed to charge / maintain shields would be based on the
absorption level. I.e. to a .1 absorption shield would cost absorption*k energy
to maintain, and additional energy spent would be added to charge. If the robot
doesn't spend enough energy to maintain its shields they would decay by up to
absorption*k charge. Finally whenever the shield absorbs damage, charge is
reduced by a corresponding amount. (this could also be worked in with armor
piercing or feedback)
-Wesley Smith
Well, I'm a webprogrammer and -designer myself and have long thought whether I
should mention this.
In my opinion the page could definitely use a complete makeover. It's functional
as is and gives of a nostalgic feel of sorts, though I'd prefer if the page were
a little more easy to navigate and the information more readily available.
If there is demand for a design suggestion or something similar please feel free
to tell me. As soon as I get around to it I'll give it a shot.
Here is a simplified structure of how the page might be organized in the future.
NEWS
> program updates
> tournament announcements
> tournament result announcements
> side-packages updates (Classics, Top 10, Newbie, ...)
> [optionally] side updates
TOURNAMENTS
-> Subpage per Tournament showing the date, participants, etc. of each
> upcoming tournaments
> player ranking (based on participating sides)
> result analysis
DOCUMENTATION
> side analysises
> tutorial
> basics
-> file structure
-> [optionally] program handling
> references
-> language
-> hardware
-> hardware interface
SUBMISSIONS
> upload for sides
> update overview for sides
> sides <--> player relations (simply a table showing which player released
which sides)
DOWNLOADS
> Sources
> Binaries
> Starter-Kits
> Side-Packages
> sides repository (including latest ranking for each side)
ABOUT
> description of Grobots
> credits for coders
> [potentially] awards & co
> credits (legal page info & stuff like that)
I know that his is a lot of stuff to keep up to date and am offering my help to
do so. Depending on the effort put into coding/creating this page the work to
maintain it might be dramatically reduced since many things might be done
automatically (e.g. parsed from the tournament results .html file)
PS: please don't be offended by this suggestion. I know that my suggestions tend
to offend and am sorry for it. Please consider it an idea for improvement. Maybe
we can get a few more players that way... who knows ^^
Wesley <wesleymsmith2000@...> wrote:
> Anyone know when / if there will be another newbie tournament held?
They're held on demand - I'll hold one when someone sends some sides. Or, if you
prefer, at some scheduled time - perhaps in a month or so?
dunno. And though I always say that, and never actually get the time to do it, I
would supposedly get it (time to play) in 3 weeks, and now almost finishing
college, HOPEFULLY it will be true now :''-(
bye,AM
--- Em qua, 24/6/09, Wesley <wesleymsmith2000@...> escreveu:
De: Wesley <wesleymsmith2000@...>
Assunto: [grobots] Re: Newbie Tournament 5
Para: grobots@yahoogroups.com
Data: Quarta-feira, 24 de Junho de 2009, 18:36
Anyone know when / if there will be another newbie tournament held?
--- In grobots@yahoogroups .com, "dschudy" <dschudy@... > wrote:
>
> Someone sent us some new sides, so it's time for another Newbie
> Tournament. I'll hold it in about two weeks, on Saturday August 10, so
> you have time to dust off a side or two. Send in your sides!
>
> In case anyone didn't realize, upgrades of old sides are welcome. The
> first released version of a side needn't be the last - some sides have
> gone through as many as 14 versions. Release early and often. I can
> supply comments on the sides if that helps.
>
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
[Non-text portions of this message have been removed]
Anyone know when / if there will be another newbie tournament held?
--- In grobots@yahoogroups.com, "dschudy" <dschudy@...> wrote:
>
> Someone sent us some new sides, so it's time for another Newbie
> Tournament. I'll hold it in about two weeks, on Saturday August 10, so
> you have time to dust off a side or two. Send in your sides!
>
> In case anyone didn't realize, upgrades of old sides are welcome. The
> first released version of a side needn't be the last - some sides have
> gone through as many as 14 versions. Release early and often. I can
> supply comments on the sides if that helps.
>
--- In grobots@yahoogroups.com, "John Wiltshire" <jw@...> wrote:
>
> My experience building them from source using VS2008/VS2010 is:
>
> ..dsp files need windows line endings (this isn't a problem if you
> use cvs to get the source)
>
> ..NOMINMAX needs to be added as a predefined macro (or windef.h puts
> in #defines for min and max which mess up GBNumber.h)
>
> ..GBTournamentView.cpp needs "#include <algorithm>" at the top.
>
> resource.h isn't needed and you don't need to convert the eol's on the
> .cpp/.h files, only the .dsp. Once you've done that and build a release
> version it runs many times faster than the precompiled binaries, especially
> if you turn on all the optimizations.
> Cheers,
> John
-------------------------
Cool thanks for the tips, i got thru the "isnt in std::" bits
but that NOMINMAX thing realy threw me off.
Im just glad it wasnt a mountain of problems.
My experience building them from source using VS2008/VS2010 is:
. .dsp files need windows line endings (this isn't a problem if you
use cvs to get the source)
. NOMINMAX needs to be added as a predefined macro (or windef.h puts
in #defines for min and max which mess up GBNumber.h)
. GBTournamentView.cpp needs "#include <algorithm>" at the top.
resource.h isn't needed and you don't need to convert the eol's on the
.cpp/.h files, only the .dsp. Once you've done that and build a release
version it runs many times faster than the precompiled binaries, especially
if you turn on all the optimizations.
Cheers,
John
From: grobots@yahoogroups.com [mailto:grobots@yahoogroups.com] On Behalf Of
seriac2001
Sent: Thursday, 28 May 2009 10:36 PM
To: grobots@yahoogroups.com
Subject: [grobots] 2008 MSVC files are corrupt.
They all have unix or mac eol's.
MSVC 2005 cant open nor covert the project files.
I had a copy of the 2006 src's and compared those files
to the 2008's. No significant changes so i just whole
copied them over to the 2008. The project converted fine.
Also,
the 2008 is also missing resource.h, im not sure if
that's on purpose.
However,
tried to compile, I got to the 100 error mark and it
stopped compiling. I'm not sure if its syntactic errors
or eol's. Im going to convert the eol's first and then
try again.
[Non-text portions of this message have been removed]
They all have unix or mac eol's.
MSVC 2005 cant open nor covert the project files.
I had a copy of the 2006 src's and compared those files
to the 2008's. No significant changes so i just whole
copied them over to the 2008. The project converted fine.
Also,
the 2008 is also missing resource.h, im not sure if
that's on purpose.
However,
tried to compile, I got to the 100 error mark and it
stopped compiling. I'm not sure if its syntactic errors
or eol's. Im going to convert the eol's first and then
try again.
"Antonio Marcos" amcmr2003@... wrote:
>
> Hello everyone!
>
> I was wondering, since I'm studying CUDA for my final project at the
> university, that grobots would certainly benefit A LOT from it, we
> could even implement some ideas we have discarded due to complexity,
> time consumption, etc.
>
> How long took for the last contests to run? And which machine did it
> ran on? It was like many hours.. Im certain this could be reduced to
> a few minutes with CUDA.
>
> For those that may not know, CUDA is the new technology Nvidia is
> bringing with their new video cards, allowing massive parallel
> programming to be accomplished without the need of huge warehouses
> full of computers, nor the cost of all this. Its really impressive,
> check it out on youtube. :)
>
> Tell me your thoughts on this.
Hi Antonio,
Porting a large application such as Grobots to CUDA is not an easy task
since the code must be written in a subset of C, not the C++ that
Grobots is written in. No single chunk of code dominates the runtime of
Grobots so porting enough of it to CUDA to get a significant performance
boost would probably require months of work. The result would be harder
to maintain code that is faster only on the limited set of machines with
nvidia graphics cards with the correct drivers installed.
A far simpler way to improve performance would be to spawn multiple
threads in tournament mode, each thread running a different world on a
different core of a machine with multiple processors and/or cores. Such
a feature would be nice, but running a tournament overnight works fine
so we have more pressing priorities.
ws
Hello everyone!
I was wondering, since I'm studying CUDA for my final project at the
university, that grobots would certainly benefit A LOT from it, we could even
implement some ideas we have discarded due to complexity, time consumption, etc.
How long took for the last contests to run? And which machine did it ran on? It
was like many hours.. Im certain this could be reduced to a few minutes with
CUDA.
For those that may not know, CUDA is the new technology Nvidia is bringing with
their new video cards, allowing massive parallel programming to be accomplished
without the need of huge warehouses full of computers, nor the cost of all this.
Its really impressive, check it out on youtube. :)
Tell me your thoughts on this.
Cheers,
AM.
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
>While always having been interested in artificial intelligence and
>deciccion finding algorithms Grobots also provides a platform on wich
>I can test my strategic ideas on before applying them to other
>applications.
Same here =)
>Having always been curious how a robot that follows the simplified
>swarm rules would behave, I improved uppon the swarm concept and put
>together a few rules wich a robot should follow (in a swarm):
Interesting idea, i would certainly like to help.
>If anyone could offer me a hand in writing this side I would gladly
>apreciate it, for I have not been into coding for Grobots since over a
>year (if not closer to two years)
Same here =( So i dont think I would be all that much of a help. Though I
certainly want to help, once Im less busy =( final project @ uni and stuff, have
to work even on vacation =(
but a little help might be the following:
>I thought about a couple of other things wich it should be capable of,
>besides those 7 basic rules:
>- Food Hashing
Im not sure whats this food hashing you guys keep talking, I understand the
concept I guess, but when Davon (I believe) analysed my code, he didnt mention
it, so I dont know if that was actually a form of food hashing or not, but it
seemed pretty efficient to me, not only time-wise, but space-wise too.(Thats why
I believe its not a form of hashing, because I assume hashing uses memory space
for the values, mine didnt need any memory ^_^). If Devon (or the nice guy that
analysed our newbie sides) could take a better look at it and tell me if that
was naive or not, that would be awesome =) check it out, Raszul, my side name is
"Diagonal Explorer".
Kindly,
Mark.
--- Em dom, 14/12/08, raszul_666 <raszul@...> escreveu:
De: raszul_666 <raszul@...>
Assunto: [grobots] Swarm Robot
Para: grobots@yahoogroups.com
Data: Domingo, 14 de Dezembro de 2008, 10:20
Yesterday I restarted my activity on Grobots.
While always having been interested in artificial intelligence and
deciccion finding algorithms Grobots also provides a platform on wich
I can test my strategic ideas on before applying them to other
applications.
Having always been curious how a robot that follows the simplified
swarm rules would behave, I improved uppon the swarm concept and put
together a few rules wich a robot should follow (in a swarm):
1. stay within N units of at least 3 members
2. stay away at least 1 unit from each other member
3. move only to food that follows 1. & 2.
4. flee shots
5. flee & shoot robots
6. request food if below 15% capacity (using flag?)
7. offer food if above 60% capacity
Of course this swarm dos not yet have any realy offensive capabilities
but I am sure that it would do surprisingly well, if someone managed
to help me create it.
I thought about a couple of other things wich it should be capable of,
besides those 7 basic rules:
- Food Hashing
simply bee faster by not fighting with ones own allies over food
- Thread Hashing
avoid getting towards threads (but only on low priority - eventually
there is no room to evade every thread)
threads are valued by sum of enemy (armed) robot mass in area and
decrades by 1 per frame
If anyone could offer me a hand in writing this side I would gladly
apreciate it, for I have not been into coding for Grobots since over a
year (if not closer to two years)
Oh, before I forget it - one last thing:
The entire side is called "Swarm" and has only one type "Drone".
I want it to be written with the least complex and shortest possible code.
- Raszul
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
[Non-text portions of this message have been removed]
Yesterday I restarted my activity on Grobots.
While always having been interested in artificial intelligence and
deciccion finding algorithms Grobots also provides a platform on wich
I can test my strategic ideas on before applying them to other
applications.
Having always been curious how a robot that follows the simplified
swarm rules would behave, I improved uppon the swarm concept and put
together a few rules wich a robot should follow (in a swarm):
1. stay within N units of at least 3 members
2. stay away at least 1 unit from each other member
3. move only to food that follows 1. & 2.
4. flee shots
5. flee & shoot robots
6. request food if below 15% capacity (using flag?)
7. offer food if above 60% capacity
Of course this swarm dos not yet have any realy offensive capabilities
but I am sure that it would do surprisingly well, if someone managed
to help me create it.
I thought about a couple of other things wich it should be capable of,
besides those 7 basic rules:
- Food Hashing
simply bee faster by not fighting with ones own allies over food
- Thread Hashing
avoid getting towards threads (but only on low priority - eventually
there is no room to evade every thread)
threads are valued by sum of enemy (armed) robot mass in area and
decrades by 1 per frame
If anyone could offer me a hand in writing this side I would gladly
apreciate it, for I have not been into coding for Grobots since over a
year (if not closer to two years)
Oh, before I forget it - one last thing:
The entire side is called "Swarm" and has only one type "Drone".
I want it to be written with the least complex and shortest possible code.
- Raszul
zendarva wrote:
> I moved next-robot to the top, stored its value in a variable,
> and checked it against 1 instead of 0 and everything works.
next-robot already returns a boolean, so there's no need to convert it to one by
comparing to true. Also, comparing to 1 doesn't generally work, because any
nonzero value is true. Boolean operations like next-robot do return 1 for true,
but many other values are used as booleans. Robot-found, for instance, is the
number of robots found, but is usually used as a boolean.
> Though the side I wrote it for is pitiful. Heh. The side maxes
> out at around 120 individuals when run solo, and when run against
> any 9 of the sides provided in the "topn" directory of the
> starter kit, dies around 2-5000, so I've still got a ways to go.
The Top N are the best sides in existence, so it's not surprising that your
first side dies quickly when exposed to them. Try testing against sides from the
Classics directory or the Newbie Tournament instead, and work up from there.
> Truth tests seem a bit non-intuitive in this language, compared to
> what I'm used to, or maybe I'm just doing it wrong.
Non-intuitive because they're postfix, or because of what counts as true?
> stick. It works, and it works correctly. *shrug*
hahaha
> I'm starting to get it, it just takes me a couple of
> tries sometimes. *laughs*
yes yes, and that was exactly one of the things that attracted me in this game,
the language, it spinned my brain a bit =)
> I think my biggest problem is that i'm used to
> thinking of
> "True" and "False" not "1"
> and "0", If i define some constants it'll
> probably all resolve itself.
I imagined =)
> I hope so too, this game looks to interesting to have so
> little activity.
exactly. I was lucky in the beginning, that people promptly responded. They are
a bit quiet now, i hope they are all alright.
regards,
Mark.
--- Em seg, 1/12/08, zendarva <zendarva@...> escreveu:
> De: zendarva <zendarva@...>
> Assunto: [grobots] Re: Kinda confused on sensors...
> Para: grobots@yahoogroups.com
> Data: Segunda-feira, 1 de Dezembro de 2008, 21:34
> --- In grobots@yahoogroups.com, Antonio Marcos
> <amcmr2003@...> wrote:
> >
> > > Yeah, that did seem to be the problem. I moved
> next-robot to the top,
> >
> > Hmm.. wouldnt that eliminate the first result?? What
> happens when
> the master is the only bot around, or worse: what happens
> if its the
> closest one, but not the only one?
> >
>
> I expected the same thing, at the point I changed it I had
> given up
> and gone to throwing things against the wall to see if they
> would
> stick. It works, and it works correctly. *shrug*
>
> > > Truth tests seem a bit non-intuitive in this
> language,
> >
> > You would just need to put the while there, no need to
> compare, you
> are actually losing processing cycles =) for doing
> something already
> there:
> >
> > > compared to what I'm used to,
> >
> > Maybe you're just not used to the little trick,
> lets say, in C/C++:
> if(1) is always true =) and while(1) is a infinite loop =)
> you can do
> that.. and also, much less useful but well: if(0),
> while(0)...
> anything else you put there, will reduce to 0 or >0 (1
> or 2.. etc)...
> >
> > same with grobots, only the order of the words are
> diferent. Also,
> that 1 or 0 is in the top of the stack. So, the bottom line
> is, you
> will be comparing 1 to 1, and grobot will put 1(true) at
> the top again
> as the answer =) useless isnt it =))
>
> I'm starting to get it, it just takes me a couple of
> tries sometimes.
> *laughs* I think my biggest problem is that i'm used to
> thinking of
> "True" and "False" not "1"
> and "0", If i define some constants it'll
> probably all resolve itself.
>
> > >so I've still got a
> > > ways to go.
> >
> > hehe, me too, I still didnt have time to really go
> into grobots,
> even though im here for I guess 2 years :( Next week I will
> supposedly
> be freer. lets hope =))
> >
> > Kindly,
> > Mark.
> >
>
> I hope so too, this game looks to interesting to have so
> little activity.
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
--- In grobots@yahoogroups.com, Antonio Marcos <amcmr2003@...> wrote:
>
> > Yeah, that did seem to be the problem. I moved next-robot to the top,
>
> Hmm.. wouldnt that eliminate the first result?? What happens when
the master is the only bot around, or worse: what happens if its the
closest one, but not the only one?
>
I expected the same thing, at the point I changed it I had given up
and gone to throwing things against the wall to see if they would
stick. It works, and it works correctly. *shrug*
> > Truth tests seem a bit non-intuitive in this language,
>
> You would just need to put the while there, no need to compare, you
are actually losing processing cycles =) for doing something already
there:
>
> > compared to what I'm used to,
>
> Maybe you're just not used to the little trick, lets say, in C/C++:
if(1) is always true =) and while(1) is a infinite loop =) you can do
that.. and also, much less useful but well: if(0), while(0)...
anything else you put there, will reduce to 0 or >0 (1 or 2.. etc)...
>
> same with grobots, only the order of the words are diferent. Also,
that 1 or 0 is in the top of the stack. So, the bottom line is, you
will be comparing 1 to 1, and grobot will put 1(true) at the top again
as the answer =) useless isnt it =))
I'm starting to get it, it just takes me a couple of tries sometimes.
*laughs* I think my biggest problem is that i'm used to thinking of
"True" and "False" not "1" and "0", If i define some constants it'll
probably all resolve itself.
> >so I've still got a
> > ways to go.
>
> hehe, me too, I still didnt have time to really go into grobots,
even though im here for I guess 2 years :( Next week I will supposedly
be freer. lets hope =))
>
> Kindly,
> Mark.
>
I hope so too, this game looks to interesting to have so little activity.
> Yeah, that did seem to be the problem. I moved next-robot to the top,
Hmm.. wouldnt that eliminate the first result?? What happens when the master is
the only bot around, or worse: what happens if its the closest one, but not the
only one?
> Truth tests seem a bit non-intuitive in this language,
You would just need to put the while there, no need to compare, you are actually
losing processing cycles =) for doing something already there:
> compared to what I'm used to,
Maybe you're just not used to the little trick, lets say, in C/C++: if(1) is
always true =) and while(1) is a infinite loop =) you can do that.. and also,
much less useful but well: if(0), while(0)... anything else you put there, will
reduce to 0 or >0 (1 or 2.. etc)...
same with grobots, only the order of the words are diferent. Also, that 1 or 0
is in the top of the stack. So, the bottom line is, you will be comparing 1 to
1, and grobot will put 1(true) at the top again as the answer =) useless isnt it
=))
>so I've still got a
> ways to go.
hehe, me too, I still didnt have time to really go into grobots, even though im
here for I guess 2 years :( Next week I will supposedly be freer. lets hope =))
Kindly,
Mark.
--- Em seg, 1/12/08, zendarva <zendarva@...> escreveu:
> De: zendarva <zendarva@...>
> Assunto: [grobots] Re: Kinda confused on sensors...
> Para: grobots@yahoogroups.com
> Data: Segunda-feira, 1 de Dezembro de 2008, 20:31
> Yeah, that did seem to be the problem. I moved next-robot
> to the top,
> stored its value in a variable, and checked it against 1
> instead of 0
> and everything works. Though the side I wrote it for is
> pitiful. Heh.
> The side maxes out at around 120 individuals when run
> solo, and when
> run against any 9 of the sides provided in the
> "topn" directory of the
> starter kit, dies around 2-5000, so I've still got a
> ways to go.
>
> Truth tests seem a bit non-intuitive in this language,
> compared to
> what I'm used to, or maybe I'm just doing it wrong.
>
> Thanks.
>
> --- In grobots@yahoogroups.com, Antonio Marcos
> <amcmr2003@...> wrote:
> >
> > at first glance, I would say that when you reach the
> end of the
> loop, you invert the test for the while.. so it will break
> as soon as
> the master isnt the first result(which is exactly what you
> describe: a
> bot in-between them) =) am I right?
> >
> > kindly,
> > Mark.
> >
> >
> > --- Em seg, 1/12/08, zendarva <zendarva@...>
> escreveu:
> >
> > > De: zendarva <zendarva@...>
> > > Assunto: [grobots] Kinda confused on sensors...
> > > Para: grobots@yahoogroups.com
> > > Data: Segunda-feira, 1 de Dezembro de 2008, 1:02
> > > I'm trying to set one bot up to follow
> another, at first
> > > i had no
> > > problem, but as the number of bots increase I see
> something
> > > strange
> > > happening. Whenever the follower has another bot
> between
> > > it and the
> > > bot it's following my routine for scanning
> seems to
> > > break and I can't
> > > understand why.
> > >
> > > follow-owner:
> > > do
> > > num-robot-results 0 = if
> > > 1 lost!
> > > return
> > > then
> > > robot-id owner-id = if
> > > robot-position owner-pos!
> > > ;found the owner, move to em.
> > > return
> > > then
> > > next-robot
> > > 0 = while-loop
> > > 1 lost!
> > >
> > > It seems that sometimes num-robot-results is 0
> even when
> > > there are
> > > multiple robots in sensor range and the sensor
> was
> > > fired/synced the
> > > frame before. Or that sometimes even if
> num-robot-results
> > > is correct,
> > > next-robot returns 0 when moving from the first
> result to
> > > the second,
> > > even when there are several remaining results.
> > >
> > > I'm not quite sure what could be wrong here,
> any help
> > > would be
> > > appreciated.
> >
> >
> > Veja quais são os assuntos do momento no Yahoo!
> +Buscados
> > http://br.maisbuscados.yahoo.com
> >
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
Yeah, that did seem to be the problem. I moved next-robot to the top,
stored its value in a variable, and checked it against 1 instead of 0
and everything works. Though the side I wrote it for is pitiful. Heh.
The side maxes out at around 120 individuals when run solo, and when
run against any 9 of the sides provided in the "topn" directory of the
starter kit, dies around 2-5000, so I've still got a ways to go.
Truth tests seem a bit non-intuitive in this language, compared to
what I'm used to, or maybe I'm just doing it wrong.
Thanks.
--- In grobots@yahoogroups.com, Antonio Marcos <amcmr2003@...> wrote:
>
> at first glance, I would say that when you reach the end of the
loop, you invert the test for the while.. so it will break as soon as
the master isnt the first result(which is exactly what you describe: a
bot in-between them) =) am I right?
>
> kindly,
> Mark.
>
>
> --- Em seg, 1/12/08, zendarva <zendarva@...> escreveu:
>
> > De: zendarva <zendarva@...>
> > Assunto: [grobots] Kinda confused on sensors...
> > Para: grobots@yahoogroups.com
> > Data: Segunda-feira, 1 de Dezembro de 2008, 1:02
> > I'm trying to set one bot up to follow another, at first
> > i had no
> > problem, but as the number of bots increase I see something
> > strange
> > happening. Whenever the follower has another bot between
> > it and the
> > bot it's following my routine for scanning seems to
> > break and I can't
> > understand why.
> >
> > follow-owner:
> > do
> > num-robot-results 0 = if
> > 1 lost!
> > return
> > then
> > robot-id owner-id = if
> > robot-position owner-pos!
> > ;found the owner, move to em.
> > return
> > then
> > next-robot
> > 0 = while-loop
> > 1 lost!
> >
> > It seems that sometimes num-robot-results is 0 even when
> > there are
> > multiple robots in sensor range and the sensor was
> > fired/synced the
> > frame before. Or that sometimes even if num-robot-results
> > is correct,
> > next-robot returns 0 when moving from the first result to
> > the second,
> > even when there are several remaining results.
> >
> > I'm not quite sure what could be wrong here, any help
> > would be
> > appreciated.
>
>
> Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com
>
at first glance, I would say that when you reach the end of the loop, you invert
the test for the while.. so it will break as soon as the master isnt the first
result(which is exactly what you describe: a bot in-between them) =) am I right?
kindly,
Mark.
--- Em seg, 1/12/08, zendarva <zendarva@...> escreveu:
> De: zendarva <zendarva@...>
> Assunto: [grobots] Kinda confused on sensors...
> Para: grobots@yahoogroups.com
> Data: Segunda-feira, 1 de Dezembro de 2008, 1:02
> I'm trying to set one bot up to follow another, at first
> i had no
> problem, but as the number of bots increase I see something
> strange
> happening. Whenever the follower has another bot between
> it and the
> bot it's following my routine for scanning seems to
> break and I can't
> understand why.
>
> follow-owner:
> do
> num-robot-results 0 = if
> 1 lost!
> return
> then
> robot-id owner-id = if
> robot-position owner-pos!
> ;found the owner, move to em.
> return
> then
> next-robot
> 0 = while-loop
> 1 lost!
>
> It seems that sometimes num-robot-results is 0 even when
> there are
> multiple robots in sensor range and the sensor was
> fired/synced the
> frame before. Or that sometimes even if num-robot-results
> is correct,
> next-robot returns 0 when moving from the first result to
> the second,
> even when there are several remaining results.
>
> I'm not quite sure what could be wrong here, any help
> would be
> appreciated.
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
I'm trying to set one bot up to follow another, at first i had no
problem, but as the number of bots increase I see something strange
happening. Whenever the follower has another bot between it and the
bot it's following my routine for scanning seems to break and I can't
understand why.
follow-owner:
do
num-robot-results 0 = if
1 lost!
return
then
robot-id owner-id = if
robot-position owner-pos!
;found the owner, move to em.
return
then
next-robot
0 = while-loop
1 lost!
It seems that sometimes num-robot-results is 0 even when there are
multiple robots in sensor range and the sensor was fired/synced the
frame before. Or that sometimes even if num-robot-results is correct,
next-robot returns 0 when moving from the first result to the second,
even when there are several remaining results.
I'm not quite sure what could be wrong here, any help would be
appreciated.
> Appearantly the
> backup utility didn't think '.gb' file were
> worthy of backup space.
LOL!
--- Em fri, 28/11/08, Matt Burkholder <mattburk@...> escreveu:
> De: Matt Burkholder <mattburk@...>
> Assunto: [grobots] Re: Newbie, curious about activity.
> Para: grobots@yahoogroups.com
> Data: Sexta-feira, 28 de Novembro de 2008, 11:56
> I have been spending some time upgrading sides.
>
> Devon and Warren, what are the latest versions of my sides
> that you
> have. I had a hard drive crash and lost some work.
> Appearantly the
> backup utility didn't think '.gb' file were
> worthy of backup space.
>
> Matt
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
I have been spending some time upgrading sides.
Devon and Warren, what are the latest versions of my sides that you
have. I had a hard drive crash and lost some work. Appearantly the
backup utility didn't think '.gb' file were worthy of backup space.
Matt
Starting with a seed, and syphoners to feed it, it produces a seed
which randomly moves away to a space at least 5, at max 10 away from
any other established seed,(it checks where it's going first, so it
doesn't just wander randomly for a while) then starts growing its own
colony of syphoners. The idea is to have them far enough apart they
don't interfere with each other, but close enough that when I start
writing a defense type , they can support each other.
I haven't really looked at any of the more advanced sides already
written, just the stuff in the classics directory you get with the
download. I wanted to look through the repository, but the link
wasn't working.
--- In grobots@yahoogroups.com, Antonio Marcos <amcmr2003@...> wrote:
>
> > That's good to hear, gives me some motivation to work
> > on the bot I'm
> > tinkering with.
> >
> > Right now I'm still trying to learn the language by
> > building
> > organizing, self distancing autotroph colonies. It's
> > definatly
> > entertaining.
>
> Self Distancing.. cool! What exactly does it mean? =)
>
> Yes! In 2 weeks I should be more free.. hopefully others will come
back too after those emails.
>
> regards,
> Mark.
> That's good to hear, gives me some motivation to work
> on the bot I'm
> tinkering with.
>
> Right now I'm still trying to learn the language by
> building
> organizing, self distancing autotroph colonies. It's
> definatly
> entertaining.
Self Distancing.. cool! What exactly does it mean? =)
Yes! In 2 weeks I should be more free.. hopefully others will come back too
after those emails.
regards,
Mark.
--- Em qui, 27/11/08, zendarva <zendarva@...> escreveu:
> De: zendarva <zendarva@...>
> Assunto: [grobots] Re: Newbie, curious about activity.
> Para: grobots@yahoogroups.com
> Data: Quinta-feira, 27 de Novembro de 2008, 10:51
> --- In grobots@yahoogroups.com, Antonio Marcos
> <amcmr2003@...> wrote:
> >
> > We had some Tournaments a few times recently, but I
> for one been
> quite away, due to university draining my spare time. I was
> actually
> wishing to come back in the next few weeks, since I'll
> be on vacation
> for 2-3 months..
> >
> > Kindly,
> > Mark.
>
>
> That's good to hear, gives me some motivation to work
> on the bot I'm
> tinkering with.
>
> Right now I'm still trying to learn the language by
> building
> organizing, self distancing autotroph colonies. It's
> definatly
> entertaining.
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
--- In grobots@yahoogroups.com, Antonio Marcos <amcmr2003@...> wrote:
>
> We had some Tournaments a few times recently, but I for one been
quite away, due to university draining my spare time. I was actually
wishing to come back in the next few weeks, since I'll be on vacation
for 2-3 months..
>
> Kindly,
> Mark.
That's good to hear, gives me some motivation to work on the bot I'm
tinkering with.
Right now I'm still trying to learn the language by building
organizing, self distancing autotroph colonies. It's definatly
entertaining.
We had some Tournaments a few times recently, but I for one been quite away, due
to university draining my spare time. I was actually wishing to come back in the
next few weeks, since I'll be on vacation for 2-3 months..
Kindly,
Mark.
--- Em qui, 27/11/08, zendarva <zendarva@...> escreveu:
> De: zendarva <zendarva@...>
> Assunto: [grobots] Newbie, curious about activity.
> Para: grobots@yahoogroups.com
> Data: Quinta-feira, 27 de Novembro de 2008, 7:56
> I just encountered Grobots, and playing with it it seems
> quite fun,
> but I'm curious if there's any actual activity
> going on anymore
> anywhere for it, and if there would be much point in
> getting involved?
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com