-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix joystick movement thresholds and run behavior #51
Conversation
Fixes issue where holding the movement joystick at a 45 degree angle would instead make you move at a 41 degree angle if you had "Always Run" set to "Vanilla" or at a 60 degree angle. Fixes issue where holding the movement joystick all the way while not running would make you move at speed 283 instead of 200. Fixes issue where while running you reach the maximum speed while holding the joystick at only 83% (when joy_exponent_move is at its default value of 3, and when joy_exponent_move is 2, 75%, and when joy_exponent_move is 1, 57%).
@ericwa? (cortroller stuff was your baby..) |
joy_sensitivity_{yaw,pitch} and joy_exponent{,_move} were both changed. Decreasing joy_exponent{,_move} makes the joystick respond more at small movements. joy_exponent and joy_exponent_move values of 2 give a response curve more similar to Kex. The original value of 3 gives a response curve that some might find better for slow precision aiming, but it creates a sharper cliff between small inputs and large inputs that can make smoothly adjusting your aim/movement at medium magnitudes difficult. joy_sensitivity_{yaw,pitch} were decreased both to compensate for the joy_exponent{,_move} change and to be closer to Kex's default.
I made one last touch to this PR: I've tweaked the final commit which changed joy_exponent (3 to 2) so that it also changes the defaults for joy_sensitivity_yaw (300 to 240) and joy_sensitivity_pitch (150 to 130). These values give max turning speeds that are the same as Kex's defaults, and decreasing these values helps to compensate for the decrease in joy_exponent (which causes mid-range inputs to be scaled up). This config is the one I use all the time in QS/vkQuake. I didn't originally intend to have much opinionated defaults-changing stuff in this PR, but the joy_exponent_move change (3 to 2) seemed natural to pair with the movement range fixes, the joy_exponent change (3 to 2) seemed natural to pair with that, and after testing out various settings it feels best to me that this change to the sensitivity would be paired with the change to joy_exponent. The final commit isn't exactly a bugfix but I hope it fits well in a PR that's about tuning things to feel better. |
baedf23
to
ad39b75
Compare
This patch is in. Thank you. |
Thanks, these seem good to me. I'll add the new cvars to the controller section of the documentation. Agreed, regarding the +1/+1 move inputs, it makes more sense to prioritize intuitive controls / matching what other games do, rather than emulating keyboard input as I was doing initially. |
I've been playing a lot of both Quakespasm(/vkQuake) and the Kex port with a controller. Compared to Kex, I've noticed that fine movement control seems harder, and the always-run setting and the run key barely impact your speed when the joystick is held all the way. I decided to investigate the joystick handling code, and I fixed a few smoking gun issues that were holding things back.
The above two issues were partly caused by the IN_ApplyMoveEasing function. The function had this comment:
There's two things wrong with this: 1) forward/back/left/right going to 1.41 means that the walking speed will be too high, and the running speed will be clipped creating a large outer deadzone. 2) There's no need to scale things up to make diagonals output (+/-1,+/-1) instead of (+/-0.707,+/-0.707), because the latter already has magnitude 1 and anything with a magnitude higher than that will get scaled down.
(I picked 2% because 1% and 2% are values I've seen recommended, I wanted to copy the value from a modern popular fast-paced FPS with polished controller support, and 2% is the default value in Apex Legends which happens to have an unusually detailed controller settings menu I was able to learn from.)
(I felt the Kex port's joystick response curve was pretty good, so I studied its config, took videos to measure the time it takes to move a given distance or turn around at various joystick values, and charted the results against different Quakespasm joy_exponent settings: moving, turning. I still don't fully understand Kex's response curves, but it's clear to me that joy_exponent{,_move}=2 is much closer to what it does than joy_exponent{,_move}=3.)