Bots and Simulations > Bot Tavern
Rogue genes
abyaly:
Nothing is spontaneously changing itself. It's just that the console is not an ideal debug tool. It reads the memory values between cycles. If you want to look at what they were during the DNA execution, you need to pull that kind of trick.
Bluchrome:
Ok I'll go try that out now. Let you know the results
Bluchrome:
I think I see the prob. Apparently the updating of eyef, memval lag behind the actual position of the focuseye (so my results lead me to conclude)
Here's what I did:
[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
*.memval 991 store
*.specIDloc 992 store
*.eyef 993 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
*.memval 994 store
*.specIDloc 995 store
*.focuseye 996 store
stop
'Gene X
cond
start
*.memval 997 store
*.specIDloc 998 store
*.eyef 999 store
*.focuseye 1000 store
stop
And I followed the memory changes in the robot DNA dialog box.
*ASB means as seen by.
(ASB scan eyes) (ASB track gene) (ASB Gene X)
memv sID eyef memv sID focus memv sID eyef focus
--------------------------------------------------------------------------
0 310 0 0 310 0 0 310 0 -1
0 310 0 0 310 0 0 310 0 0
310 310 9 0 310 0 310 310 9 1
Now the target bot was only visible in one eye (eye5) yet its ID only shows up in memval when focuseye = 1
Also eyef (when focuseye = 1, i.e. when eyef should = eye6) is equal to what eye5 is. Throughout everything I ensured that only eye5 could see the bot so it pretty conclusively shows that the updating lags (since at no point eye6 = 9).
The formatting changed from me typing to after it posted, so the columns of the table don't align as they should Sorry about that.
[edit] While I make no assertions about when these stores occur (I think that's irrelevant) the last quadruplet is guaranteed to have been taken at the same time.
Numsgil:
Not sure if you know already from your post, but make sure you understand that the entire DNA is executed before any action is taken by the bot.
Moonfisher:
Yeah, sound like the issue is simply that *.eyef is showing you the content of the current focus eye, but changing the value in focuseye won't have an effect till the beginning of the next cycle. (Nothing will happen mid cycle, the focus eye will not change and the value of eyef will not be updated till the cycle ends)
I think theres a post somewhere describing the sequence in which the commands are executed, but I'm fairly sure that focuseye takes effect before vision is updated (Generaly commands that affect vision or orientation will probably be executed before most other actions)
(My only remaining question on that matter is what happens when 2 bots are trying to affect eachothers .memloc or .memval location through ties... Does someone have priority or do they take turns going first?)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version