From ba9b2ddf377c18d8a33e9bc58ae61e8965d74b95 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Fri, 18 Jul 2025 22:08:54 -0400 Subject: [PATCH] Add game logic sensitivity for analog yaw & pitch Add options to change how fast the analog sensitivity is for yaw & pitch. Why not use the existing axis sensitivity options? Because they can change how the deadzones and input response preform, and you have to balance several options. In my opinion, those sensitivity options should be for full-on stick calibration (if your stick is not outputting the full range, for instance). But how fast the player should be able to look around is up to the user's taste, regardless of the stick they're using. This also helps make it match up with how mouse sensitivity is split up (i.e: device sensitivity vs game logic sensitivity) Default analog pitch sensitivity has been drastically lowered, from 2048 (x1.6 yaw sensitivity) to 768 (x0.6 of yaw sensitivity). I don't think I've ever heard of any FPS game on controller before that makes pitch more sensitive than yaw... it is either the same or lower, because players typically want to stay looking in the horizon, and analog stick isn't precise enough to treat them evenly (let alone more sensitive). IMO this is a lot more playable, but I can change the default back to match older versions if that is preferred. --- src/g_game.cpp | 13 ++++++++++--- wadsrc/static/menudef.txt | 3 +++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/g_game.cpp b/src/g_game.cpp index b288fcfc9..01c69cc69 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -211,7 +211,14 @@ CVAR (Bool, freelook, true, CVAR_GLOBALCONFIG|CVAR_ARCHIVE) // Always mlook? CVAR (Bool, lookstrafe, false, CVAR_GLOBALCONFIG|CVAR_ARCHIVE) // Always strafe with mouse? CVAR (Float, m_forward, 1.f, CVAR_GLOBALCONFIG|CVAR_ARCHIVE) CVAR (Float, m_side, 2.f, CVAR_GLOBALCONFIG|CVAR_ARCHIVE) - + +#define ANALOG_LOOK_BASE 1280 + +// You can change cl_analog_sensitivity_pitch's default to 1.6f if the old historical +// behavior is preferred, but IMO that is so fast that it's practically unplayable... +CVAR (Float, cl_analog_sensitivity_yaw, 1.f, CVAR_GLOBALCONFIG|CVAR_ARCHIVE) +CVAR (Float, cl_analog_sensitivity_pitch, 0.6f, CVAR_GLOBALCONFIG|CVAR_ARCHIVE) + int turnheld; // for accelerative turning EXTERN_CVAR (Bool, invertmouse) @@ -736,11 +743,11 @@ void G_BuildTiccmd (usercmd_t *cmd) if (axis_pitch != 0) { - G_AddViewPitch(joyint(axis_pitch * 2048)); + G_AddViewPitch(joyint(axis_pitch * ANALOG_LOOK_BASE * cl_analog_sensitivity_pitch)); } if (axis_yaw != 0) { - G_AddViewAngle(joyint(-1280 * axis_yaw)); + G_AddViewAngle(joyint(-ANALOG_LOOK_BASE * cl_analog_sensitivity_yaw * axis_yaw)); } side -= joyint(sidemove[speed] * axis_side); diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 0ee47cc1a..d425aef5d 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -825,6 +825,9 @@ OptionMenu "JoystickOptionsDefaults" protected Option "$JOYMNU_PS2", "joy_ps2raw", "YesNo" } StaticText "" + Slider "$JOYMNU_TURNSPEED", "cl_analog_sensitivity_yaw", 0, 2.5, 0.1 + Slider "$JOYMNU_LOOKSPEED", "cl_analog_sensitivity_pitch", 0, 2.5, 0.1 + StaticText "" StaticTextSwitchable "$JOYMNU_NOCON", "$JOYMNU_CONFIG", "ConfigureMessage" StaticTextSwitchable " ", "$JOYMNU_DISABLED1", "ConnectMessage1" StaticTextSwitchable " ", "$JOYMNU_DISABLED2", "ConnectMessage2"