Skip to main content
gamedev.net
🔒 Locked

FPS issue

Started by Real World Jan 10, 2005 at 3:55 AM 1 replies 600+ views
Original Post
Real World
Real World
I've got a game where I am saving record times in the game as frames passed between point 1 and 2. For example 3500 frames. I can then use this value to get a time by dividing it by FPS which would give me for 50 FPS a time of 70 seconds. The problem is that when I switch to 60 FPS the time drops to 58.33 seconds What I've tried to do is always save it as 60 FPS but this can lead to inacuracies when dividing. Any ideas of what to do that will work 100% of the time?
JimPrice
JimPrice
Are you saying that you calculate the time by dividing total frames by FPS? How are you calculating FPS? Surely you need to calculate time to do this? Why not just record the time taken as the time taken between points 1 and 2, and calculate FPS based on number of frames between these points, divided by amount of time between those points?

Maybe I'm misunderstanding you, but it sounds almost like you're either:

A - assuming you have a fixed FPS
B - calculating FPS by using a very small number of frames (or very small time slice)

Neither of which I would say is particularly advisable.

Jim.
roos
roos
Why not just use a timer, and keep track of time directly, instead of counting frames and then trying to work backwards?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.