Bots and Simulations > DNA - General

Tie Feeding Idea

(1/5) > >>

strangers:
Well, I'm working on tie feeding and was wondering if I could modify the tie feeding gene from Purple Youko's 2.13 tutorial to allow a bot to pick up a veggie or bot, attach to it for set amount of time and extract a set amount of energy then release it, reproduce, and repeat. This is all I have:

--- Code: ---cond
*.eye5 77 !=
*.eye5 30 >
*.eye4 *.eye6 =
*.refeye *56 !=
*.numties 0 =
start
*55 .tie store
*56 .readtie store
stop

cond
*.numties 0 >
start
-1 .tieloc store
*.refenergy 2 div .tieval store
*55 .tienum store
stop

Cond
*.trefeye *56 =
start
*55 .deltie store
stop
--- End code ---
*55 Has been set as a random number before hand.
*56 Has been set for the .refeye value before hand.
Any suggestions?
And I also wondering if I could modify the gene to cause it to attach to a veg and another bot and make it transfer waste from the veg into the first bot and then into the second bot until it reaches the waste threshold and dies. Wait, does reaching the waste threshold make a bot die?.....

Numsgil:
Welcome


--- Quote from: strangers ---Well, I'm working on tie feeding and was wondering if I could modify the tie feeding gene from Purple Youko's 2.13 tutorial to allow a bot to pick up a veggie or bot, attach to it for set amount of time and extract a set amount of energy then release it, reproduce, and repeat.
--- End quote ---

Yes, this is possible.  However, PY's original tutorial is a little old, so you're going to need to play with things a little.  The condition *.eye5 77 != probably won't work as advertised anymore, although that's a minor point.  You've also "misspelled" refnrg as refenergy.  If you load your bot into the program, right click on it, and select "robot details", you can look at what the program thinks the DNA looks like.  This is a good way for finding these sorts of problems.  They'll show up as 0s.

More specific DNA help usually starts to fry my brain.  Elite is good at manipulating DNA, so I'll leave the rest to him.


--- Quote ---And I also wondering if I could modify the gene to cause it to attach to a veg and another bot and make it transfer waste from the veg into the first bot and then into the second bot until it reaches the waste threshold and dies. Wait, does reaching the waste threshold make a bot die?.....
--- End quote ---

Bots whose pwaste + waste exceed the waste threshold will start to behave funny, because random numbers will start to be stored into the genome.  It usually causes cell death one way or another after a thousand cycles or less.

strangers:
The reason that I typed .refnrg as .refenergy was because I was typing from memory I guess I missed it.
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

'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
--- End code ---
This is the actuall reproduction gene with the added turning gene added to the initialize gene.

EricL:
You are missing the value that you actually want to store into .aimdx in your turning gene.  Try

cond
start
628 .aimdx store
stop

Sprotiel:

--- Quote from: EricL ---You are missing the value that you actually want to store into .aimdx in your turning gene.  Try

cond
start
628 .aimdx store
stop
--- End quote ---
No, he's not! The value stored is put on the stack in previous genes, with the "mult 628" statements.

Navigation

[0] Message Index

[#] Next page

Go to full version