This project has moved and is read-only. For the latest updates, please go here.

FixedTimeStep Unlocked FPS Issues

Jun 26, 2010 at 7:18 PM

Hey everybody!

I'm making a little game and recently I discovered I can unlock the framerate with this bit of code: = false;          
IsFixedTimeStep = false; 

Now here's the strange part.
My game acts very strange when I do this. The game speeds up and slows down erratically.

BUT! It works fine if I enable debugView.

Jun 28, 2010 at 2:21 AM

The physics engine needs a fixed time step to work properly. The easiest way to do that is to simple fix the frame rate at whatever size step you are taking. For variable time step you would need to add quite a bit to the engine. I have an idea to add some features I found in BEPU's physics engine to Farseer 3.0, but no major further development will take place on 2.1+.

The features are an internal time stepping control that will let you call Update() as many times as you like and only update the physics at a fixed time step on a separate thread. Also hopefully I will be able to implement a smoothing feature that will update the positions and rotations of the objects with linear interpolation between physics updates. The only downside to this is that the graphics will need to always be a frame behind the physics, but I don't think that should be to big of a deal.

I have no time frame on when this will be finished, but I am always hopeful for the end of the year.