0
\$\begingroup\$

I currently implement my game loop using a variable fixed timestep, i.e. dt = 1 / monitor_refresh_rate with vsync (or pseudo vysnc with delays where vsync is disabled). I want to maintain using a fixed timestep to keep the replay system I have implemented. For variable refresh rate monitors like gsync and freesync, I'm unsure as to how best accomodate them using this pattern. I'm aware that I could easily cap the loop at say an assumed 60fps and that would work fine. However, I feel that this would not be taking full advantage of what these monitors have to offer as I'd be effectively restricting their frame limit.

Any advice? Thanks.

\$\endgroup\$
  • \$\begingroup\$ "variable fixed timestep" is a bit of an oxymoron. One of the goals of a fixed timestep is to get consistency across different devices, by using a constant chosen by the developer. If you change your timestep depending on the current refresh rate, then it's "fixed" only for this run, and doesn't guarantee you'll get the same gameplay results if you played on a different screen. Remember that your (variable) rendering update rate does not need to be the same as your (fixed) gameplay simulation update rate. \$\endgroup\$ – DMGregory May 4 at 11:55
  • \$\begingroup\$ In the case of gsync/freesync I have come to the conclusion that decoupling rendering and update is indeed the solution, i.e. a semi-fixed timestep. \$\endgroup\$ – Ryan McClue May 4 at 22:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.