Difference between revisions of "Tie Tutorial"
(→Tie ID: AKA) |
(→Selecting a Tie) |
||
Line 103: | Line 103: | ||
*.tiepres .tienum store | *.tiepres .tienum store | ||
− | This will select the most recently formed tie, which is usually the one | + | This will select the most recently formed tie, which is usually the one you're interested in anyway. Remember that this will automatically select any tie to your bot, including those accidentally attached by family members. |
You can select other, older ties if you remember what "port" they were on. That is, the number you used for .tie. | You can select other, older ties if you remember what "port" they were on. That is, the number you used for .tie. |
Revision as of 22:31, 12 March 2006
Contents
Meet Animal Minimalis
This is Animal Minimalis: (He's been slightly modified to produce offspring with more energy, but otherwise he's the same)
'Animal Minimalis 'by Nums cond *.eye5 0 > *.refeye *.myeye != start *.refveldx .dx store *.refvelup 30 add .up store stop cond *.eye5 50 > *.refeye *.myeye != start -1 .shoot store *.refvelup .up store stop cond *.eye5 0 = *.refeye *.myeye = or start 314 rnd .aimdx store stop cond *.nrg 15000 > start 30 .repro store stop end
We're going to be using him to demonstrate some cool things using ties.
Ties
Ties are connections between bots that can be fired by putting a positive number into .tie.
Tie ID
The number that you put into .tie will be the tie's ID, sometimes called its port or (more rarely) phase.
If you want to detete a tie, you will need to put the tie's ID into .deltie. If you want to change or fix the angle of a tie, or change or fix it's length, or if you want to feed through a tie or use it to alter another bot's memory values you will need to store the tie's ID into .tienum.
Tiepres
You can readback the value of the last tie created by using *.tiepres. For example:
*.tiepres .tienum store
Will select the last tie created.
Deleting ties
To delete a tie simply store the tie ID into .deltie. Forgotten it? - simply use *.tiepres
*.tiepres .deltie store
Will delete the last tie created.
Deleting the Birth Tie
If you're a combat bot then efficiency counts. You definately don't want to be mucking about with an umbilical cord for the first few cycles of your life.
Combat bot programmers use a neat trick to remove that pesky birth tie.
First, fire a tie at your parent when you are born:
cond *.robage 0 = start .tie inc stop
Since only one tie can exist between two bots this will replace the birth tie.
You can then delete the new tie on the next cycle:
cond *.robage 1 = start .deltie inc stop
Note the use of inc and dec to save energy.
Put an anti-birth tie gene into Animal Minimalis and see how much better he does.
In this forum thread Nums comes up with a few very concise anti-birth tie genes.
Selecting a Tie
The easiest method to select a tie is with:
*.tiepres .tienum store
This will select the most recently formed tie, which is usually the one you're interested in anyway. Remember that this will automatically select any tie to your bot, including those accidentally attached by family members.
You can select other, older ties if you remember what "port" they were on. That is, the number you used for .tie.
4 .tie store
will create a tie with port 4.
4 .tienum store
will select a tie with port 4, whether you made it yourself or not.
Feeding through a tie
(Work in progress)
Leaching and Counter-Leaching
(Work in progress)
Sharing
(Work in progress)
Multibots
(Work in progress)
Batterybots
(Work in progress)
Changing the Angle and Length of Your Tie
(Work in progress)
The Tie Ports
(Work in progress)
The Tie-Reference Variables
(Work in progress)