Skip to content

Conversation

@bobtista
Copy link

@bobtista bobtista commented Jan 4, 2026

Summary

  • Credits screen scrolling now uses wall-clock time instead of frame counting
  • Credits scroll at consistent speed regardless of frame rate

Changes

  • Replaced m_framesSinceStarted frame counter with m_lastScrollTime timestamp
  • Uses timeGetTime() to measure elapsed time between scroll updates
  • Converts original frame-based interval to milliseconds (1 frame = 33ms at 30fps)

Test plan

  • Verify credits scroll at the same speed at 30fps and higher frame rates
  • Verify credits still scroll smoothly without stuttering

30FPS
https://github.com/user-attachments/assets/0215fd82-49f7-4c7c-9903-c8b0f53eb239

60FPS
https://github.com/user-attachments/assets/a45a847b-1f9d-4642-8ab3-23e30de25c04

@bobtista bobtista force-pushed the bobtista/fix-credits-scroll-timing branch from 4fef89c to aa81f5a Compare January 4, 2026 06:07
@bobtista bobtista force-pushed the bobtista/fix-credits-scroll-timing branch from aa81f5a to 7fa2519 Compare January 4, 2026 06:21
// TheSuperHackers @tweak Credits scroll timing is now decoupled from the render update.
const UnsignedInt scrollIntervalMs = static_cast<UnsignedInt>(m_scrollRatePerFrames * MSEC_PER_LOGICFRAME_REAL);
const UnsignedInt now = timeGetTime();
if (now - m_lastScrollTime < scrollIntervalMs)
Copy link

Choose a reason for hiding this comment

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

I don't like this approach because it is inaccurate. Scrolling should be specified as scroll distance per second and then scale each frame by the render frame rate. Probably better to have a start time, then take new time, calculate position offset, check if position has reached new integer, then continue update, otherwise wait next update and fractional move.

Copy link

Choose a reason for hiding this comment

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

New code looks promising. Does it work?

Copy link
Author

Choose a reason for hiding this comment

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

It works for me :) Took me a minute to figure out how to use the On Screen Keyboard to get at the numpad keys 😆 and that they don't work while the snipping tool is recording for me. Once I got the FPS up and then started recording it seems as smooth on my machine at either framerate, and it maxed out at 70 something, it's old.

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.

2 participants