Difference between revisions of "Eye"
m |
|||
Line 6: | Line 6: | ||
==Basic [[Sysvar]]s:== | ==Basic [[Sysvar]]s:== | ||
− | Eyes a bot to see and are key to almost everything a bot does. | + | Eyes allow a bot to see and are key to almost everything a bot does. |
A good animal bot should use at least one eye to be effective. | A good animal bot should use at least one eye to be effective. |
Revision as of 07:19, 21 October 2007
|
Basic Sysvars:
Eyes allow a bot to see and are key to almost everything a bot does.
A good animal bot should use at least one eye to be effective.
The eyes are numbered 1-9 from left to right. in version 2.4 and later you can tell exactly what is seen in each eye angle, by clicking on your bot.
.eye5 is the most important since it is in the middle, straight ahead of the bot. To use the Refvars eye5 needs to have something in it (and a bot needs to have at least one eye command-trust me--Endychat).
As of 2.43, a bunch of new eye stuff has been added
Eye focus
.eyef reads back the eye value of the current eye focus: the eye that reads refvars, .memval etc. Under normal circumstances, that would be eye5, but now, the focus can be changed using .focuseye.
Changing eye directions
The new .eyeNdir locations allow the direction each eye is looking to be changed. The value stored is treated as an offset from the eye's default direction. Values persit across cycles and are read/write.
Thus, storing 0 values in these locations results in the eyes pointing in their traditional directions. For example, the following gene results in .eye5's direction slowly rotating about the bot every 1256 cycles:
cond start *.robage .eye5dir store stop
To calculate absolute eye directions, one needs to know the default offset from .aim for each eye. The field of view for each eye is pi/18 radians or approx. 35 turning units. Thus, the default offsets for each eye from .aim are as follows:
.eye1 = (4 * pi/18) = 140 .eye2 = (3 * pi/18) = 105 .eye3 = (2 * pi/18) = 70 .eye4 = (1 * pi/18) = 35 .eye5 = 0 .eye6 = -35 .eye7 = -70 .eye8 = -105 .eye9 = -140
Note that the turning units are rounded.
The following gene points all eyes straight ahead, all overlapping .eye5
cond start -140 .eye1dir store -105 .eye2dir store -70 .eye3dir store -35 .eye4dir store 35 .eye6dir store 70 .eye7dir store 105 .eye8dir store 140 .eye9dir store stop
Changing eye widths
The new .eyeNwidth sysvars allow the width of the eyes to be changed.
A value of 0 indicates the default width of pi/18 radians (approx 35 bot rotation units). Storing positive values increases the eye width over and above the default width by .eyeNwidth /1256. Storing negative vaules narrows the eye width.
Note that a value of 1221 (1256 - 35) is equivalent to a value of -35 and represents a 360 degree field of view. Both postive and negative values are MODed such that an eyewidth value of 1222 is equivalent to a value of -34 which represents the smallest possible eyewidth of 1/1256 * 2 * pi