The reason your program's FPS is jumping all over the place is because it sometimes has to process more instructions and sometimes allmost nothing.
I usually just let the FPS go sky high by using:
Sync rate 0
Then I just use timer based movement to allow objects to move at the correct speed.
Sync on
Sync rate 0
make object cube 1, 1.0
Normal_FPS# = 1000.0 / 60.0
Speed_modifier# = 1.0
Current_time = 0
do
Current_time = timer()
move object 1, 1.0 * Speed_modifier#
sync
Speed_modifier# = 1.0 / ( Normal_FPS# / (timer()-Current_time) )
loop
Now, when moving objects, you only need to use:
* Speed_modifier#
When the FPS changes, the amount of time needed to process the do loop has changed too. Thanks to the calculation at the bottom the movement speed of the objects is modified.
When the FPS is 60, the average the time the computer needs to process the do loop is around 16.666.
As you can see, that's the same as Normal_FPS#.
Now:
Normal_FPS# / time used to process
16.666 / 16.666 = 1.0
1.0 / 1.0 = 1.0
The modifier is 1.0 when the FPS is 60.0.
This means the objects will move at their normal speed.
Again, when the FPS is 90:
Normal_FPS# / time used to process
16.666 / 11.111 = 1.49
1.0 / 1.49 = 0.67
Now the objects will move slower, but the move object commands will be
called more often. This will compensate and all will be well