Page 1 of 1

Time Step Strategy

Posted: Sun Mar 23, 2008 4:38 pm
by Quasimodem
Hello, I am having a hard time coming up with a good way to manage the time step that's passed to cpSpaceStep(). I understand that it is important to use a constant, fixed time step, but this makes changes in framerate extremely noticable. For example, whenever my FPS drops due to a spell effect or flurry of new objects, the objects that Chipmunk is managing naturally slow down too, since cpStepSpace() is not being called as frequently during this FPS dip.

Has anyone come up with a nice way to handle this? I've played around a little with a variable time step, but this is definitely not good for all the reasons that the documentation points out. I'm thinking about creating an FPS monitor which will only adjust the time step when the FPS varies by a certain amount, rather than every frame, but this seems like a hassle and will likely have the same problems as adjusting it every frame.

Any help with this is much appreciated!

Re: Time Step Strategy

Posted: Sun Mar 23, 2008 6:23 pm
by maximile

Re: Time Step Strategy

Posted: Sun Mar 23, 2008 7:59 pm
by Quasimodem
Many thanks, maximile! The solution in that first link is just what I needed.