Hi, I have tested it and got the same XNA fixed time step problems on a Win 7 x64 PC: Sometimes the framerate is 60 fps and low CPU utilization but most of the time I get 49 fps and one CPU core is at 100%. :-(
If IsFixedTimeStep = false, I get 700 fps.
In our vehicle system I do not see any problems when I run it using a variable time step.
Here is some background information about the Simulation and time stepping:
In general, it is recommended to use a fixed time step for physics simulation because the simulation uses numerical integration, where the numerical error depends on the time step size. You will want to tune and optimize your physics to be stable for your target frame rate. If you simulate using a variable time step, then the simulation results are not repeatable. A variable time step can lead to critical gameplay failures. For example: varying character controller jump heights or varying ballistic curves of cannon balls that should hit a target.
A fixed time step has proven so essential that we have made it the default in our Simulation. The Simulation uses two values to configure the timing: Simulation.Settings.Timing.FixedTimeStep and Simulation.Settings.Timing.MaxNumberOfSteps. And internally in Simulation.Update() it does something like this:
_accumulatedTime += MathHelper.Clamp(deltaTime, 0, Simulation.Settings.Timing.FixedTimeStep * Simulation.Settings.Timing.MaxNumberOfSteps);
while (_accumulatedTime >= Simulation.Settings.Timing.FixedTimeStep)
{
// Advance simulation by FixedTimeStep
...
_accumulatedTime -= Simulation.Settings.Timing.FixedTimeStep;
}
That means, you can use a variable XNA time step and call Simulation.Update(variableTime). The simulation will divide this time into fixed time steps internally.
If, for some reason, you want to force the simulation to use a variable time step, then you have to update FixedTimeStep before each Update() call:
Simulation.Settings.Timing.FixedTimeStep = variableTime;
Simulation.Update(variableTime);
Since XNA Game.IsFixedTimeStep is buggy, you might want to try to set IsFixedTimeStep = false and do the fixed time stepping in Game.Update() manually:
protected override void Update(GameTime gameTime)
{
_accumulatedTime += MathHelper.Clamp((float)gameTime.ElapsedGameTime.TotalSeconds, 0, Simulation.Settings.Timing.FixedTimeStep * Simulation.Settings.Timing.MaxNumberOfSteps);
while (_accumulatedTime >= Simulation.Settings.Timing.FixedTimeStep)
{
// Update game logic and simulation with FixedTimeStep.
...
_accumulatedTime -= Simulation.Settings.Timing.FixedTimeStep;
}
base.Update(gameTime);
}
Be aware that XNA GameComponents are updated in base.Update(), therefore they are still updated with the variable time step. This could cause problems and the interaction of the GameComponents with other fixed time step game logic must be designed carefully.