The Formula
From README.md Q9, the core calculation for yaw/pitch values is: Where:- X = desired yaw/pitch command value
- a = angle you need to rotate (in degrees)
- s = sensitivity (fixed at 1.0 for calculations)
- m_yaw = horizontal mouse sensitivity multiplier (fixed at 0.022)
Standard Sensitivity Values
The framework uses normalized sensitivity for all auto line-up calculations (csafap/logic.cfg:29):sensitivity 1.0provides a known baselinem_yaw 0.022is CS2’s default horizontal sensitivity ratiosensitivity_y_scale 1ensures vertical and horizontal sensitivities match
Simplified Formula
Withs = 1.0 and m_yaw = 0.022, the formula simplifies to:
For example:
- 90° turn:
X = 90 / 0.022 = 4090.909... - 45° turn:
X = 45 / 0.022 = 2045.454... - 180° turn:
X = 180 / 0.022 = 8181.818...
Vertical Zeroing Adjustment
Since version 2.15, the framework zeros vertical view angles at -89° (looking straight down) instead of 0° (csafap/logic.cfg:59):+4045.45454545 to calculated pitch values:
Why -89° instead of 0°?
Valve’s animgraph2 update (July 28, 2025) broke the old zeroing method. Starting from -89° provides a stable reference point that works reliably.Horizontal Zeroing
The framework zeros horizontal view angles using an extremem_yaw value (csafap/logic.cfg:58):
- Set
m_yawto absurdly high value - Execute
yaw 20 1 1(tiny movement) - The extreme
m_yawcauses massive rotation, snapping to -180°/180° boundary - Reset deadzone for radio wheel
Practical Example: Finding a Line-up
From README.md Q9, here’s the complete workflow:Step 1: Find the Angle
In-game withsv_cheats 1:
- Pitch (vertical):
12.34 - Yaw (horizontal):
-45.67
Step 2: Calculate Command Values
Horizontal (Yaw):Step 3: Create the Alias
Incsafap/logic.cfg or map-specific config file:
Step 4: Create Radio Label
Incsgo/resource/platform_english.txt:
Step 5: Add to Radio Wheel
Incsafap/maps/[mapname]_labels.cfg:
csafap/maps/[mapname]_cmd.cfg:
Command Syntax
Theyaw and pitch commands use this format:
0 0 in modern configs.
Custom Sensitivity Support
Version 2.18 added support for customsensitivity_y_scale values. If a player uses a different vertical sensitivity ratio, the framework accounts for this:
Precision Considerations
- Use at least 6 decimal places for accuracy:
4045.454545 - CS2 accepts higher precision, so
4045.45454545is better - For repeating decimals (like 0.909090…), use 8-10 digits
- Example:
2075.909090909090ensures sub-pixel accuracy
Debugging Line-ups
If line-up aims wrong:- Check if
startsensexecuted before aim commands - Verify the +4045.45454545 adjustment was added to pitch
- Test with
getposto compare actual vs expected angles - Ensure
zero_lrandzero_udexecuted in correct order
- This was a known bug in versions 2.24-2.29
- Fixed in version 2.29+ by improving zeroing logic
- Check that
zero_lrusesm_yaw 99999999999999(enough 9s)
Performance Notes
Angle calculations happen instantly (single frame), but the radio wheel system adds a small delay:- Frame 1:
zero_lrexecutes (horizontal zero) - Frame 2-3: Radio wheel opens via
+radialradio2 - Frame 4:
zero_udtypically executes - Frame 5+: Player hovers and selects option