What are the pros and cons of a non-fixed-interval update loop?

Posted by akonsu on Game Development See other posts from Game Development or by akonsu
Published on 2012-04-01T01:15:39Z Indexed on 2012/04/01 5:40 UTC
Read the original article Hit count: 247

Filed under:

I am studying various approaches to implementing a game loop and I have found this article.

In the article the author implements a loop which, if the processing falls behind in time, skips frame renderings and just updates the game in a loop (the last variant called "Constant Game Speed independent of Variable FPS").

I do not understand why it is acceptable to call update_game() in a loop without making sure the update function is called at a particular interval. I do not see any value in doing this. I would think that in my game I want to be sure the game is updated periodically with a known period.

So maybe it is worthwhile to have two threads, one would call update periodically, and the other one would redraw the game, also periodically? Would this be a good and practical approach? Of course I would need to synchronise the threads.

© Game Development or respective owner

Related posts about gameloop