Hacker News new | ask | show | jobs
by hutzlibu 1869 days ago
"One frame could render in 20ms and the next in 25ms, which is completely fine."

No it is not fine, if you want to have a real smooth gameplay. So also in game loops, you can adjust for that, by checking timediff.

But sure, the difference is that, if you miss a frame in a game loop - no real rockets crash, so there is probably (and hopefully) not as much effort put into that, like they do on SpaceX.

2 comments

Framerates are averaged over much longer periods than two frames. Rendering 45 frames in 20ms each and then having a couple take 25ms just doesn't matter mostly, and addressing that is the kind of extra "nice to have" (and even then not for every kind of game). Yeah it's nice to have consistent frame times but less important than avoiding individual frames getting very slow, and a framerate drop certainly won't be treated by the engine as a critical failure that causes e.g. a crash or restart.

On a hard real-time system like the Dragon, failing the deadline once is a critical error just like a game engine being unable to talk to the GPU.

This is just the distinction between soft real-time and hard real-time.