-
Notifications
You must be signed in to change notification settings - Fork 84
[GEN][ZH] Fix up the right mouse button scrolling to properly normalize its movement and correctly apply the Scroll Speed modifier #1244
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Behaviour feels good.
I suggest we make a follow up change and raise the upper ceiling of the Scroll Speed in the Options Menu, because some players perhaps still want fstr speed (originally they would get very fast scroll speeds with high FPS). The lower scroll speed ceiling seems fine.
Generals/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp
Outdated
Show resolved
Hide resolved
ad8cd17
to
98adba7
Compare
I altered the rescaling factor to The scroll speed should have a min of 0.5 an a max of 1.95 multiplications with this now when using the scroll adjustment With how i currently have the code setup, the RMB scrolling should be equivalent to 30FPS in retail when the scroll speed is left at default. But people can then adjust it up to nearly twice the speed etc. |
98adba7
to
78d7582
Compare
rebased with main after scrolling fix was merged. |
78d7582
to
9d9303d
Compare
Generals/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp
Outdated
Show resolved
Hide resolved
9d9303d
to
fedd09f
Compare
Tweaked this with the new So when at a scroll setting of 50, the RMB scrolling should match retail without limiting the minimum range. But in the future i still think we want to decouple mouse, keyboard and edge scrolling settings from one another. |
How about in this change we only fix the wrong scroll speed math, but do not add the scaling? And then in the follow up change we do apply the scaling to all scrolling. This way we decouple responsibilities of changes and have a clean history of what we did to scrolling step-by-step. In the title of this change it says "normalize the movement". What does this mean? |
I can do that, i will strip out the scaling factor and push the change. Normalising the movement means that all directions of movement have the same effect. |
fedd09f
to
3b5c8ad
Compare
This should just be the changes for fixing the RMB scrolling calculation and allowing it to be affected by the scroll options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good.
I struggled with the title but I think it is ok now |
This PR fixes the right mouse button scrolling which was not originally affected by adjusting the scroll options in the options menu.
It cleans up the original implementation and implemented the functionality properly. The original code never did what it was meant to do when it comes to scaling the RMB scroll speed.
The main factor that affects the movement in the code is the factor that measures the mouse position away from the anchor point.
The extra added factor in the original code added an insignificant addition to the movement that was not perceivable.
In the fixed code we take the length of the mouse position from anchor to get the magnitude of the movement, then normalise the mouses position vector from the acnchor point. This allows us to properly normalise the movement from the anchor. we then multiply it by a rescaled scrolling factor which sets the 50% position to replicate what the scroll speed at 30FPS was before the change.