Bots and Simulations > DNA - General
Tie Feeding Idea
strangers:
I guess I might aswell show the whole thing incase I did make any errors:
--- Code: ---'Initialize
'*******
cond
*.robage 0 =
start
1 .tie store
13 56 store
100 rnd 55 store
mult 648
stop
cond
*.robage 1 =
start
1 .deltie store
stop
'Wide search 1
'************
cond
*.eye1 *.eye5 >
start
mult -100
stop
'Wide search 2
'************
cond
*.eye9 *.eye5 >
start
mult 100
stop
' Simple search pattern
'*******************
cond
*.eye3 *.eye5 >
start
mult -25
stop
'Simple search pattern part 2
'************************
cond
*.eye7 *.eye5 >
start
mult 25
stop
' Moving
'**********
cond
*.vel 30 <
*.refeye *56 !=
start
30 *.vel sub 2 div .up store
stop
' Obtaining Food
'*************
cond
*.eye5 40 >
start
-1 .shoot store
stop
'Avoid conspecifics
'***************
cond
*.refeye *56 =
start
mult 180
stop
' Gene 12
cond
*50 0 >
start
mult 628
50 dec
stop
‘Rotate back and continue feeding
'****************************
cond
*50 0 >
start
mult 628
50 dec
stop
'Reproduction
'****************
cond
*.nrg 10000 >
start
mult 628
50 inc
20 .repro store
stop
cond
*.robage 199 =
start
0 .repro store
stop
cond
*.robage 199 >
*.nrg 10000 >
start
mult 628
50 inc
20 .mrepro store
stop
‘Perform the rotation
'************************
cond
start
.aimdx store
stop
'Tie Feeding
'****************
cond
*.eye5 30 >
*.eye4 *.eye6 =
*.refeye *56 !=
*.numties 0 >=
*.numties 3 <
start
*55 .tie store
*56 .readtie store
stop
cond
*.numties 0 >
start
-1 .tieloc store
-1000 .tieval store
*55 .tienum store
stop
Cond
*.trefeye *56 =
start
*55 .deltie store
stop
'Slime Managemant
'************************
cond
*.slime 90 <
start
100 .mkslime store
stop
'Waste Management
'*************************
cond
*.waste 100 >
start
1 .backshoot store
-4 .shoot store
*.waste .shootval store
stop
end
--- End code ---
Please, feel free to point out anything that needs reworking.
EDIT: Removed mutant, stretched page too much.
EricL:
--- Quote from: Sprotiel ---No, he's not! The value stored is put on the stack in previous genes, with the "mult 628" statements.
--- End quote ---
Guess I should spend more than 10 seconds before I reply next time...
Jez:
--- Quote from: strangers ---And can anyone suggest a way to make the bots not fire ties at each other immediatly after birth? Wait, if when the bot gives birth their both facing each other the wouldn't this code make them rotate away from eachother before they fire the ties?
--- Code: ---'Initialize
'*************
cond
*.robage 0 =
start
1 .tie store
13 56 store
100 rnd 55 store
mult 648
stop
cond
*.robage 1 =
start
1 .deltie store
stop
--- End code ---
--- End quote ---
You could remove the 1.tie store instruction in the first gene to stop it tieing to it parent at birth, it may be using a different method to tie to parent at birth though. This would leave them tied by the birth tie and make the second gene, pointless. I'd have to check order of instructions to see if it is turning away from parent before tieing to parent 2bh. I'll see if I can find the post and link it.
Regards the full dna you posted, gene 12 & 13 are the same, you don't have a body check in the repro genes which may cause your bots to get smaller and smaller. Other than that, seeing as I haven't tried it or unless you've spotted something it's not doing which it should be, it looks fine.
I'm guessing that second lot of full DNA is a mutated bot. Pointless me reading it really, every time you repeated it or, pretty much, every bot you check should show different changes in the dna! That -34 in gene 3 for instance is a mutation.
I'm guessing this is your first bot, as soon as it's working to your satisfaction and if you'd like to give it a name I'll put it in the bestiary and hopefully run it in the league soon.
EDIT
Order of Actions
So yes, it is turning before firing tie at parent, (if it is not already deleting birth tie) perhaps moving the turning command to the second gene would help. Also you can disable the other turning genes by adding *.robage 1 > to their conditions.
Ah, no conspec recognition for firing -1 shots so parent would get shot.
I'd have to check each of these things by watching bot, your code may well use other methods to deal with them.
strangers:
Well then I can remove the tie firing and deleting parts, I was using them to allow them to seperate before they start shooting eachother. Conspec recognition would be helpful with -1 shots. I just noticed the rotate and cont. feeding gene is in there twice. Well, I'll make the modifications, repost the dna.
What would a gene(s) look like that would make a bot drop a tie on another bot or veg after 19 cycles, make a 180 rotation, refire the tie, and then continue feeding. I can do most of it but I'm not sure how to make the bot drop the tie after 19 cycles.
Jez:
I'm useless with ties but I guess something like;
cond
*.counter 19 =
start
1 .deltie store
stop
You just need the bot to count the 19 cycles after it fires the tie and then use the count as a condition for deleting the tie. (*.counter is not a sysvars)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version