Time Step Strategy

Official forum for the Chipmunk2D Physics Library.
Post Reply
Quasimodem
Posts: 2
Joined: Sun Mar 23, 2008 4:26 pm
Contact:

Time Step Strategy

Post 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!
maximile
Posts: 157
Joined: Mon Aug 20, 2007 12:53 pm
Location: London, UK
Contact:

Re: Time Step Strategy

Post by maximile »

Quasimodem
Posts: 2
Joined: Sun Mar 23, 2008 4:26 pm
Contact:

Re: Time Step Strategy

Post by Quasimodem »

Many thanks, maximile! The solution in that first link is just what I needed.
Post Reply

Who is online

Users browsing this forum: Heise IT-Markt [Crawler] and 11 guests