[Algorithms] Game loop timings
Brought to you by:
vexxed72
From: igrok <ig...@bl...> - 2005-03-30 21:28:13
|
I'd like to set my AI/Physics time increments to be constant. On consoles, this has been a simple matter of counting the number of vblanks and dividing by the refresh rate. On the PC, this all seems much more problematic to me, because of: -Counting vblanks (how do you do this on PC??) -Some users have vsync turned off -Different monitor refresh rates -Different speed hardware In my ideal world, I'd be running AI/Physics at 20fps, with the rendering using up the rest of CPU time, interpolating frames to make it appear smoother. Also, some scenes will be more expensive than others, and so the number of interpolated render frames may change. I realise my questions are a little vague here, but I need general pointers as to how to acheive this. I'm really look for help in understanding how I should organise my loop and timings so updates are as smooth as possible. Thanks for any help |