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

Discard non-existent dvar #153

Merged
merged 5 commits into from
Oct 15, 2024
Merged

Discard non-existent dvar #153

merged 5 commits into from
Oct 15, 2024

Conversation

enclave
Copy link
Contributor

@enclave enclave commented Oct 11, 2024

What does this PR do?

This commit removes all references to it and uses aim_lockon_strength as the scale/strength factor when calculating the lock-on pitch turn rate. This aligns with the behavior in the Xbox 360 version of the game.

How does this PR change IW4x's behaviour?

I am unsure as I do not have a controller to test.

Anything else we should know?

The dvar aim_lockon_pitch_strength exists in T5 (I believe from recollection). Whether there should be seperate dvars for lock-on pitch and yaw strength is another question, and if so, the dvars should then be registered properly.

The dvar `aim_lockon_pitch_strength` does not exist. Whether it should exist is something to consider, and if so, it should then be registered appropriately.

This commit removes all references to it and uses `aim_lockon_strength` as the scale/strength factor when calculating the pitch turn rate. This aligns with the behavior in the Xbox 360 version of the game.
@diamante0018
Copy link
Contributor

Good catch, yeah IW4x controller support was pasted from T5 and not IW4 Xbox so mistakes like this happened.

This commit replaces the `AimAssist_Lerp` function with `std::lerp`  as it is part of the C++ STL which may provide performance benefits.
@Rackover
Copy link
Contributor

Is there a reason why we would want to discard this variable?

It allows managing the pitch correction separately from the yaw correction. Sure, it might not exist in IW4 Xbox. But IW4x contains a lot of other stuff that does not exist on IW4 Xbox... ! I'm not sure how this is relevant.

Could you describe in details what problem this PR intends to solve? 🤔

@enclave
Copy link
Contributor Author

enclave commented Oct 12, 2024

This PR will bring parity to how the lock-on turn rates are calculated on the Xbox 360 version of the game using a single dvar (aim_lockon_strength) as the strength/scale factor.

While you're correct that this does not need to be followed just because it's done that way on the Xbox 360 version, if a separate dvar such as aim_lockon_pitch_strength is desired, then the dvar should be registered properly. As the dvar does not actually exist since it's not registered by the game, this line of code will consequently register an empty string dvar, due to the implementation of Dvar::Var. Therefore, in the provided screenshot you are able to see how this dvar is missing an assigned value and more.

image

@Rackover
Copy link
Contributor

I understand better now! 🙂 Thansk for the explanations
In that case I would rather have this PR add a registration for this Dvar, so that it is valid to the game and displayed with the correct tyype / boundaries / restriction, instead of removing the Dvar altogether, if that's okay

enclave and others added 2 commits October 13, 2024 12:50
…ription

This commit restores `aim_lockon_pitch_strength` and properly registers the dvar. It also updates the description of `aim_lockon_strength` (by hooking the dvar registration) to clarify that it now solely serves as the scale/strength factor for the yaw turn rate.
@Rackover
Copy link
Contributor

Tested and works

@Rackover Rackover merged commit 3b1ba24 into iw4x:develop Oct 15, 2024
2 checks passed
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