-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add scope and scanner mouse sensitivity modifiers #281
base: master
Are you sure you want to change the base?
Conversation
big ups |
|
The clamp on input admittedly is no longer necessary - I originally clamped only there because I was printing the configured value in a confirmation notification after the player issued the command, and I wanted to ensure the printed value reflected the value that would actually be applied. It could be removed now. Clamping in the method that applies the values is to avoid a person manually editing the registry to a value outside the allowed range.
Clamping on the lower end is required to avoid the potential of division by zero. Clamping on the higher end is mainly because any higher than that would be of extremely limited value, and providing a range of what is reasonably useful helps provide an indication to the player of what might be useful to try. The logic is the same as why |
Co-authored-by: is-this-c <[email protected]>
I would prefer removal of any clamping. It is simpler code overall. But you have a point about FOV. The clamp exists in 3 places. It is not needed in a console variable. Notwithstanding my suggestion is as follows: constexpr float clamp_sens_scale(float scale) {
constexpr const float min = 0.01f;
constexpr const float max = 4.0f;
return std::clamp(scale, min, max);
} In fact it is not explained why it is not sensitivity itself instead of a scale?
Not so much writing but reading which can be impacted by verbosity and code is read far more than it is written.
I do not think these are good analogies. Moreover I think we should keep in mind (a) his code base is old e.g. some appears hastily written and/or C style (b) C++ and core guidelines evolved in this time and (c) likewise probably rafalh as well. I believe some flexibility makes sense. BTW: The same exact criticisms (a) apply to my code base too. |
Thanks for the note regarding a separate clamping method - that's something in retrospect I should have thought of but didn't. Will implement that. Fair points regarding the naming convention for the commands, and I won't argue with them. Will wait to hear rafalh's thoughts though before making any such changes to them.
That was my original plan before I started looking into how the game calculates it. My original implementation simply allowed the player to set these values directly:
This proved way too confusing for players. Scanner sensitivity is calculated at 0.25 * normal sensitivity, so that one would in theory be easy. Scope sensitivity on the other hand, is applied inversely, and the stock game value is
The reason I went instead with each configured as scale values with base 1.0 is for consistency, simplicity, and user friendliness. This way, the code handles the heavy lifting of how to apply each, and the player is left with a simple and consistent approach. A value of 1.0 is what they are used to, and they can easily decide how to tweak it based on that understanding. |
No I mean why not skip Also what about merging both commands into e.g. |
That can already be set with
I initially considered this, but decided against in an effort to provide more flexibility to players. After having played with it as-is for a while now, I firmly believe that was the right call. |
The scanner sensitivity is calculated from your mouse sensitivity multiplied by a constant. You considered changing this constant. Instead you decided to multiply it. What if you inject here and write a value so your mouse sensitivity and this constant are not involved? In this method I could set |
Ahh, I see what you mean now. That said, I don't like the approach, here are my thoughts on it:
|
Can you explain why?
When one changes or queries |
Well the biggest reason is just that if flexibility can be provided to players with no downside, it is my view that it always should be. More personally though, I am a fan of keeping the scanner sensitivity stock but reducing the sniper/PR scope sensitivity slightly. Having played with this feature for a while, I would certainly miss the ability to configure them separately.
I could, but I don't think it's a good idea. In my view it would just complicate the output and confuse ordinary users (especially because it's applied in a fundamentally different way when compared to scopes). It's not a secret how it works - "power users" can review the source and/or just ask, but the output should be suitable for a general user, and what you've suggested, I don't believe is that. As-is, If rafalh would like output added similar to what you described, I'm happy to do it, but unless he indicates as much, I don't plan to do it because I would view it as a negative. |
This PR adds the following new commands:
scope_sensitivity_modifier [value]
scanner_sensitivity_modifier [value]
Both default to 1.0, commands provide players with a method to scale mouse sensitivity when in scopes and scanners.
Resolves #67