The Elusive Frame Timing

Finally, an explanation for why some games stutter on your PC (and a glimpse of hope that this might stop happening in the near future)

Stu-tu-tu-tutter

Photo by Agê Barros on Unsplash

Stutter, smoothness, performance… it’s all the same, right?

PC gamers often complain that games stutter even when there are no frame rate problems.
In the past 5 years, stutter has become (relatively) a bigger problem than performance!

A decade of search for the cause of inexplicable stutter

The patient is definitely alive. It just stutters a bit too much.
Nessie, Sasquatch… almost as elusive as the “heartbeat” issue.

What’s been going on all along

Set YouTube viewer to “1080p60” to view videos at 60 fps.
Testing, testing, one, two, three… You should be able to see this video as smooth 60 fps.
This is what a “stutter at 60 fps” looks like. We call this symptom the “heartbeat”.

It looks very not-smooth when you play the entire animation as a whole, but when you go frame-by-frame, there are no discontinuities!

How can that be?

Top: correct 60 fps video, bottom: “heartbeat”. Played back 20x slower.
Six consecutive frames from the comparison video, with precise timing. Top is correct, bottom is heartbeat stutter.

A brief history of frame timing

What is actually going on today

Six consecutive frames from the comparison video, with precise timing. Top is correct, bottom is heartbeat stutter.

This is what we see as a stutter — animation generated for a varying frame rate (heartbeat) being displayed at actual correct fixed frame rate.

First we observe the “heartbeat” and then we use a little trick to make it go away.

Is the solution that simple?

So, how can the game know when a frame’s image is actually shown on screen? You might be surprised to learn that, in the current situation— there’s no way to do it!

What now?

Miscellaneous caveats and other details

“The Compositor”

This frosted-glass effect? Yep, that’s why we absolutely must have a compositor. Pretty essential, isn’t it, eh?

Power and thermal management vs rendering complexity

Couldn’t we just…

--

--

Code, project management, game design and psychological help for programmers. TD @ Roblox. Also insatiable craving for all things tech and science.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alen Ladavac

Code, project management, game design and psychological help for programmers. TD @ Roblox. Also insatiable craving for all things tech and science.