I'm trying to find what makes it framerate dependant but it's hard because I dont understand what you are doing in some places withough further explanation.
What are you using this part for? What is it supposed to do?
maxv(1 - time_step * 0.9, 0)
I understand you get a fraction of 0.9 (depending on framerate) and subtract it from 1, giving you a result between 0.1 and 1 as long as fps dont drop below 16. But what is that part being used for?
EDIT:
I think the problem is that you are using time_step too much in too many steps along the way. If you multiply by time_step two or three times along the way it's value will diminish/aughment exponentially, you are not really multiplying by time_step anymore, instead you are multiplying by time_step squared or cubed resulting in it getting exponentially smaller the smaller it is, thus being framerate dependant again besides using time_step
(in fact now it is even more framerate dependant than if you didnt use time_step at all, now it is exponentially frame rate dependant which is much worse)
EDIT2:
My advice would be to modify this in one of two ways:
#1. Don't use timestep at all in your calculations, do all the math for speed, acceleration, etc withough considering fps. And at the end multiply the result of everything once with timestep.
speed = x+y/z bla bla bla
accel = x+y/z bla bla bla
cam.pan += (speed+accel) * time_step
#2. or option 2 would be to do all the independant calculations separately using time_step but when combining results do it directly withought time_step. That way you make sure each component was only multiplied byy timestep once along the whole way to the result:
speed = (x+y/z bla bla bla) * time_step
accel = (x+y/z bla bla bla) * time_step
cam.pan += speed+accel
NOTE* in my programs I prefer approach #1 since the code is cleaner, easier to read and modify later, and faster since there will be less multiplications involved. Just keep in mind a general rule, once something has been multiplied by time_step never multiply it with time_step ever again (or anything that has been calculated using it).
Last edited by Carlos3DGS; 02/07/13 18:35.