feat: Add full acceleration on first tick#1950
Open
bjorn-martinsson wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR builds on #1949 and is intended to be reviewed and merged as a follow-up to it.
The preceding PR (#1949) fixes the FPS-dependent input bug (ValveSoftware/Source-1-Games#8045) while preserving original Source behavior, where newly pressed movement keys receive half acceleration on the first tick.
Once the FPS-dependent bug is fixed, users may notice that first-tick acceleration behaves differently from what they have become accustomed to when playing at high frame rates.
This PR preserve that familiar behavior by introducing a small wrapper around
KeyState()that can optionally convert first-tick half acceleration into full acceleration via thecl_full_accel_first_tickcvar, defaulted to 1.The cvar is primarily provided to make the behavior easy to test and compare. If desired, the behavior could be trivially hardcoded by removing the cvar and always enabling the wrapper.
Importantly, this PR does not affect tick taps or other impulse-based movement behavior. Tick taps are already corrected by PR #1949. This PR only changes the first-tick acceleration applied to standard movement key presses from 0.5 to 1.0.
The implementation is intentionally minimal and limited strictly to movement input evaluation.
As with the preceding PR, this change has been tested in TF2 and should be applicable to other Source 1 games using the same input system.