Skip to content
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

feat: Add bunnyhopping control CVars #3

Open
wants to merge 1 commit into
base: tc2-mod
Choose a base branch
from

Conversation

Void-n-Null
Copy link

Introduce two new ConVars to control bunnyhopping behavior. They default to vanilla TF2 behavior, so no server is affected unless they explicitly opt-in. But for servers that want these controls, it enables clean, native configuration of movement mechanics without needing plugins or code changes.

Implementation

This PR introduces two new ConVars to provide more granular control over bunnyhopping mechanics:

  1. tf_restrict_bunnyhopping: Controls whether players can gain speed through consecutive jumps

    • Default: 1 (enabled)
    • Type: Boolean
    • Matches default TF2 behavior
  2. tf_automatic_bunnyhopping: Enables automatic jumping while holding the jump button

    • Default: 0 (disabled)
    • Type: Boolean
    • Matches default TF2 behavior

The implementation modifies CheckJumpButton() in src\game\shared\tf\tf_gamemovement.cpp to check these ConVars before applying bunnyhopping mechanics. Both variables are registered with the FCVAR_CHEAT flag to maintain consistency with other movement-related ConVars. There could be some further discussion on if the CVars count as cheats.

Checklist

  • No other PRs implement this idea.
  • This PR does not introduce any regressions.
  • I certify that this PR is my own entirely original work, or I have permission from and have attributed the relevant authors.
  • I have agreed to and signed this project's Contributor License Agreement.
  • This PR only contains changes to the engine and/or core game framework
  • This PR targets the tc2-mod branch.

Optional checklist:

  • This change has been filed as an issue.
  • No other PRs address this.
  • This PR is as minimal as possible.
  • This PR does not introduce any regressions.
  • This PR has been built and locally tested on at least one platform.
  • This PR has been tested on all platforms, on both a dedicated server and on a listen server.

Testing Checklist

Client Server Version
Windows Built Built Windows 11 21H2

Introduce two new ConVars to control bunnyhopping behavior:
- tf_restrict_bunnyhopping: Restricts speed gain from bunnyhopping (default: enabled) (Matches TF2 functionality by default)
- tf_automatic_bunnyhopping: Allows automatic bunnyhopping when holding jump (default: disabled) (Matches TF2 functionality by default)

Modified CheckJumpButton() to respect these new CVars, providing more flexibility in movement mechanics.

The new CVars are labeled as cheats to match the rest of the movement based `tf_` CVars.
@CLAassistant
Copy link

CLAassistant commented Feb 22, 2025

CLA assistant check
All committers have signed the CLA.

@mastercoms
Copy link
Member

I won't be taking this for now, since I think Valve has explicitly denied this behavior being a thing, and I'd like at least for the first major update of TC2 until adding this. It can help a lot with prediction for servers which try to enable this custom behavior, so I do think it's legitimate in the long term.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants