RE: [Algorithms] Game loop timings
Brought to you by:
vexxed72
From: Jay S. <Ja...@va...> - 2005-04-01 17:49:01
|
> > Pseudo-code with explanation: > >=20 > > http://www.mindcontrol.org/~hplus/graphics/game_loop.html > >=20 > > (Btw: if anyone has feedback on how to make that page=20 > clearer, please=20 > > shoot it my way. I find myself posting that link a lot in various=20 > > fora.) >=20 > I think the one thing it should perhaps elaborate a little on=20 > is the scenario when the system goes into a 'death spiral'=20 > when the time taken to execute the fixed rate stuff is only=20 > marginally better than realtime. This is only true for stuff that costs more per unit realtime, but the simplest solution is to clamp realtime. We clamp realtime to 100ms to avoid these problems in our games. So you still get the progressive poor performance, but it hits a floor really quickly and then recovers. The artifact is, of course, that real time slows down in the game, but this is preferable to having your framerate drop even lower. Jay |