Changing the fixed rate

BlitzMax Forums/BlitzMax Programming/Changing the fixed rate

siread(Posted 2009) [#1]
I have a car racing game that is running at a fixed rate of 60 updates per second. Let's say that every update the car is decelerated by a rate of 0.998. (speed:*0.998)

Now if I want to change the ups to say 30, is it possible to calculate what to change the deceleration to so that it has the same effect over 30 ups as it did over 60 ups? (speed:*?)


xlsior(Posted 2009) [#2]
since you're doing your updates twice as often at 30FPs, just apply your deceleration value twice:

speed*(0.998^2)

or more generic:

Speed*(0.998^(60/ActualFPS))


siread(Posted 2009) [#3]
You sir, are a prince. :)