Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many game updates per second? [closed]

Tags:

frame-rate

What update rate should I run my fixed-rate game logic at?

I've used 60 updates per second in the past, but that's hard because it's not an even number of updates per second (16.666666). My current games uses 100, but that seems like overkill for most things.

like image 986
Tod Avatar asked Nov 28 '22 13:11

Tod


1 Answers

None of the above. For the smoothest gameplay possible, your game should be time-based, not frame-locked. Frame-locking works for simple games where you can tweak the logic and lock down the framerate. It doesn't do so well with modern 3D titles where the framerate jumps all over the board and the screen may not be VSynced.

All you need to do is figure out how fast an object should be going (i.e. virtual units per second), compute the amount of time since the last frame, scale the number of virtual units to match the amount of time that has passed, then add those values to your object's position. Voila! Time-based movement.

like image 197
64BitBob Avatar answered Jan 09 '23 02:01

64BitBob