Time Step Strategy

Official forum for the Chipmunk2D Physics Library.

Time Step Strategy

Postby Quasimodem » Sun Mar 23, 2008 4:38 pm

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!
Quasimodem
 
Posts: 2
Joined: Sun Mar 23, 2008 4:26 pm

Re: Time Step Strategy

Postby maximile » Sun Mar 23, 2008 6:23 pm

maximile
 
Posts: 157
Joined: Mon Aug 20, 2007 12:53 pm
Location: London, UK

Re: Time Step Strategy

Postby Quasimodem » Sun Mar 23, 2008 7:59 pm

Many thanks, maximile! The solution in that first link is just what I needed.
Quasimodem
 
Posts: 2
Joined: Sun Mar 23, 2008 4:26 pm


Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 1 guest

cron