DarwinBotsManual
Open the app EspañolES

Eyes

The bot's nine eyes, the focus eye and the cells that aim and widen each eye: how a bot sees and what number each eye gives it.

AddressSysvarKindSummary
501.eye1SenseThe eye centered 40 degrees to the left of the front: 0 if it sees nothing, and the closer what it sees, the higher the value.
502.eye2SenseThe eye centered 30 degrees to the left of the front: 0 if it sees nothing, and the closer what it sees, the higher the value.
503.eye3SenseThe eye centered 20 degrees to the left of the front: 0 if it sees nothing, and the closer what it sees, the higher the value.
504.eye4SenseThe eye centered 10 degrees to the left of the front: 0 if it sees nothing, and the closer what it sees, the higher the value.
505.eye5SenseThe front eye: 0 if there is nothing ahead, and the closer what the bot has in front, the higher the value; it is the most used sense in bot DNA.
506.eye6SenseThe eye centered 10 degrees to the right of the front: 0 if it sees nothing, and the closer what it sees, the higher the value.
507.eye7SenseThe eye centered 20 degrees to the right of the front: 0 if it sees nothing, and the closer what it sees, the higher the value.
508.eye8SenseThe eye centered 30 degrees to the right of the front: 0 if it sees nothing, and the closer what it sees, the higher the value.
509.eye9SenseThe eye centered 40 degrees to the right of the front: 0 if it sees nothing, and the closer what it sees, the higher the value.
510.eyefSenseWhat the focus eye sees: repeats the value of the eye you chose with .focuseye, or that of .eye5 if you chose none.
511.focuseyeCommandChooses which of the nine eyes has the focus: the one copied into .eyef and the one that decides what the ref* cells describe.
521.eye1dirCommandTurns eye 1 relative to its factory position (40 degrees to the left): positive toward the left, negative toward the right; 1256 is a full turn.
522.eye2dirCommandTurns eye 2 relative to its factory position (30 degrees to the left): positive toward the left, negative toward the right; 1256 is a full turn.
523.eye3dirCommandTurns eye 3 relative to its factory position (20 degrees to the left): positive toward the left, negative toward the right; 1256 is a full turn.
524.eye4dirCommandTurns eye 4 relative to its factory position (10 degrees to the left): positive toward the left, negative toward the right; 1256 is a full turn.
525.eye5dirCommandTurns eye 5 relative to its factory position (straight ahead): positive toward the left, negative toward the right; 1256 is a full turn.
526.eye6dirCommandTurns eye 6 relative to its factory position (10 degrees to the right): positive toward the left, negative toward the right; 1256 is a full turn.
527.eye7dirCommandTurns eye 7 relative to its factory position (20 degrees to the right): positive toward the left, negative toward the right; 1256 is a full turn.
528.eye8dirCommandTurns eye 8 relative to its factory position (30 degrees to the right): positive toward the left, negative toward the right; 1256 is a full turn.
529.eye9dirCommandTurns eye 9 relative to its factory position (40 degrees to the right): positive to the left, negative to the right; 1256 is a full turn.
531.eye1widthCommandWidens eye 1: the wider it is, the more field it covers, but the shorter its range and the smaller its numbers.
532.eye2widthCommandWidens eye 2: the wider it is, the more field it covers, but the shorter its range and the smaller its numbers.
533.eye3widthCommandWidens eye 3: the wider it is, the more field it covers, but the shorter its range and the smaller its numbers.
534.eye4widthCommandWidens eye 4: the wider it is, the more field it covers, but the shorter its range and the smaller its numbers.
535.eye5widthCommandWidens eye 5: the wider it is, the more field it covers, but the shorter its range and the smaller its numbers.
536.eye6widthCommandWidens eye 6: the wider it is, the more field it covers, but the shorter its range and the smaller its numbers.
537.eye7widthCommandWidens eye 7: the wider it is, the more field it covers, but the shorter its range and the smaller its numbers.
538.eye8widthCommandWidens eye 8: the wider it is, the more field it covers, but the shorter its range and the smaller its numbers.
539.eye9widthCommandWidens eye 9: the wider it is, the more field it covers, but the less far it sees and the smaller its numbers get.

A bot has nine eyes, from .eye1 to .eye9, laid out like a fan around the direction it is pointing (.aim). Each eye is a cell that the engine fills in every cycle with a number: 0 if it sees nothing, and bigger the closer what it sees is. It is the most-used sense of all; almost any bot that looks for food or fights starts with something like *.eye5 0 >. How sight works inside is explained in Vision.

Where each eye looks

By default each eye covers 10 degrees. .eye5 looks straight ahead; the lower-numbered ones look to the left and the higher ones to the right, 10 degrees apart: .eye1 is centered 40 degrees to the left and .eye9 40 to the right. Together the nine cover 90 degrees. A large or close object can show up in several eyes at once.

What number they give

The value depends on the distance between the edges and on the eye's reach. With the factory eye, which reaches about 1440 units:

Distance between edgesValue
touching or overlapping32000
almost touchingabout 20700
134100
27825
7104
14301

Each eye gives the value of the closest thing it sees. At night the reach drops by 20%, and in pond mode it shortens with depth.

Configuring the eyes

The eyes can be re-aimed with .eye1dir….eye9dir and widened with .eye1width….eye9width; a wider eye sees less far and gives smaller numbers at the same distance. .focuseye chooses which eye is the focus eye: its value is copied into .eyef and what it sees fills the cells of what it sees. All these configuration cells stay as you leave them; writing them once is enough, for example in the first cycle:

' front eye a little wider and focus on the front eye
cond
*.robage 0 =
start
35 .eye5width store
0 .focuseye store
stop

What the eyes see arrives one cycle late: the engine writes it after moving everybody (see Execution and costs).