Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Bluchrome

Pages: [1]
1
Bot Tavern / Rogue genes
« on: January 31, 2010, 12:12:58 PM »
I took a long break from darwinbots. Just reintroduced myself yesterday and I started a little bot to get re-familiarized with DNA programming. For the most part everything is working OK. Except there's a gene activating when it shouldn't. Here is the gene along with the other relevant ones:

Some defines
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
def specIDloc     972
def specID        310
def sthreshold    20  'Distance at which the effects of the tracking gene gets deactivated and the feeding gene activates


(These aren't contiguous)
This sets the species' ID
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
'Set spec
cond
*.robage 0 =
start
.specID .specIDloc dup .memloc store store
stop


The problem gene is in this section
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
'Scan eyes
cond
*.eyef 0 =
*.memval *.specIDloc = or
start
.up 10 *.velscalar sub sgn 0 floor mult dup inc inc
*.timer 9 mod 4 sub .focuseye store
stop

'Center eye5 on prey
cond
*.eyef 0 !=
*.memval *.specIDloc !=
*.focuseye 0 !=
start
*.focuseye 140 mult .aimdx *.robage sgn mult store
0 .focuseye store
stop

'Track prey
cond
*.eye5 0 >
*.memval *.specIDloc !=
0 *.focuseye =
start
*.refvelup 50 add .up .sthreshold *.eye5 sub sgn 0 floor mult store
*.refxpos *.refypos angle .setaim *.robage sgn mult store
stop

The problem is the track prey gene gets activated even when eye5 'sees' the same species (despite the *.memval *.specIDloc != condition), and starts to chase it.
The only thing preventing it from continuously tracking it's own species is that the scan eyes gene is still activated and changes the focuseye the next cycle. So it results in intermittent tracking (of its own species) every 9 cycles. This bot works fine for non-specs and even though it doesn't shoot it's own species (the feed gene doesn't activate for conspecs), it is a wasteful behaviour and I really can't see why this gene is activating. I've used to console to evaluate the conditions and in the cycle that the track gene gets activated it shows that *.memval = 310 and *.specIDloc = 310. Also is *.timer capped at 32000 like *.robage?

BTW: The eyes' position and width have been changed to provide even 360 deg. vision

2
Newbie / Ties not working for some reason
« on: July 24, 2008, 02:26:44 PM »
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

Pages: [1]