Skip to content

Conversation

@xezon
Copy link

@xezon xezon commented Oct 1, 2025

This change uses smoothened frame rate to scale movement for scrolling and camera to avoid jumps on longer stalls.

TODO

  • Update title
  • Replicate in Generals

@xezon xezon added Enhancement Is new feature or request Minor Severity: Minor < Major < Critical < Blocker ThisProject The issue was introduced by this project, or this task is specific to this project labels Oct 1, 2025
@helmutbuhler
Copy link

This creates an issue in this situation:

  • Load a replay
  • enable fast-forward
  • disable fast-forward
  • Move around with the camera. It will move slowly for a second or so.

@xezon
Copy link
Author

xezon commented Oct 7, 2025

Oh yes this happens because of the sudden change of average frame rate. Ok in that case we need a different solution.

@xezon xezon force-pushed the xezon/fix-scroll-jumps branch from 222f9ef to 4291c8d Compare October 7, 2025 20:09
@xezon
Copy link
Author

xezon commented Oct 7, 2025

I have appended a new solution that will floor the fps ratio at 5 fps to prevent big jumps on stalls.

@xezon xezon force-pushed the xezon/fix-scroll-jumps branch from 4291c8d to ce035c5 Compare October 20, 2025 16:33
@xezon
Copy link
Author

xezon commented Oct 20, 2025

Rebased.

@xezon xezon requested a review from Mauller October 26, 2025 17:53
Copy link

@Mauller Mauller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@Mauller
Copy link

Mauller commented Nov 1, 2025

Title probably wants to be changed to something along the lines of

"tweak(scrolling): Use update frame rate over base fps to scale movement for scrolling and camera"

@xezon xezon changed the title tweak(scrolling): Use smoothened frame rate to scale movement for scrolling and camera tweak(scrolling): Prevent far camera jumps when scrolling while the game stalls Nov 2, 2025
@xezon
Copy link
Author

xezon commented Nov 2, 2025

Title updated.

@xezon xezon force-pushed the xezon/fix-scroll-jumps branch from ce035c5 to b3bf1e2 Compare November 7, 2025 17:21
@xezon
Copy link
Author

xezon commented Nov 7, 2025

Replicated in Generals without conflicts

@xezon xezon merged commit 8a26472 into TheSuperHackers:main Nov 7, 2025
18 checks passed
@xezon xezon deleted the xezon/fix-scroll-jumps branch November 7, 2025 17:58
fbraz3 pushed a commit to fbraz3/GeneralsX that referenced this pull request Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Is new feature or request Minor Severity: Minor < Major < Critical < Blocker ThisProject The issue was introduced by this project, or this task is specific to this project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Frame time for scroll distance needs to be clamped

3 participants