Advertisement

a timing / frame rate question..

Started by January 09, 2002 04:42 PM
1 comment, last by KoalaGerch 23 years, 1 month ago
in general, what would people say was the better solution for making an application appear to function nearly identically on computers of varying ability? 1) Scale movement / rotation by a factor determined by the frame rate? This leads to "lurching" if the frame rate alters suddenly (and causes various other problems at low rates). 2) Force a movement / rotation update to only occur every 25th of a second (or something along those lines) regardless of framerate (with the problem that if a frame takes longer to render than 1/25 second the entire application slows down)
Not much experience, but I think it is important here that you know your audience. It you''re sure that 99% has PC''s that (widely) meet the minimum system specs for your app, than you can choose for the last method. Otherwise, I think I''d choose for the first one.
Newbie programmers think programming is hard.Amature programmers think programming is easy.Professional programmers know programming is hard.
Advertisement
The best way to do it is to seperate your system into two parts. One part updates your system based on a variable length of time having passed, the other part draws your system at it''s current state.

The difficulty is trying to make a game operate identitically under differing frame rates. If your updates are fast enough (and yuor drawing is the part slowing your down), you can just break the time increment down into short (like 5ms) increments and update multiple times to avoid having arbitrarily long time slices in your update path. The problem with long time slices is that collision detection, AI, etc. all become less trivial when your time slice grows.

This topic is closed to new replies.

Advertisement