What it feels through a tie (tref*)
The sysvars that tell you how the tied bot on the other side of a tie is doing: energy, body, age, position, velocity, signature and one cell of its memory.
| Address | Sysvar | Kind | Summary |
|---|---|---|---|
| 437 | .trefbody | Sense | The body of the tied bot at the other end of the tie you're reading. |
| 438 | .trefxpos | Sense | The horizontal coordinate of the tied bot, as it published it the previous cycle. |
| 439 | .trefypos | Sense | The vertical coordinate of the tied bot, as it published it the previous cycle. |
| 440 | .trefvelmysx | Sense | The relative velocity of the tied bot toward your left: it is .trefvelmydx with its sign flipped. |
| 441 | .trefvelmydx | Sense | How much faster than you the tied bot is moving toward your right. |
| 442 | .trefvelmydn | Sense | The relative velocity of the tied bot toward your back: it is .trefvelmyup with its sign flipped. |
| 443 | .trefvelmyup | Sense | How much faster than you the tied bot moves in the direction you are pointing. |
| 444 | .trefvelscalar | Sense | The speed of the tied bot, without direction: a copy of its .velscalar. |
| 445 | .trefvelyoursx | Sense | The leftward sideways velocity of the tied bot, measured from its own front: a copy of its .velsx. |
| 446 | .trefvelyourdx | Sense | The rightward sideways velocity of the tied bot, measured from its own front: a copy of its .veldx. |
| 447 | .trefvelyourdn | Sense | The backward velocity of the tied bot, measured from its own front: a copy of its .veldn. |
| 448 | .trefvelyourup | Sense | The forward velocity of the tied bot, measured from its own front: a copy of its .velup. |
| 449 | .trefshell | Sense | The shell that the tied bot at the other end of the tie has. |
| 456 | .trefup | Sense | How many times the tied bot's DNA writes to .up: part of its signature. |
| 457 | .trefdn | Sense | How many times the tied bot's DNA writes to .dn: part of its signature. |
| 458 | .trefsx | Sense | How many times the tied bot's DNA writes to .sx: part of its signature. |
| 459 | .trefdx | Sense | How many times the tied bot's DNA writes to .dx: part of its signature. |
| 460 | .trefaimdx | Sense | How many times the tied bot's DNA writes to .aimdx: part of its signature. |
| 461 | .trefaimsx | Sense | How many times the tied bot's DNA writes to .aimsx: part of its signature. |
| 462 | .trefshoot | Sense | How many times the tied bot's DNA writes to .shoot: part of its signature. |
| 463 | .trefeye | Sense | How many times the tied bot's DNA reads one of its eyes: the signature count most used to recognize members of your species. |
| 464 | .trefnrg | Sense | The energy of the tied bot at the other end of the tie you're reading. |
| 465 | .trefage | Sense | The age of the tied bot: tells you whether your parent or your child is on the other side. |
| 478 | .treffixed | Sense | It is 1 if the tied bot is fixed in place, 0 if it can move. |
| 479 | .trefaim | Sense | Where the tied bot is pointing: a copy of its .aim. |
A tie doesn't just join two bots: it is also a channel through which each one feels the other. The tref* sysvars are to ties what the ref* are to sight: instead of describing what the eye sees, they describe the bot on the other side of a tie, whether or not you can see it.
Which tie is read
A bot can have several ties, but the tref* describe only one at a time: the one with the port you put in .readtie or, if .readtie is 0, the one in .tiepres (the most recently created tie). If there is no tie with that port, or the bot has run out of ties, they all go to 0. Ports are explained in Ties and multicellular bots.
The engine loads them after the DNA runs, so your DNA always reads the snapshot taken in the previous cycle. Two timing details, checked by running it:
- A newborn child doesn't feel its parent until its fourth cycle of life (when its
.robageis 3). The one that creates the tie, on the other hand, feels it from the next cycle. - When the tie is broken, the
tref*still keep their last value for one cycle. If your gene depends on them, add*.numties 0 >(.numties).
What you can know
| What | Sysvars |
|---|---|
| State | .trefnrg, .trefbody, .trefage, .trefshell, .treffixed |
| Where it is and where it points | .trefxpos, .trefypos, .trefaim |
| How it moves, seen from you | .trefvelmyup, .trefvelmydn, .trefvelmysx, .trefvelmydx |
| How it moves, by its own measure | .trefvelyourup, .trefvelyourdn, .trefvelyoursx, .trefvelyourdx, .trefvelscalar |
| Its signature (what its DNA does) | .trefup, .trefdn, .trefsx, .trefdx, .trefaimdx, .trefaimsx, .trefshoot, .trefeye |
In addition, the channels .tin1….tin10 arrive through the same tie, along with any one cell of the other bot's memory via .tmemloc and .tmemval.
The most used in the Bestiary is, by far, .trefeye (compared with .myeye to tell whether the other is of your species); next come .trefnrg, .trefxpos and .trefage (the latter, to tell which is the parent and which is the child). This bot reproduces and the child, as soon as it feels that the tied bot is older than it is, breaks the tie with .deltie:
' Reproduces at 10 cycles
cond
*.robage 10 =
start
50 .repro store
stop
' If the tied bot is older than I am (my parent), I break the tie
cond
*.numties 0 >
*.trefage *.robage >
start
*.tiepres .deltie store
stopThe parent never breaks it: to it, the tied bot is younger. The child breaks it in its fourth cycle, the first one in which it feels its parent.