The online racing simulator
Maximizing simulation smoothness? Physics timing, frame timing, and input lag
If I have a monitor that runs at 100Hz refresh rate, and knowing that LFS's physics loop runs at 100Hz, is there a way to ensure that each monitor refresh cycle displays a completely unique frame (i.e. no dropped or duplicated frames)? In other words, I want what I see on the screen to be in lock step with the physics loop.

Does enabling v-sync accomplish this? How does this impact input lag, if at all?

I would measure this myself but I lack the means to do so. Has anyone else performed such an analysis? I thought Scawen might be able to provide some insight as well.
Thats why there is this panel on the right.

When everything has a flat vertical line then its perfectly tuned (I assume)
Attached images
lfs_00000018.jpg
I do not see any reason to lock the FPS on any game (other than screen tearing).You will always be better with more FPS, there is a huge difference between 100 locked fps and 300-400.Counter-strike runs at 60hz, but do you see anyone locking their fps to 60?
You will actually get more input lag when you lower your fps intentionally.If you have screen tearing get a 144hz monitor.
I see. I found Scawen's post explaining those graphs here:
https://www.lfs.net/forum/post/1892388#post1892388

It appears v-sync is to be avoided. With v-sync on, I see some frame stutter every 5 seconds or so, represented in the physics graph as a series of alternating missed and duplicated frames lasting a half second.

After playing with the settings it appears the following are optimal for achieving a solid line in the physics graph with a 100Hz refresh rate and minimal input lag:
- v-sync off
- frame rate limit on
- max frame rate 100 fps
- sleep every frame off
- max buffered frames 0
Quote from taipalsaari :I do not see any reason to lock the FPS on any game (other than screen tearing).You will always be better with more FPS, there is a huge difference between 100 locked fps and 300-400.Counter-strike runs at 60hz, but do you see anyone locking their fps to 60?
You will actually get more input lag when you lower your fps intentionally.If you have screen tearing get a 144hz monitor.

Just by virtue of the way LFS works, with its 100 Hz physics loop rate, 100 fps is actually smoother than 120 fps on a 100Hz monitor. You really want your framerate to be a multiple of 100 at all times, and 100 is the easiest to maintain.
Quote from taipalsaari :Counter-strike runs at 60hz, but do you see anyone locking their fps to 60?

Yes, me!

Otherwise my laptop gets too warm and this is not something what I desire in a 35 degrees climate http://i.imgur.com/lkKDQzQ.png . It's a trade off between optimization and real world circumstances Wink
Quote from taipalsaari :I do not see any reason to lock the FPS on any game (other than screen tearing).You will always be better with more FPS, there is a huge difference between 100 locked fps and 300-400.Counter-strike runs at 60hz, but do you see anyone locking their fps to 60?
You will actually get more input lag when you lower your fps intentionally.If you have screen tearing get a 144hz monitor.

Clearly you don't know enough of how graphic/game engines works. Not that it is a bad thing.

LFS operates at 100Hz (this includes graphics and physics. I'm not 100% positive but I believe it also includes inputs). This means that having more 100fps is not really possible. Your graphics card will render all the frames that it can, but as LFS' graphics loop hasn't iterated yet, you will only get the same duplicated frame. As Cargame says, you get a hotter and noisy card, and a bigger e-pennis (I unlocked the fps years ago and never locked them again :facepalmSmile. In LFS you get input lag if you lock your frames below 100fps, for sure. If the input read is higher than that, your steering wheel polls at 500Hz, so that would be your limit.

Of course, other engines work in a quite different way. Some of them don't even run at a fixed rate and deal with delta times instead of Hz.

FGED GREDG RDFGDR GSFDG