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!
Time Step Strategy
-
- Posts: 2
- Joined: Sun Mar 23, 2008 4:26 pm
- Contact:
-
- Posts: 157
- Joined: Mon Aug 20, 2007 12:53 pm
- Location: London, UK
- Contact:
Re: Time Step Strategy
It's a common problem, and actually really easy.
http://www.gaffer.org/game-physics/fix-your-timestep
http://sacredsoftware.net/tutorials/Ani ... tion.xhtml
http://www.gaffer.org/game-physics/fix-your-timestep
http://sacredsoftware.net/tutorials/Ani ... tion.xhtml
-
- Posts: 2
- Joined: Sun Mar 23, 2008 4:26 pm
- Contact:
Re: Time Step Strategy
Many thanks, maximile! The solution in that first link is just what I needed.
Who is online
Users browsing this forum: No registered users and 48 guests