Welcome To Darwinbots > Newbie

Ties not working for some reason

(1/3) > >>

Bluchrome:
Ive been using DB for about 2 days now and I have a couple of questions and requests


1. Would anyone find time to post a list of all 'static' sysvariables. I need to know which ones change
2. Can anyone tell me why this bot refuses to shoot ties(it's not complete by the way)
3. if nrg is not maxed but the bot recieves nrg that will exceed the maxium is the difference converted to
    body. Or is excess nrg only converted to body when nrg = 32000 thus rendering the difference lost.


[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']' binary dormite
' Designed and refined by Bluchrome
' Atempt at a linear 2nd degree multibot
' the head feeds and the tail produces venom
' and poison and reproduces


' --------------------constants------------------

' types
def head 1003
def tail 1002
def notype 989
'not implemented as of yet

'conspec id
def conspec 230


'---------------memory locations----------------
def type 100
def tie 120
' unused right now
def hibernate 121
' 0 = not hibernating
' 1 = hibernating
' unused right now
def rotate 122
' 0 = rotate
' 1 = not to rotate
' set by the tie gene to prevent rotating before ties are formed




' -----------------initialize---------------------
'store initial bot type
cond
*.robage 0 =
start
.notype .type store
.conspec dup .out5 store
.tout5 store
stop


' -----------------body regulation------------------

' keeps the body at 1/3 of nrg as long as more than 900 body is there
' found this gene in the forums pretty neat modified it a bit

cond
*.body 900 >
*.nrg 32000 !=
start
*.nrg 3 div *.body sub .strbody store
stop


cond
*.body 900 <=
*.nrg 20000 >
start
100 .strbody store
stop

' ---------------- tie counter----------------------


cond
*.numties *.out10 !=
start
*.numties .out10 dup store .tout10 store
stop

'---------------despecialize-------------------------
cond
*.numties 0=
*.type .notype !=
start
.notype .type store
stop

' -----------------tie shooter---------------------
'disables rotating so that ties dont miss
cond
*.rotate 0 !=
start
0 .rotate store
stop


cond
*.numties 0 =
*.in5 *.out5 =
*.eye5 30 >
*.in10 0 =
start
.tie inc
.readtie inc
.rotate inc
stop

' --------------food finding---------------
'food finder

'only unspeciated or heads can find food
cond
 *.eye5 0 >
*.eye5 70 <
*.in5 *.out5 !=
*.type .notype =
*.type .head = or
start
*.refxpos *.refypos angle .setaim store
 *.refveldx .dx store
 *.refvelup 30 add .up store
stop

'--------------feeding----------------------
cond
*.eye5 70 >=
*.in5 *.out5 !=
*.type .notype =
*.type .head = or
start
4 .shootval store
*.refxpos *.refypos angle .setaim store
-1 .shoot store
*.refvelup .up store
stop



' -----------------idling--------------------
' aka search and destroy

cond
*.eye5 0 =
*.in5 *.out5 = or
*.robage 1 >
*.hibernate 0 =
*.rotate 0 =
start
*.aim 400 rnd 200 sub add .setaim store
30 *.vel sub 2 div rnd .up store
stop

'if hibernating dont roam just rotate
cond
*.eye5 0 =
*.in5 *.out5 = or
*.hibernate 1 =
*.rotate 0 =
start
140 rnd .aimsx store
stop


' ------------------counter(anti) tie------------------




'-----------------counter tie feed------------------
cond
*.tin5 *.out5 !=
*.trefnrg 0 >
start
-1 .tieloc store
-1000 .tieval store
stop

'-----------------hibernate genes----------------------
'bots cant hibernate till there 30 to prevent newborns from immediately hibernating
'because of lack of resources.
' Hibernated bots still look for food but they dont move anymore

cond
*.nrg 2700 <
*.hibernate 0 =
*.robage 29 >
start
.hibernate inc
stop

cond
*.nrg 9000 >
*.hibernate 1 =
start
.hibernate dec
stop

end



ive made a couple of tie feeders and they shoot just fine so what is the problem with him

EricL:
Hi and welcome.


--- Quote from: Bluchrome ---1. Would anyone find time to post a list of all 'static' sysvariables. I need to know which ones change
--- End quote ---
There are several recent topics in the Newbie forum with links to the official sysvar list topic.  The Wiki is also up to date as far as I know.


--- Quote from: Bluchrome ---2. Can anyone tell me why this bot refuses to shoot ties(it's not complete by the way)
--- End quote ---

You have redefined the string "tie" to a location different from that used for creating ties, thus with the DNA is parsed, your tie code stores to location 120 instead of location 330.  Stores to location 120 don't do anything and will not cause a tie to be created.


--- Quote from: Bluchrome ---3. if nrg is not maxed but the bot recieves nrg that will exceed the maxium is the difference converted to
    body. Or is excess nrg only converted to body when nrg = 32000 thus rendering the difference lost.
--- End quote ---

The difference is converted to body.  No nrg is lost.  BTW, excess nrg overflowing to body only works for nrg shots.  Tie feeding nrg or sunlight nrg for veggies for example does not currently overflow to body.  In these cases, the nrg is lost.

Bluchrome:
Ah I see strangly when I first began coding I realized the alias and made a mental note to change it to ties must have slipped my mind.

I think you misunderstand what I said. What I mean is a list of sysvars which are persistent as far as I know the wiki doesnt explicitly state )for many vars) whether a var is maintained across cycles.

Thank you for the help!!!

EricL:
Hmmm.  I don't think an exhaustive list exists as such currently.  It depends on the sysvar and the wiki documentation should tell you whether a sysvar gets reset or not, but it is probably not as clear or forthcoming as it should be.  (Feel free to improve it!!!!!)

Any mem location not explicitly reset by the simulator should persist across cycles.  This includes all the user-defined locations for sure.   All the sysvars that tell the simulator to do something for a single cycle like all the movement sysvars, .tie, .shoot, .backshoot, .repro, .mrepro, .fixpos and so on obviously get reset.  All the ones that are essentially informational and read only like all the .eyeX sysvars, .hit, .fixed, .numties, .fertilized, .poison, .shell, .body, .tiepres, all the refvars and trefvars and so on will contain a value written by the simulator for that cycle and thus will nuke any DNA written value each cycle.  Sticky control sysvars like the .eyeXdir and .eyeXwidth and .readtie (I think) should not get reset.  The rest are case by case.  It should be easy to tell by looking at the bot's memory using the bot properties dialog or the console.

Bluchrome:
I will check out the memory consistency in my spare time with the console (I was trying to avoid that) and possibly update the wiki in my spare time. I was asking because somewhere I saw that the eye reference values are persistent even when the current focus eye 'sees' nothing causing basically a phantom bot.


Thanks for the help/suggestions (its so hard to spot coding errors sometimes when you program )

Navigation

[0] Message Index

[#] Next page

Go to full version