18,700
edits
(clarifying <WeaponSkills>) |
m (copy-edited <VisionConstants>) |
||
Line 504: | Line 504: | ||
===<VisionConstants>=== | ===<VisionConstants>=== | ||
{| class="wikitable" width="100%" | {| class="wikitable" width="100%" | ||
!width=150px| XML tag | !width=150px| XML tag | ||
!width=120px| | !width=120px| Content type | ||
! | ! Description | ||
|- | |- | ||
| <CentralDistance> | | <CentralDistance> | ||
| float | | float | ||
| | | Central vision distance | ||
|- | |- | ||
| <PeripheralDistance> | | <PeripheralDistance> | ||
| float | | float | ||
| | | Peripheral vision distance | ||
|- | |- | ||
| <VerticalRange> | | <VerticalRange> | ||
| float | | float | ||
| | | Vertical vision range | ||
|- | |- | ||
| <CentralRange> | | <CentralRange> | ||
| float | | float | ||
| | | Central vision range | ||
|- | |- | ||
| <CentralMax> | | <CentralMax> | ||
| float | | float | ||
| | | Central vision max | ||
|- | |- | ||
| <PeripheralRange> | | <PeripheralRange> | ||
| float | | float | ||
| | | Peripheral vision range | ||
|- | |- | ||
| <PeripheralMax> | | <PeripheralMax> | ||
| float | | float | ||
| | | Peripheral vision max | ||
|} | |} | ||
;Vision field | |||
An AI's vision field is composed of a central area and peripheral area. See [[AI#Vision_and_hearing|HERE]] for details and illustrations. Put in terms of the data fields above, a character is visible if the distance between the AI and the character is less than the "distance" field. Between each area's "range" and "max" settings, the visibility distance decreases gradually towards 0. The vision field can be seen with the scripting command '''ai2_showvision=1''', but it should be noted that the visualization of the peripheral vision field is missing its central segment. | |||
The "range" and "max" values are angles, but stored as cosines of the angles for performance reasons. Here are some sample angles converted from cosine to degrees: | |||
{| | |||
| | |||
: <VerticalRange>0.766044438</VerticalRange> | |||
: <CentralRange>0.819152057</CentralRange> | |||
: <CentralMax>0.57357645</CentralMax> | |||
: <PeripheralRange>0.1736482</PeripheralRange> | |||
: <PeripheralMax>-0.42261824</PeripheralMax> | |||
| | |||
: = 40° | |||
: = 35° | |||
: = 55° | |||
: = 80° | |||
: = 115° | |||
|} | |||
==ONCV, death particle, TRBS, TRMA, TRAC, TRAS, health, daodan, etc.== | ==ONCV, death particle, TRBS, TRMA, TRAC, TRAS, health, daodan, etc.== |