Jump to content

XML:ONCC: Difference between revisions

116 bytes added ,  12 October 2021
m
copy-edited <VisionConstants>
(clarifying <WeaponSkills>)
m (copy-edited <VisionConstants>)
Line 504: Line 504:


===<VisionConstants>===
===<VisionConstants>===
;Vision Field
The "range" and "max" values are logically angles but the cosine of the angle is stored instead for performace reasons. We have the following angles (in 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°
|}
Within "range" the "distance" field is used to compute visibility (character is visible if the distance between AI and character is < "distance" field). Between "range" and "max" the visibility distance decreases gradually towards 0. The vision field can be made visible with the script command *ai2_showvision =1* but it should be noted that the rendering might not be accurate. In particular the peripheral vision field it's missing the central segment.
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=150px| XML tag
!width=120px| content type
!width=120px| Content type
! description
! Description
|-
|-
| <CentralDistance>
| <CentralDistance>
| float
| float
| central vision distance
| Central vision distance
|-
|-
| <PeripheralDistance>
| <PeripheralDistance>
| float
| float
| peripheral vision distance
| Peripheral vision distance
|-
|-
| <VerticalRange>
| <VerticalRange>
| float
| float
| vertical vision range
| Vertical vision range
|-
|-
| <CentralRange>
| <CentralRange>
| float
| float
| central vision range
| Central vision range
|-
|-
| <CentralMax>
| <CentralMax>
| float
| float
| central vision max
| Central vision max
|-
|-
| <PeripheralRange>
| <PeripheralRange>
| float
| float
| peripheral vision range
| Peripheral vision range
|-
|-
| <PeripheralMax>
| <PeripheralMax>
| float
| float
| peripheral vision max
| 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.==