Re: [Super-tux-devel] FPS debug
Brought to you by:
wkendrick
From: Tobias <tob...@gm...> - 2004-01-31 10:16:02
|
Am Do, den 29.01.2004 schrieb Ricardo Cruz um 17:52: > Hey, > The game is producing differences in the gameplay between machines that can > keep different FPS, it is even noticeable the difference in the gameplay > between the GL and SDL backends. > I hope this little patch can help in the debugging. Use the Q and S keys to > decrease the FPS (with the --debug-mode parameter). > > Anyway, I've already tried to hack in the source to make Tux movements to > obey to the differences in the FPS. The position of Tux is calculated by: > > pplayer->base.x= pplayer->base.x+ pplayer->base.xm * frame_ratio; > pplayer->base.y = pplayer->base.y + pplayer->base.ym * frame_ratio; > > being x/y, the current position and xm/ym, the current velocity. frame_ratio > is the result of get_frame_ratio(&pplayer->base); > > This is fine, but the velocity calculation is made by: > pplayer->base.xm = pplayer->base.xm + WALK_SPEED; > Shouldn't it be something like: > pplayer->base.xm = pplayer->base.xm + WALK_SPEED * frame_ratio; > ? I've already fixed many of the FPS problems. Please stay tuned. ;) The concept is fine, but it needs a lot of fine tuning to work perfectly on different systems. Your patch is a hack IMHO. ;) > > Just wondering... > Ricardo Cruz -- |