12-30-2004, 10:22 PM
hey everyone. i was wondering if you could share with me your different speed compensation systems for different fps?
the one i use is
each second update a float variable that is a ratio of 60 / fps
that way as fps changes the ratio changes, and when fps = 60 the ratio = 1
then this is multiplied by anything that operates at a specific speed. for instance player movement.
where playerx = playerx + playerspeed * compensationratio
so that at ideal frame rate the player will move at playerspeed speed. but if fps drops to like 30, the ratio becomes 2, so the player will walk at 2x playerspeed, so that during that timeframe the player moves at almost the same distance they normally would during ideal frame rate
the problem i'm having is, since it updates each second the player has short bursts of speed that last for a second everyonce in a while.
so, i'm wondering who else has had problems like this, and what they developed to fix it?
thanks
the one i use is
each second update a float variable that is a ratio of 60 / fps
that way as fps changes the ratio changes, and when fps = 60 the ratio = 1
then this is multiplied by anything that operates at a specific speed. for instance player movement.
where playerx = playerx + playerspeed * compensationratio
so that at ideal frame rate the player will move at playerspeed speed. but if fps drops to like 30, the ratio becomes 2, so the player will walk at 2x playerspeed, so that during that timeframe the player moves at almost the same distance they normally would during ideal frame rate
the problem i'm having is, since it updates each second the player has short bursts of speed that last for a second everyonce in a while.
so, i'm wondering who else has had problems like this, and what they developed to fix it?
thanks