Bots and Simulations > DNA - General
Ties help
Henk:
OK, here goes:
1. The beginning of ties: friendly cooperation
You see, when ties were first introduced they were given the ability to transfer energy in a multibot (=one organism that consists of multiple bots working together). This was done through tieloc -1.
For example, this is a gene used to transfer energy to another bot that is linked to a tie with a tiephase of 5:
--- Code: ---cond
*.nrg 5000 >
start
5 .tienum store ' the tie I'm adressing (in this example '5')
-1 .tieloc store ' the energy transfer tieloc
100 .tieval store ' the amount of energy to transfer
stop
--- End code ---
2. Friendly energy method turned into lethal weapon
Then, in october 2003, PY engineered a way to use this energy-transfer system as a weapon/feeding method.
What the tiebot (=bot that feeds through ties) could do in it's DNA is:
--- Code: ---' this first gene fires a tie with a phase of 5 at any bot
cond
*.eye5 30 >
start
5 .tie store
stop
' this gene feeds through the tie with a phase of 5
cond
*.numties 0 >
' when I have more the zero ties connected to me
start
5 .tienum store
' I adress ties with a phase of 5
-1 .tieloc store
' I adress tie energytransfer memory location
-1000 .tieval store
' I give "negatively", thus: I receive energy
stop
--- End code ---
3. involved sysvars
.tie => store a number in this to fire a tie with that phase
.tienum => sets the tie you are adressing
.tieloc => sets the memory location you are adressing
-> -1=energy transfer location
.tieval => sets the amount to store in that memory location
-> positive values => give energy
-> negative values => receive energy
I hope that has cleared up things a little.
Any questions, please ask. If I can't answer them I'm sure one of the real diehard DNA-programmers can
Henk
HazD:
Thanks for an explanation that I understand henk.
Using the code given to me be henk and elite I have created this bot (unanotated) that should tie feed off it's enemies and get rid of it's birth tie.
--- Code: ---'This is HazD's version of a tiebot.
'This uses code given to me by henk and elite
'Now I understand this code hopefully.
cond
*.robage 0 =
start
.tie inc
stop
cond
*.robage 1 =
start
.deltie inc
stop
'Gene find food
cond
*.eye5 0 >
*.eye5 50 <
*.myeye *.refeye !=
start
*.refveldx .dx store
*.refvelup 50 add .up store
stop
'Gene create tie with ID of 5
cond
*.myeye *.refeye !=
*.eye5 30 >
start
5 .tie store
stop
'Gene tie feed
cond
*.numties 0 >
start
5 .tienum store
-1 .tieloc store
-1000 .tieval store
stop
'Gene Avoid own kind
cond
*.eye5 0 =
*.refeye *.myeye = or
start
314 rnd .aimdx store
stop
'Gene reproduce
cond
*.nrg 4000 >
start
40 .repro store
stop
end
--- End code ---
Elite:
It seems to get tied to it's conspecs a lot.
I had the same problem when I tried to make a tiefeeder.
For some reason it seems to recognize it's babies as a non-conspec for a cycle or so - enough to tie to them.
I worked round the problem by not tieing to the parent on cycle 0, and deleting the tie (that was inevitably fired at you) on cycle 1, but that solution seems rather messy.
This is the reason I hate ties. They work fine in theory but there's a big difference between their theoretical behavior and how they act in practice
You'll probably need a gene to detect whether it's tied to a conspec and delete the tie if it is. Something like:
cond
*.numties 0 >
*.trefeye *.myeye !=
start
5 .deltie store
stop
But for this gene to work you'll need to store 5 in *.readtie somewhere, so that you can read trefvars, so add this code to your first gene (*.robage 0 =):
5 .readtie store
Did anyone else making tiefeeders come across this problem? If so how did you fix it?
Welwordion:
Does any of the commands work in 2.4 that changes the angle or length of a tie?
I wanted to use them but nothing happened
Numsgil:
When I worked on 2.4 I didn't touch ties. That means that the code may not work because it relied on something that was broken elsewhere.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version