Locked 30 FPS plays is jiggly, laggy

Hello everyone,

When I lock my game to fixed 30 FPS, it doesn’t look like other games running at that speed: it feels/seems laggy and jiggles. Even locked 60 FPS is not as smooth as it’s supposed to be. If I turn off the FPS limit (or set it to a high value), then it plays perfectly.
I’ve read that I’m supposed to do some kind of interpolation between the frames on lower framerates, but I couldn’t find any examples of that and I don’t how this works. Is there some good source for this online, or some other trick I can do to solve this?

Whats your code for setting 30fps?

            IsFixedTimeStep = true;
            graphics.SynchronizeWithVerticalRetrace = false;
            TargetElapsedTime = TimeSpan.FromSeconds(1d / Config.FPS); //60);

You need to use timespan.fromticks

TargetElapsedTime = TimeSpan.FromTicks((long)(TimeSpan.TicksPerSecond / targetFPS))

See here

1 Like