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

Arrow key camera panning not consistent with framerate #8968

Closed
jasperfirecai2 opened this issue Apr 7, 2021 · 2 comments
Closed

Arrow key camera panning not consistent with framerate #8968

jasperfirecai2 opened this issue Apr 7, 2021 · 2 comments
Labels
bug Something isn't working needs triage This issue needs further investigation before it becomes actionable

Comments

@jasperfirecai2
Copy link

Version of OpenTTD

1.11.0

Expected result

Screen scrolling with the arrow keys is smooth on all framerates

Actual result

Screen scrolling is a fixed rate independent of framerate, causing screen tearing on higher framerate settings, and inconsistency between right mouse panning and arrow key panning.
I'm afraid I don't have a good way to show this with an image or video

Steps to reproduce

  1. Load up the game
  2. Change the framerate to something higher than the default, in my case: 144Hz
  3. Use the arrow keys to pan the camera
  4. Compare with right mouse button panning
@TrueBrain
Copy link
Member

I think this is not so much related to the refresh-rate, even on 60Hz it feels terrible.

Enabling smooth viewport scrolling resolves the issue mostly, which means it is most likely caused that arrow key movements are not per pixels, but by a bunch of pixels at once. There are more places in OpenTTD that have similar issues, like news popping up.

Will need to look further into how arrow key movement works to see if this can be easily fixed, but possibly a simple fix is always applying smooth viewport scrolling for arrow key movement.

@TrueBrain TrueBrain added bug Something isn't working needs triage This issue needs further investigation before it becomes actionable labels Apr 10, 2021
@TrueBrain
Copy link
Member

After looking into this in more detail, indeed, the best fix is to enable smooth-scrolling. I am currently applying some fixes to make smooth-scrolling a bit more smooth, but that is really the solution to this ticket. If you use arrow-keys, enable smooth-scrolling.

Initially I wanted to force enable it when using arrow-keys, but decided that would be weird; some people might not want it. So instead, I have made a suggested change to make smooth-scrolling the default.

PS: did you know that when you press SHIFT the arrow movement goes 5 times as fast? Easier to get to places :)

@TrueBrain TrueBrain closed this as not planned Won't fix, can't repro, duplicate, stale Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage This issue needs further investigation before it becomes actionable
Projects
None yet
Development

No branches or pull requests

2 participants