Skip to content

Controllability

Asunaya edited this page Oct 26, 2017 · 1 revision

Controllability (CA) is the integral weapon statistic in zitem.xml that controls individual weapons' amount of spread. To calculate the aperture of the weapon's spread cone. you divide the CA by 1000 and then multiply it by the player's current "CA factor," which gives you the angle in radians.1

The player's CA factor is dependent on a CA factor constant inherent to each weapon type, shown below.2

Weapon type CA factor
Pistol 0.3
Submachine gun 0.3
Revolver 0.35
Shotgun 1
Rifle 0.25
Machine gun 0.3
Rocket launcher 1

Every time the player shoots, the player CA factor is increased by the weapon type CA factor.3 Every 200 milliseconds, the game checks if the player is holding the Fire button, and if not, decreases the player CA factor by the weapon type CA factor.4 Additionally, the player CA factor cannot go below the weapon type CA factor5, nor can it go above 16. (This entails that a weapon with a weapon type CA factor of 1 never changes accuracy.)

Note that the weapon CA specified in zitem.xml does not affect shotguns. Shotguns have a fixed CA of 1007, applied to each pellet.

1: HitRegistration.cpp:15

2: ZMyCharacter.cpp:2327-2333

3: ZMyCharacter:660-684

4: ZMyCharacter:2402-2416, ZMyCharacter:44

5: ZMyCharacter:2415

6: ZMyCharacter:683

7: HitRegistration.h:40 tells us that the angle used is 0.1 radians. Given that the shotgun weapon type CA factor is 1, the equation is CA / 1000 * 1 = 0.1. Solving for CA, we get 100.

Clone this wiki locally