3
\$\begingroup\$

My game is running 60fps (Because I'm using a 60hz monitor) but if I would use a 85hz monitor it would be running 85fps. My question is if update is called based on the screens refresh rate or if its limited to 60 calls per second

\$\endgroup\$
10
  • 1
    \$\begingroup\$ Some 60Hz monitors have an option in the settings to drop down to 30Hz. If you have that option, you could at least see if it actually drops downwards to 30fps. \$\endgroup\$
    – dimitris93
    Jul 18 '15 at 10:03
  • \$\begingroup\$ Yeah that sounds like a good idea Shiro \$\endgroup\$
    – user61929
    Jul 18 '15 at 10:32
  • \$\begingroup\$ Unfortunatly I just found out I can't do that with my monitor :| \$\endgroup\$
    – user61929
    Jul 18 '15 at 10:35
  • \$\begingroup\$ Why does it matter? \$\endgroup\$ Jul 18 '15 at 11:07
  • 1
    \$\begingroup\$ If you are moving objects by using constant * deltaTime, your movement will have the same speed for all frame rates \$\endgroup\$
    – dimitris93
    Jul 18 '15 at 13:08
1
\$\begingroup\$

As far as I know, the fixed timestep in Monogame is 60 per seconds, regardless of the monitor refresh rate. The statement "it runs 85fps because my monitor refresh rate it 85hz" is false.

It just tries to give you 60 updates per second. It cannot guarantee it does, therefore using logic based on elapsed gametime is the best way to go.

If you want another timestep than 60, change the property TargetElapsedTime to the desired value. Again, this is unrelated to the refresh rate of your monitor since you can set the value yourself.

Read this http://blogs.msdn.com/b/shawnhar/archive/2007/07/25/understanding-gametime.aspx for more information on how it is implemented in XNA (Monogame is based on this).

\$\endgroup\$

Your Answer

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