Quote: "You're right, TIMER() is not precisely accurate, but it doesn't have to be. When you trigger your movement, you multiply the movement amount by the difference in the current timer from the last timer. That means that even if its out by a few milliseconds, your movement distance will be compensated appropriately."
the timer() itself lags behind, not just the calling of it, it will not catch up
please see attached code (requires matrix1utils for use of hitimer command)
sync on : sync rate 60 : autocam off
make object sphere 1,100 : color object 1,rgb(255,0,0)
make object sphere 2,100 : color object 2,rgb(0,255,0)
position camera 0,200,-200
obj1x#=0.0
obj2x#=0.0
fps=60
move#=18.0 // movement per second
Timer1=timer()
HiTimer1=hitimer()
set camera range 1,10000
do
Timer2=timer()
HiTimer2=hitimer()
obj1x#=obj1x#+((Timer2-Timer1)/1000.0)*move#
obj2x#=obj2x#+((HiTimer2-HiTimer1)/1000.0)*move#
ink rgb(255,0,0),0 : text 0,430,"Timer() movement" : text 150,430,str$(obj1x#)
ink rgb(0,255,0),0 : text 0,445,"HiTimer() movement" : text 150,445,str$(obj2x#)
percent#=(obj1x#/obj2x#)*100.0
percent2#=((obj1x#-obj2x#)/move#)*100.0
ink rgb(255,255,255),0 : text 0,460,"Variance " : text 100,460,left$(str$(obj2x#-obj1x#),13)+" - "+left$(str$(percent2#),5)+"% each loop ("+str$(move#)+" units/second)"+" - "+left$(str$(percent#),5)+"% total"
center text screen width()/2,40,"FPS: "+str$(screen fps())
center text screen width()/2,400,"Number keys to change FPS limit ("+str$(fps)+")"
position object 1,obj1x#,0,200
position object 2,obj2x#,200,200
camx#=(object position x(1)+object position x(2))/2
position camera 1000,50,-1000
if inkey$()="1" then fps=2
if inkey$()="2" then fps=5
if inkey$()="3" then fps=10
if inkey$()="4" then fps=15
if inkey$()="5" then fps=30
if inkey$()="6" then fps=60
if inkey$()="7" then fps=95
if inkey$()="8" then fps=120
if inkey$()="9" then fps=200
if inkey$()="0" then fps=0
Timer1=timer()
HiTimer1=hitimer()
sync : sync rate fps
loop
maybe it's just me, but a variance of an additional ~7% in movement after a mere 5 seconds is not exactly what i'd call 'professional'
And lets not keep in mind this is not even a recode, this is quite possible the simplest 'fix' you could ever do to any piece of code. Simply go to view-replace and replace all instances of timer() with hitimer(). Done