Understanding clocks for frame rates

Started by
1 comment, last by LilithAnn 15 years, 7 months ago
Hopefully I can word this well enough to make the question clear. I'm looking at setting up clocking functionality for a game I'm working on. I've read several articles on the subject and I understand the theory behind it. However, for a practical understanding I have some questions. Typically I see something at the top of the loop that checks for the time passed since the last pass through that point. Following that, calculations are made for movement of the various elements of the display then the rendering is done. I guess my question is, where is the most time expected to be spent? It seems that between the time spent in calculation and drawing the scene it's the time involved with those operations that really determines where the elements should be placed. My perception is that the relative displacement should involve the time required to perform at least the calculations and that that can't happen. Is the time required to calculate and render considered to be minute enough not to make a difference or will the rendering be a frame out of sync? Clear? I didn't think so.
Ŀ
Advertisement
Quote:Original post by LilithAnn
Is the time required to calculate and render considered to be minute enough not to make a difference or will the rendering be a frame out of sync?
To be clear - do you meant that by the time that updating/rendering has taken place, the measured time value (which was taken before this processing occured) will now be in the past, causing the visualisation to be out-of-step with reality?

If so, then, no this is generally not a problem.
If your game is running at 30fps then your display might be 33ms 'slow' in displaying the game-state to the user. This delay is minute compared to the 200ms that it takes an average person to process the visual stimuli and form a physical response ;)

FYI, some games even have a visualisation delay of two frames (double-buffered simulation) and they still generally feel responsive to the user.
That's exactly what I meant. I just have trouble expressing it so concisely.

Thanks very much. This gives me some confidence to proceed.
Ŀ

This topic is closed to new replies.

Advertisement