Bots and Simulations > Bot Tavern
Communication networks
Welwordion:
Ugh, I just realize I have to somehow prevent the bot from storing the coordinates from his partner or child into satposx and satposy.
(this repro movement makes it somewhat hard to keep information running. Hmm, does the racial memory work properly? Then I maybe could use that and slow down movement a little bit?)
Welwordion:
Ok its still incomplete but here is the code I made so far (for reference whats need to be down look at the end of the code).
Note: Its not tested yet so it might be quite buggy
--- Code: ---'x coordinates are stored into out3, y coordinates are stored in mkshell and tielen
'the x and y distances to the network access are assumed to be 2 digits numbers and are
'stored into body with a loss of accuracy.
'when swarming is 0(no) head and eye will store the heads information into out1 and out2
'vice versa when swarming is >0(yes) head and eye will store the eyes information into out1 and out2
'the head will move towards the coordinates in out1 and out2
def function 50
'(0= head 0> eye)
def swarming 55
'(0=prioritize food in sight 0> prioritize network orders)
'initialize (includes MB grow routine which is used for moving)
'enable reading of x coordinatess from eye
cond
*.tmemloc .out3 !=
start
.out3 .tmemloc store
stop
'complete the bot, become the eye and face toward network access
cond
*.numties 0 =
*.function 0 =
start
90 .repro store
.function inc
*.xpos *.body 100 mod *.body 10 mod sub add *.ypos *.body 10 mod add angle .setaim store
stop
'form the tie and turn away
cond
*100 0 =
*.refeye *.myeye =
start
17 .tie store
618.aimdx store
100 inc
stop
'data storage
'x coordinate of enemy into out3
cond
*.refeye *.myeye !=
*.refxpos *.out3 sub abs 50 >
start
*.refxpos .out3 store
stop
'first 3 digits of y coordinate of enemy into last 3 digits of shell
cond
*.refeye *.myeye !=
*.refypos *.refypos 100 mod sub 100 div *.shell 1000 mod !=
start
*.refypos *.refypos 100 mod sub 100 div *.shell 1000 mod sub .mkshell
stop
'last 2 digits of y coordinate of enemy into last 2 digits of tielen
cond
*.refeye *.myeye !=
*.refypos 100 mod *.tielen 100 mod sub abs 50 >
start
*.refypos 100 mod .fixlen store
stop
'x coordinate of network target into out3
cond
*.refeye *.myeye =
*.in1 *.out3 sub abs 50 >
start
*.in1 .out3 store
stop
'first 3 digits of y coordinate of network target into last 3 digits of shell
cond
*.refeye *.myeye =
*.in2 *.in2 100 mod sub 100 div *.shell 1000 mod !=
start
*.in2 *.in2 100 mod sub 100 div *.shell 1000 mod sub .mkshell
stop
'last 2 digits of y coordinate of network target into last 2 digits of tielen
cond
*.refeye *.myeye =
*.in2 100 mod *.tielen 100 mod sub abs 50 >
start
*.in2 100 mod .fixlen 100 add store
stop
'x distance to network access is stored into second last digit of body and ypos into last digit
cond
*.refeye *.myeye =
*.function 0 >
*.body 100 mod *.refxpos *.xpos sub *.refxpos *.xpos sub 10 mod sub *.refypos *.ypos sub *.refypos *.ypos sub 10 mod sub 10 div add !=
start
*.body 100 mod *.refxpos *.xpos sub *.refxpos *.xpos sub 10 mod sub *.refypos *.ypos sub *.refypos *.ypos sub 10 mod sub 10 div add sub dup dup dup
sgn 1 add 2 div .fdbody store
sgn 1 sub 2 div .strbody store
stop
'head gets info about network access and transforms distances according to his own position.
cond
*.function 0 =
*.body 100 mod *.trefbody 100 mod *.trefxpos *.xpos sub *.trefxpos *.xpos sub 10 mod sub add *.trefypos *.ypos sub *.trefypos *.ypos sub 10 mod sub 10 div add !=
start
*.body 100 mod *.trefbody 100 mod *.trefxpos *.xpos sub *.trefxpos *.xpos sub 10 mod sub add *.trefypos *.ypos sub *.trefypos *.ypos sub 10 mod sub 10 div add sub dup dup dup
sgn 1 add 2 div .fdbody store
sgn 1 sub 2 div .strbody store
stop
'target choosing
'head uses his x coordinate
cond
*.function 0 =
* swarming 0 =
start
*.out3 .out1 store
stop
'head uses eyes x coordinate
cond
*.function 0 >
* swarming 0 >
start
*.tmemval .out1 store
stop
cond
'head uses his y coordinate
*.function 0 =
* swarming 0 =
start
*.shell 1000 mod 100 mult *.tielen 100 mod add .out1 store
stop
cond
'head uses eyes y coordinate
*.function 0 =
* swarming 0 =
start
*.trefshell 1000 mod 100 mult *.tielen 100 mod add .out1 store
stop
'movement
'aim at target
cond
start
*.out1 *.out2 .setaim store
stop
'aim at attacker
cond
.hit 0 !=
start
*.shang .setaim store
stop
'through the killing of the eye the MB grow routine is used for moving
cond
*.numties 0 !=
*.eye5 40 <
*.function 0 =
*.out1 *.out2 add 0 !=
start
100 .sharenrg store
stop
'satellites and reproduction
'swarming or not swarming?
'waste and weight`
'feeding and defending
end
--- End code ---
Note : I attached the simplified version I made to run this bot unfortunately its only moving to the left could not figure out why :/.
Welwordion:
As currently ties are a little buggy I will postpone the two bot Mb apprach and concentarte on concepts that leave satellites, wires behind to communicate information.
Navigation
[0] Message Index
[*] Previous page
Go to full version