PDA

View Full Version : Physics Engine Refresh Rate Limiter.


vixer
22nd January 2008, 23:35
Hello, would that be a solution to the lower then 100hz refresh rate display vsync issue ?

DragonCommando
22nd January 2008, 23:55
I think setting the physics engine speed to anything lower than 100hz might cause worse stuttering than people get now.

I've thaught about it alot and the only thing I could see helping any is if it where set to 120hz, this way, for a refresh rate of 60hz you see every second physics frame, that should make things more stable.

Bob Smith
23rd January 2008, 00:01
You can't adjust the timestep used in the physics integration else you won't be compatible online with any other clients. It should have no bearing on v-sync anyway.

vixer
23rd January 2008, 00:13
This is horrible :-).

DragonCommando
23rd January 2008, 00:21
I was talking about changing the steping permanantly to something like 120hz, because people have noticed the inconsistancy with the physics stepping and the frame drawing.

So by setting it to 120 and telling people to set there frame limmiter to 120fps or 60fps, they will get a less noticable stutter, if any at all, it all depends on there system's ability to draw at the frame rate matching or at half the physics stepping.

Woz
23rd January 2008, 00:25
I was talking about changing the steping permanantly to something like 120hz, because people have noticed the inconsistancy with the physics stepping and the frame drawing.

So by setting it to 120 and telling people to set there frame limmiter to 120fps or 60fps, they will get a less noticable stutter, if any at all, it all depends on there system's ability to draw at the frame rate matching or at half the physics stepping.

The physics and the render engine are not coupled in that way. The physics outer runs at 100hz while the core runs at 2000hz. All of this ALWAYS runs at that speed no matter what vsync you select.

I don't get what you are talking about with the 120?

DragonCommando
23rd January 2008, 00:37
people are noticing a jump in the cars, sort of a stutter. Many people belive it's because of the physics engine.
(not related to online lag, it hapens offline to)

What I'm saying is that if the physics are runing at 100hz, and you run a refresh rate of 60hz, even though they arn't connected you will still see some sort of stutter since the physical positions to be renderd are updated 100 times a second and the screen is only updated 60 times a second. this means sometimes you will see one frame forward, and sometimes you will see two frames forward. It gives some people what they describe as a shake or stutter.

And no mater if you have v-sync on or not, you will still see this stutter, because your monitor is refreshing at a different rate than the physics are updating.

The idea is to eliminate this stutter by setting the physics update to 120hz, this way if people have a monitor that refreshes at 60hz, it should be droping every second physics update instead of getting only a large percentage of them.

People have discussed this problem before, and some suggested setting it to monitor refresh rate, but as you stated, that would make it incompatable with other people.

Woz
23rd January 2008, 02:10
people are noticing a jump in the cars, sort of a stutter. Many people belive it's because of the physics engine.
(not related to online lag, it hapens offline to)

What I'm saying is that if the physics are runing at 100hz, and you run a refresh rate of 60hz, even though they arn't connected you will still see some sort of stutter since the physical positions to be renderd are updated 100 times a second and the screen is only updated 60 times a second. this means sometimes you will see one frame forward, and sometimes you will see two frames forward. It gives some people what they describe as a shake or stutter.

And no mater if you have v-sync on or not, you will still see this stutter, because your monitor is refreshing at a different rate than the physics are updating.

The idea is to eliminate this stutter by setting the physics update to 120hz, this way if people have a monitor that refreshes at 60hz, it should be droping every second physics update instead of getting only a large percentage of them.

People have discussed this problem before, and some suggested setting it to monitor refresh rate, but as you stated, that would make it incompatable with other people.

And are these same people using vsync ON as well, if not they also have the fact their fps will also render at a different speed to the screen. There are a few different rates here, it is not as simple as you make out.

BTW: If you lock fps at 60 in LFS it will NOT render 60fps but less so this again is a missmatch. We have 3 rates that all do different things to deal with

1) Physics (100hz + 2000hz inner)
2) Screen render (x fps)
3) Screen refresh (x fps)

As 100th of a second is tiny I really doubt this is the cause. How much are the cars jumping? Never seen it myself.

I have the following rates going on

1) Physics (The locked 100hz)
2) Screen render (Between 40-60 fps, max locked at 60fps so really about 59.5fps)
3) Screen refresh (85hz 21"crt)

I would assume with what you say that with my setup if the physics look was the cause mine would be a real mess no?

BTW, you would never be more than one frame out of sync so I would expect most to fall slightly after and a few before. Never one 2 after unless your FPS was really low.

DragonCommando
23rd January 2008, 02:25
I haven't actualy experianced it myself, but I did alot of thinking on the subject, and you are right, there are alot of miss matches all the time. But it can still effect things.

Some people have very sensitive eyes, I personaly don't notice any stuttering, but some people do. Even on my computer one of my friends noticed it, and I can't see a difference.

I already stated that V-sync isn't involved at all. It has to do with the rates between the monitor and the physics system.
I don't use v-sync, I actualy use a frame limmiter if the game has it.
I lock my frame rate at 60fps no matter what, I don't use the actual in game counter though, that always shows one high.
Infact, in goldsrc games like half-life, if you set FPS max to 60 it reads the real value as 59, so you actualy have to set it to 61 to get 60fps.

It might not be anything to do with the physics system, but people are noticing a stuttering, and it's not just happening on low spec computers. So I think it warants some kind of investegation.

Woz
23rd January 2008, 03:49
I already stated that V-sync isn't involved at all. It has to do with the rates between the monitor and the physics system.

You cant look at those two in isolation because you have the render FPS in that mix as well and that sits between the two causing even more missmatch. The 3 different rates all effect each other.

Unless the render is locked to monitor refresh (Which in its own way introduces jump glitches) the missmatch between render and sync can cause its own set of issues depending when the vsunc hold occurs and when the previous frame completes etc.

Even if the physics were updated to 120hz if the render and montor are not synced then you have the same problems again and you still will not get the physics and screen to sync fully.

I have known people throw up playing FPS games yet they never effect me in this way. I know people that can hear the high pitch hum from crt displays but that is beyond my hearing. Both these, like this, effect a small percentage I think.

Unless this is a huge problem, and I have not heard of it until now, then it might just be people who see things like that.

vixer
23rd January 2008, 04:01
I can see the stuttering very clearly but only with vsync on.
The stuttering appears only when the car is moving but when i hit the breaks and i can see the work of the suspention (the wiggling) then there is no stuttering so its got to do with the phis. eng.
And Woz if u got an 75hz display then you can see it on this video http://rapidshare.com/files/71030808/combo.avi
i did post it some time ago but you missed it. Notice that this vid requiers 75hz refresh.

ColeusRattus
23rd January 2008, 11:04
The vsync stuttering has nothing to do with the physics engine, but with how VSync works. It can basically only render at the set FPS or at factos of it, if it can't reach the desired framrate.
For example, the render rates for 60 hz would be: 60 (every frame), 30 (every second frame), 20 (every third frame), 15 (every forth frame), ... etc
Now the problem with vSync is, that once you drop below 60 (menaing, as soon as you have 59 FPS), you instantly drop to 30 FPS, which will cause visible stuttering.

Woz
23rd January 2008, 11:08
I can see the stuttering very clearly but only with vsync on.
The stuttering appears only when the car is moving but when i hit the breaks and i can see the work of the suspention (the wiggling) then there is no stuttering so its got to do with the phis. eng.
And Woz if u got an 75hz display then you can see it on this video http://rapidshare.com/files/71030808/combo.avi
i did post it some time ago but you missed it. Notice that this vid requiers 75hz refresh.

I can see the juddder on my lappy lcd on the vid. The distant background is jumpy. I dont believe that is caused by a mismatch between the physics loop and sync tbh. Does look odd though.

Just run with sync off. If your fps evers drops below the sync rate iy will really jar.

vixer
23rd January 2008, 14:31
The vsync stuttering has nothing to do with the physics engine, but with how VSync works.
Ok, why then there is no stuttering when the car is not in motion ?
My frame rate never drops below 75fps and with vsync off i get about 150fps but i can not play without vsync.

Woz
23rd January 2008, 19:12
The vsync stuttering has nothing to do with the physics engine, but with how VSync works.
Ok, why then there is no stuttering when the car is not in motion ?
My frame rate never drops below 75fps and with vsync off i get about 150fps but i can not play without vsync.

You get the jumping while moving because the frames are held back after render until they fall on a sync boundary. This means sometimes you see a frame that was created early in the frame and sometimes its later in the frame.

You don't see the jumping when you are not moving because there is no movement to notice it by. The physics engine is still running full speed and so is your render. Its just every frame is the same.

You will notice that th jumping is the very distant objects, which is expected. If you think of the timing issues where frames complete render at different times within a slot you can see that objects further away will not move in such a fluid way, but look jumpy.

Your eyes really notice difference in movement. So even slight changes in the movement speed of the distant objects can jar.

When you turned in a circle like that it makes the matter appear even more because you are moving the distant objects faster and so the jumping is highlighted further still as the differences in time become amplified.

You should be able to run with vSync off BTW with any monitor type, it will be in your GFX car settings. All that happens when you do this is that you machine will render as fast as it can. You machine will display the frame buffer on vsync boundaries so it can create a tear in the image as one display frame might be made up of the mix of two frames but because you are running faster it will feel more fluid.

xaotik
23rd January 2008, 19:21
This is horrible :-).

No. This (http://www.coca-colahbc.com/country/images/my-amita-sinthesi.gif) is horrible.

vixer
23rd January 2008, 19:50
You dont have to driver the car to make it move, after breaking to 0 there still is a movement from the suspention and in that moment there is no stuttering or skipping. Woz you can not talk bout this video if you dont use a display with 75hz refresh, ur laptop's display can go up to 60hz right ? In that video there are two games first is LFS and second is M3 Challegne and the second game runs smoother the LFS, but you need 75hz to see it. I know i can play without vsync but i love full frames thats why i cant play without it :-). And FPS limiting only limits the FPS but i does not sync the G card with the display, that means the frames are not being showed from the first line of the display.

xaotik
23rd January 2008, 21:04
You dont have to driver the car to make it move, after breaking to 0 there still is a movement from the suspention and in that moment there is no stuttering or skipping.

Yes, but the physics engine is not off at the time. Video refresh rate is totally unrelated to the physics engine frequency of computation.

Stang70Fastback
23rd January 2008, 21:06
Could someone quickly explain the issue with VSync (what it is, and why it seems to be the center of these physics arguments so often?) I am intrigued, but also a bit confuzzled :shrug:

Shotglass
23rd January 2008, 21:10
hes right woz a 60hz stepping and a 100hz one will go in and out of synch and you can see it if you look at the vid frame by frame
the only problem is there is no real solution for it ... if you bump the physics rate up to 120 everone who doesnt own a tft will still have it and 100hz tfts are closing in on their release date
the only final solution would be a much higher physics rate which is just not possible with todays cpus

NikLaw
23rd January 2008, 21:34
My FPS, locked at 66 FPS, doesnīt go to 30 if they slip below 60 FPS.
If you have problems with that try out riva tunerīs D3DOverrider. Thatīll keep the FPS up, even if the desired refresh rate isnīt reached.

I donīt have stuttering at all and I am sensitive about frame drops.

vixer
23rd January 2008, 21:35
Stang70 its all about frame skipping. And you cann se it on that vid going frame by frame. Its like 1,2,4,5,6,8...
NikLaw do you use vsync ? The solution would be an limiter for the Phis Eng. Limiting it to 75hz would fix it cous engines would not go out of sync, i think :-). Why can it not be made like in todays games ? Online FPS limit 90 and ppl with 60hz frefresh can play with ppl on 85hz.

NikLaw
23rd January 2008, 21:38
Yes. I always turn vsync on, because I have a TFT. 75 hz arenīt ideal for vsnyc, because you canīt divide it by 2.

vixer
23rd January 2008, 21:42
Ok u got vsync on (there is no mather CRT or LCD or what ever, vsync allways works the same) but do you get the same amount of frames as your displays hz ? 75 hz arenīt ideal for vsnyc, because you canīt divide it by 2. What ? Man what is vsync for ?

NikLaw
23rd January 2008, 21:45
I get 59.9 to 60 normally, full grid 50-60. I lock the FPS at 66, because locking it below gives me 58 to 59.9 which is a bit jerky.

vixer
23rd January 2008, 21:48
If u dont get more FPS then hz then turn vsync off. U wont get full frames but you will have more of them.

NikLaw
23rd January 2008, 21:55
Maybe I was misunderstood, because when I turn vsync off I get 110 - 150 FPS and that gives terrible tearing on a TFT.

vixer
23rd January 2008, 21:56
Ah ok, so what's the locking for ? :-)

NikLaw
23rd January 2008, 22:06
Locking keeps your pc away from rendering more frames than you can see on your monitor.

vixer
23rd January 2008, 22:07
Vsync does the same Man :-). And even more.

GobLox
23rd January 2008, 22:10
Traditionally, drawing the current scene, which includes static scenery and dynamic entities like cars and tires, is handled by a subroutine, or series of subroutines that are visited once each time through the main loop. I would be pretty surprised that a program that does not support multi-threading did not handle video in this manner. There's not much of any reason to compute physics data with any more fidelity than can be displayed so this arrangement makes sense. As far as online play is concerned, other clients are receiving updates from your client at approximately 10hz (assuming a 100ms ping) which is certainly why you see cars "jerking" or "warping" around the track.

vixer
23rd January 2008, 22:16
And what does it have to do with frame skipping in singleplayer on a non 100hz display in vsync mode ? :-)

Bob Smith
23rd January 2008, 22:17
75 hz arenīt ideal for vsnyc, because you canīt divide it by 2?
Frame rates aren't integers you know.

vixer
23rd January 2008, 22:20
Is there a way to set the Phis. Eng. R.Rate to 75hz so i could see if that is it ?

Bob Smith
23rd January 2008, 22:27
Yes, but it would require hex editing the executable or memory, and no doubt would take some time to find. I'd imagine there would be a lot of matches to values of 0.01.

GobLox
23rd January 2008, 22:29
And what does it have to do with frame skipping in singleplayer on a non 100hz display in vsync mode ? :-)

I've never witnessed that behavior. AI cars (and all aspects of the game) move smoothly on my computer. If you are using a single core computer, any background tasks that utilize the cpu for more than 15ms will appear as a dropped frame to you in-game. This was always very frustrating to me back in the day; when you'd have monster frame-rates only to get dropped frames when the OS had to do anything. Multithreading support from an application just means that you are giving it access to another core and effectively more processing power; games that don't need that much CPU time and run under one thread still benefit on a multi-core system in that the OS utilized the other core for anything else that comes up and your game has uninterrupted access to a processor.

vixer
23rd January 2008, 22:33
My set. Pentium DC E2140 o/c @ 3GHz, 1gB dual channel running at 750MHz 1:1 and 8800GTS 320mB. With AAx16,Anisox16,max detail i get over 150FPS without vsync so its not my set that is the prob. It seams that LFS is the first game that in the requirements has got 100hz display :-).
GobLox what display have u got ?

Woz
23rd January 2008, 22:58
I could see the difference between LFS and the other sim fine with 60hz lcd, but you appeared to have missed that. You don't need 75Hz sync because AVI will not store the vid at 75fps and most systems will frame skip if they cant render at full speed anyway.

As I said earlier. The jumping you see on the distant objects is related to the fact vsync HOLDS back frames from render until specific time slots. Think of a line that you have drawn 60 equal spaced marks on. Now think of 100 equal spaced marks in a different colour on the same line.

Shotglass is right that a missmatch can cause interferance patterns and the more out of sync the more you will notice. With VSync on you are selecting the frame for display that was the last one rendered before the next 60th marker. These occur at different times within that 60th of a second.

Human eyes are good at detecting differences in the speed of movement, this is what you see with the judder. The far away objects are far enough away that the small time steps differences are amplified with distance to cause a non smooth movement of these objects.

Now it is NOT possible to change the physic loop step for a number of reason.

1) YOu assume that 60Hz is the current common sync rate. And for an LCD that is correct. By my CRT will run as stupid sync rates depending on screen res, 150hz+. And as pointed out 100hz is coming for LCD.

2) If you allow different physics steps for each person it will cause all forms of online issues.

3) The physics loop needs to run higher not lower to keep accurate, the faster teh car the faster the look needed. So while 120hz (2 * 60hz refresh) might be logical today the current 100Hz or an increase 200hz will be logical if 100hz lcds become more common.

You also have to remember the internal calculations of the loop run at 2Khz. A move to a 120hz other requires these to change to a 2.4Khz loop.

The ISI based sim is probably a bad example. Who knows what their main loop runs at. Their engine is a cludge so might run fast enough not to notice. The nature of PCs and software is such that it requires this sort of compromise and the split physics/render is normal. When LFS goes multi-thread so it can split physics across multiple cpu cores it will limit the ability to tie these even further.

The problem is you are using the wrong tool to try and match them, that being vsync. Your best solution IMHO if it is an issue for you is to TURN OFF vsync. Then lock the fps in LFS to multiples of 100fps (Sounds like your machine can run at 100fps fine).

The two will now be in sync and it should minimise the judder. The screen refresh rate will then be different to the render loop but unless there are HUGE changes in frames (Not common in race games as it is in FPS Shooters) you will not see the normal tearing associated with running at a different rate to sync.

I bet you notice the judder more through corners than on the straight.

Will be interesting to see the results if you tweak as I said.

vixer
23rd January 2008, 23:55
Woz dont tell me that you can see the difrance clearly on 60hz refresh couse i can't.
When i set my ref. to 60hz then the other sim (on this vid) runs like LFS in real and LFS (on this vid) runs even wors. I did try all refresh modes and only on 75hz the other sim runs like in real. This vid. is recorded in 75 PFS and to see all frames u need that refresh seted.

Dont tell me to turn vsync off.

Woz
24th January 2008, 02:02
Woz dont tell me that you can see the difrance clearly on 60hz refresh couse i can't.
When i set my ref. to 60hz then the other sim (on this vid) runs like LFS in real and LFS (on this vid) runs even wors. I did try all refresh modes and only on 75hz the other sim runs like in real. This vid. is recorded in 75 PFS and to see all frames u need that refresh seted.

Dont tell me to turn vsync off.

I am very sorry you are unable to see the difference running on a 60hz display but to me it stood out like a sore thumb. I can check on my CRT tonight at 75hz but I will bet I see nothing different at all. Also i have vsync OFF on my gfx card so it can render all the frames NO MATTER the refresh rate.

I have spent the better part of 20+ years watching computer gfx in all shapes and forms (From $10,000,000 flight sims with 180 degree concave mirrors down to games on pc screens). My eyes can spot the smallest glitch if I am looking. I know what I am looking for :)

I see the ISI sim as fluid and smooth and LFS jumpy on the distant objects, I am willing to bet I will see the same at 75hz and also at 150hz if I cranked it up that high.

Again you appear to confuse render FPS with display FPS. THEY ARE NOT THE SAME THING. It is 100% possible to render at 200fps on a 60fps screen. When you do you run the possibility of displaying a number of partial frames instead of a single locked frame that vsync gives you. This is the tear that many see, something I have already told you about.

NOW the guts of it..... What is the reason you appear to be unwilling to turn off vsync? This I really want to hear.

Just turn it off for a few minutes. Lock your FPS in LFS to 100 and then tell me what you see. How hard is that.

If this is caused by the missmatch between physics and render as you believe then this will show it because the jumping should minimise or stop. When you run with vsync you FORCE timing issues in the render pipeline because you are telling you system to hold up the display of a frame until the next 1/60 second time slot, later than it should be.

LFS is NOT like an ISI sim. ISI sims appear to be GFX bound NOT CPU bound like LFS so I would expect different results in the two.

So, come on. TRY with vsync OFF for a few seconds. I just do not understand WHY you will not.

vixer
24th January 2008, 03:13
You think i didnt try it without vsync ? Woz download BMW M3 Challenge (its small) , play it with vsync on (but not 100hz) and tell me that M3 is not runing smoother then LFS. If u get more FPS then hz u should turn on vsync couse it makes the G card wait with the next frame till ur display is finished with showing the actual frame, and without it (even with limiting FPS to R.rate ) u get frame tearing. Thats why i can't play without it.
"Just turn it off for a few minutes. Lock your FPS in LFS to 100 and then tell me what you see. How hard is that" Well it is not hard but boring :-) i did post about it in my first thread.

Woz
24th January 2008, 04:17
You think i didnt try it without vsync ? Woz download BMW M3 Challenge (its small) , play it with vsync on (but not 100hz) and tell me that M3 is not runing smoother then LFS. If u get more FPS then hz u should turn on vsync couse it makes the G card wait with the next frame till ur display is finished with showing the actual frame, and without it (even with limiting FPS to R.rate ) u get frame tearing. Thats why i can't play without it.
"Just turn it off for a few minutes. Lock your FPS in LFS to 100 and then tell me what you see. How hard is that" Well it is not hard but boring :-) i did post about it in my first thread.

I can't run any of the Simbin sourced sim/games at all. All of them lockup in the menu sytem of the game. This is a well known and well reported bug that they refuse to deal with. Happened with GTR, GTL, M3 and probablty GTR2 and Race but I have ignored them all since I wasted money on GTR and GTL. rFactor does not have the problem so this is a bug Simbin created and refuse to fix.

I have to question why you think 100hz is a magic number in ISI based sims. I have no idea what speed their physics engine runs at and I think they do not publish that data. Unless you know what their render and physics systems do and at what speed all you can say is one runs more fluid than the other. And I agree it appears to be more fluid.

I have told you WHY vsync can cause this problem but here is one last try...

With VSYNC ON the time between when frames are rendered and when they are displayed can be upto 1/60th of a second. This causes slight position problems because the frame displayed could actually be where you were 1/60th of a second ago.

Now think about your video. When you are driving around in a circle think what this means to the objects in the far distance. Think of a fraction of a degree rotation mistake caused by a frame holding. Now draw a line from your car to an object in the distance. The further the object is away the more this fraction of a degree becomes a big difference in distance.

Now think that every 1/60 of a second while LFS is running that position mistake will be different because your vsync is frame holding.

If you let LFS render faster than the 60fps sync rate you letting it create frames at more natural intervals without the same timing issues. So even though your display can't display at full tilt the movement can appear more natural.

You already KNOW the solution to your problem but you do not want to accept it.

The bottom line is that when YOU run vsync on you get judder and when it is off you do not. You have to decide if you want judder or tearing, the choice is yours. Personally I would say tearing is less of an issue and far less noticable in a car sim type environment so that would be my choice.

The choice to change the physics tick speed is NOT one that can be taken lightly, it has far more knock on effects than you would expect. Also why lock it to the refresh rate of LCD technology of today when that will change tomorrow. The physics should render at the speed required to make the car feel like a car for the most people.

Right, I am out of this thread now.

Anything else I say will just be repeating the same old again and again. If you have it set in your mind that VSYNC ON is the only option you will ever run at no matter what then you have backed yourself into a corner that will stop you enjoying LFS. Myself I learnt a long time ago that the world is not black and white and sometimes you NEED to compromise a little.

Have fun and I hope I managed to let you understand the implications iof vsync a little more.

vixer
24th January 2008, 05:25
What kind of choice is that ? Judder or tearing ? Bad or not good :-).
I know why LFS on my pc skippes 1 frame on 4, i just wonted to know if there can be a P.E.R.R.L.

"I have to question why you think 100hz is a magic number in ISI based sims." Thats why http://www.lfsforum.net/showthread.php?t=33742&page=2 but i did say that Rfactor runs fine so its only bout LFS.

Woz
24th January 2008, 06:05
What kind of choice is that ? Judder or tearing ? Bad or not good :-).
I know why LFS on my pc skippes 1 frame at 4, i just wonted to know if there can be a P.E.R.R.L.

"I have to question why you think 100hz is a magic number in ISI based sims." Thats why http://www.lfsforum.net/showthread.php?t=33742&page=2 but i did say that Rfactor runs fine so its only bout LFS.

Right, I have read through the thread you liked and you get the same answers time and time again. You are told the same every time...

TURN OFF VSYNC.

Yes I know you will get tearing BUT use the FPS lock in lfs to minimise this. If you are at 60hz try 60 or 120 fps. If you are at 75hz use 75 or 150 fps etc.

You will find the sweat spot and then your LFS will be smooth.

After reading the other thread and from the people that have stepped through the vix frame by frame it sounds like you are dropping frames. This is one of the problems with vsync.

So at least TRY with it off and the settings I mention to see how that goes for you. Normally you will only experience noticable tearing with mismatch refresh and fps rates. It is not as bad as you imagine.

vixer
24th January 2008, 07:31
Woz i did try it all befor i did the first thread.
But what i dont get is why ppl r telling me to turn off vsync, it is an option that i can and should use, like air its there but dont use it, for me its like that. Ok this is it THX all.

Woz
24th January 2008, 10:21
Woz i did try it all befor i did the first thread.
But what i dont get is why ppl r telling me to turn off vsync, it is an option that i can and should use, like air its there but dont use it, for me its like that. Ok this is it THX all.

lol

We are telling you to turn off VSync BECAUSE IT WILL STOP THE STUTTER!

I get the feeling you have some strange "my rig is fast enough so MUST use vsync ALWAYS no matter what" thing going on mate.

I take it you have not been around PC's long enough yet to understand that things are NOT black and white 100% of the time.

Sometimes you have to use settings you feel are not "optimal" to improve things. This is called a work around, a common thng. One day you will learn, until then enjoy stutter vision :)

micha1980de
24th January 2008, 11:50
hes right woz a 60hz stepping and a 100hz one will go in and out of synch and you can see it if you look at the vid frame by frame
the only problem is there is no real solution for it ... if you bump the physics rate up to 120 everone who doesnt own a tft will still have it and 100hz tfts are closing in on their release date
the only final solution would be a much higher physics rate which is just not possible with todays cpus

but i doubt that "M3 challenge" has a high res phys engine/core running.
In fact i tend to agree that lfs has a more profound problem with the constant frame differences as shown by the spinning-video.

regards

micha1980de
24th January 2008, 11:56
I could see the difference between LFS and the other sim fine with 60hz lcd, but you appeared to have missed that. You don't need 75Hz sync because AVI will not store the vid at 75fps and most systems will frame skip if they cant render at full speed anyway.


Wrong, just open the vid with virtual-dub and hit Shift+R the "frame rate" dialog pops up showing a avi with 75 encoded frames per second...

regards

J.B.
24th January 2008, 12:50
lol

We are telling you to turn off VSync BECAUSE IT WILL STOP THE STUTTER!

I get the feeling you have some strange "my rig is fast enough so MUST use vsync ALWAYS no matter what" thing going on mate.

I take it you have not been around PC's long enough yet to understand that things are NOT black and white 100% of the time.

Sometimes you have to use settings you feel are not "optimal" to improve things. This is called a work around, a common thng. One day you will learn, until then enjoy stutter vision :)

Turning off Vsynch will not stop the inconsistent step sizes that make LFS run slightly unsmooth. Go through the video step by step in virtual dub to see what he means. I don't really see a solution though. It's more a problem with the LCD manufacturers than with LFS.

csurdongulos
24th January 2008, 12:57
stupid question, but can someone describe me this tearing effect? I have a 75hz lcd, running vsync off and fps limit off.

I tried vsync on and got stuttering (or judder as it is mentioned here), turning it off is fine for me and LFS is working fine. According to the other posts I should be experiencing some tearing, which I cannot identify, please someone enlighten me. :)

Bob Smith
24th January 2008, 13:06
I don't know what circumstances have to happen for tearing to happen, I have seen it before on others machines but it seems very rare for me.

J.B.
24th January 2008, 13:36
stupid question, but can someone describe me this tearing effect? I have a 75hz lcd, running vsync off and fps limit off.

I tried vsync on and got stuttering (or judder as it is mentioned here), turning it off is fine for me and LFS is working fine. According to the other posts I should be experiencing some tearing, which I cannot identify, please someone enlighten me. :)

Screen tearing is when the image seems to be torn horizontally into two parts. It only happens while scrolling horizontally and is noticable because one part doesn't keep up with the other part. See this pic to get an idea. http://www.richleader.com/images/Pulse/bargainbin/bargain_bin_review/tearing.jpg

It's usually not a problem with LFS but if you want to see it try a side scrolling game on a game boy emulator with vsynch off. And you need an LCD, never seen it on CRT.

Kegetys
24th January 2008, 13:52
One solution would be to interpolate all the object positions based on exact frame rendering time between previous and current "physics" frame. That would also allow rendered framerates higher than the physics rate, though of course with interpolated "fake" data. It would require a small lag on the rendered frame though, but that would be just 1ms in LFS' case (100 Hz physics rate)

csurdongulos
24th January 2008, 13:58
Screen tearing is when the image seems to be torn horizontally into two parts. It only happens while scrolling horizontally and is noticable because one part doesn't keep up with the other part. See this pic to get an idea. http://www.richleader.com/images/Pulse/bargainbin/bargain_bin_review/tearing.jpg

It's usually not a problem with LFS but if you want to see it try a side scrolling game on a game boy emulator with vsynch off. And you need an LCD, never seen it on CRT.

thanks JB for the explanation, never noticed it during my years playing LFS.

w126
24th January 2008, 15:52
One solution would be to interpolate all the object positions based on exact frame rendering time between previous and current "physics" frame. That would also allow rendered framerates higher than the physics rate, though of course with interpolated "fake" data. It would require a small lag on the rendered frame though, but that would be just 1ms in LFS' case (100 Hz physics rate)This post http://www.lfsforum.net/showthread.php?p=241752#post241752 suggests it will be done this way.
Another option would be to use extrapolation based on the last physics step positions and speeds. No lag in that case, it could cause worse problems though.

J.B.
24th January 2008, 17:35
Fast, extra smooth dual core LFS. That would be a great way to finish off the S2 stage once everything else is done.

Shotglass
24th January 2008, 19:29
but i doubt that "M3 challenge" has a high res phys engine/core running.
In fact i tend to agree that lfs has a more profound problem with the constant frame differences as shown by the spinning-video.

regards

im fairly sure that isi engines work on refresh and not at a constant rate

I don't know what circumstances have to happen for tearing to happen, I have seen it before on others machines but it seems very rare for me.

the only thing that has to happen is that the frame output buffe of the video card get a refresh when the electron beam is not in the top left corner of your screen (or the input buffer of the lcd is halfway through reading)

depending on the setup it happens all the time although it mostly goes unnoticed unless its right in the centre of the screen
in fact most fps at the highest levels of competition are played with as much tearing as possible to make sure the frame you aim at isnt delayed

Stang70Fastback
24th January 2008, 19:48
Speaking of tearing, why do I always get that effect on ONE of the two monitors hooked up to my graphics card? One of the screens always has a "tear" in the middle of the screen.

Woz
24th January 2008, 21:07
In the end, most here probably agree that having the physics loop disconnected from the rest of the sim is a good thing. It gives the LFS physics a solid feel that other sims miss. I think trist is right that ISI sims do not have a "locked" physics engine and that might explain the smooth render, unless you have low FPS when it all falls apart.

The day that iD decoupled the frame rate and the physics engine from each other in the Quake series of games was a great day for FPS shooters. Q3 was so much better, more consistent and solid feeling for it. So a step back to coupled is NOT the way forwards.

Until the install base is of high enough install base spec for LFS then we will probably remain locked at the 100hz(outer)/2000hz(inner) loops in the physics. Faffing about changing to 120hz etc will just move the problem about and not solve, there are just too many different "natural" refresh rates to deal with, the most common 60, 75 and 100.

The ideal loop speed is probably around the 300hz(outer)/6000hz(inner) mark as this is 5*60, 4*75, 3*100 so would solve all the missmatch for almost all users out there. Throuble is that the hardware base will not support that.

WHat I don't get is that Vix has said if he disables VSync then the problem is minimised/goes, only really happens with sync on. SO he HAS the solution but is unwilling to use it, that to me is a little dumb no?

Bob Smith
24th January 2008, 21:18
I don't think hardware would struggle that much, tbh. And your solution doesn't work for 85Hz users, like me and (surely) almost any other CRT user?

For reference, Todd's RC sim runs at (or at least did at one point during develpment) 600Hz outer, 60,000Hz inner. That runs on today's PCs.

frokki
24th January 2008, 21:34
I've got a 75hz LCD, and get horrible tearing if VSync is off. Also the game isn't smooth at all regardless how I set the FPS limit.

With VSync there is a tiny amount of judder, but the game is a lot more playable and nicer looking.

GFresh
24th January 2008, 21:40
Fast, extra smooth dual core LFS. That would be a great way to finish off the S2 stage once everything else is done.

Whilst we're briefly on the multi-core subject, would it be more work to make LFS use Multi-cores rather than use Dual-cores?.
I know it's been said that it would take an estimate of 1 month to complete work to make LFS dual-core supported (or was it Multi-core??), i'm just wondering if it would be better from the outset to make it just 'detect' how many cores your machine has, then use them in the most efficient way.
/Dream

EDIT: On the tearing subject, i have NEVER once experienced tearing before, i never have vsync turned on. LFS runs at 150 - 250 fps on my machine, do you only see tearing between a certain range? ie say 90 - 120 fps?

vixer
24th January 2008, 21:51
Woz and what i dont get is why do you think that no vsync is not bad.
You can not play SimBin games ok but that does not mean that there are no games that run smoother (with vsync) on a non 100hz display then LFS.
Vsync is the nr1 thing to set up. First vsync then resolution then detail then filtering and not the other way around.
Vsync changes sequential frames into a smooth movement.
Why is a console beter for a noob then a pc ? Couse Vsync is always on there and you dont have to configurate ur game to reach the hz.
Gfresh turn on vsync and notice that the frames are now being showed from the bigining to the end and not in half.
And Woz i dont play LFS now i play games that with vsync on do run smoothly on my pc :-).
Woz dont get me wrong but if u can see 75fps on a 60hz display then plz dont post any more in my thread :x.

Woz
24th January 2008, 23:18
Woz and what i dont get is why do you think that no vsync is not bad.
You can not play SimBin games ok but that does not mean that there are no games that run smoother (with vsync) on a non 100hz display then LFS.

Yep are right, many games will run fine and smooth on any refresh rate. I have never disputed this and you will not find me say that.

Vsync off is not bad in ALL cases or not as bad as YOU believe.

I am trying to say that with PCs, everything is a compromise. Sometimes you have to run with "non optimal settings" to get a less worse effect that the so called "optimal settings" give you.

I am NOT on about turning vsync off for ALL games. Just LFS but you appear to believe that I am telling you to never use Vsync.

Vsync changes sequential frames into a smooth movement.

Correct but as you have found out, it does NOT always have the desired effect. Any system that introduces artificial delays can intruduce its own side effects. But you just do not want to hear that do you or are unable to understand :)


Why is a console beter for a noob then a pc ? Couse Vsync is always on there and you dont have to configurate ur game to reach the hz.
Gfresh turn on vsync and notice that the frames are now being showed from the bigining to the end and not in half.

Yes as console is better for a noob because they don't have to fiddle. Your problem appears to be that you believe you have a "big rig" therefore you never have to compromise.

This, I promise you, will not be the last time you are forced to compromise with setting to get software to work or work better. This is just the reality of PC life, they are complex machines with many variables. Consoles in contrast are locked hardware in a known state which is why they are easier to code for and also use.

And Woz i dont play LFS now i play games that with vsync on do run smoothly on my pc :-).

Your loss then. You yorself have stated that when you turn it off the judder stops/is less noticable. So you are the person stopping your enjoyment of LFS :)

Woz dont get me wrong but if u can see 75fps on a 60hz display then plz dont post any more in my thread .

I am not saying I can SEE 75hz on 60hz display. I am saying I can see the JUDDER in LFS and see the ISI sim as smooth in your vid when the vid is viewed on a monitor with 60Hz display. Yes the effect is clearer at 75hz BUT the effect is STILL visible on a 60hz refresh screen.

You again fail to be able to understand that refresh rate and frame rate are not the same thing at all.

Does that help you understand?

HTH

wien
24th January 2008, 23:53
Whilst we're briefly on the multi-core subject, would it be more work to make LFS use Multi-cores rather than use Dual-cores?.It depends. If it's just a simple decoupling of the physics and rendering into separate threads that won't really help on a 3+ core processor as you only get two threads instead of one, but there are other ways the workload could be split in addition to that.

The obvious one (at least to me without having seen the code) is to run AI and car-physics in as many threads as there are cores available. This is a very intensive workload that should be fairly easy to split into multiple threads. Actually, I would probably start there if I where to multi-thread LFS, as that accounts for nearly half the used CPU time with a full AI grid, and is a major bottleneck in those circumstances. But again, I have not seen the code, and have no idea what would be easiest for Scawen to do. :)

EDIT: In case it wasn't clear, the latter technique would scale to any number of cores (limited by the number of cars basically), but of course the AI and physics would quickly cease to be the bottleneck and adding more cores after that happens would have minimal impact on FPS.

rcpilot
25th January 2008, 00:12
Combining the rendering and game/physics engines is a horrible idea. Ever played a game that was a little too intense for your system that was nearly impossible to control? That = combined engines. The game should always being running at a constant rate in the background regardless of what's being displayed on the screen. (And setting the physics refresh rate just to satisfy you? wha?)

vixer
25th January 2008, 00:47
Vsync off is tolerated in RPG games. FPP (racing is also FPP) games require vsync to run smoothly. There is no compromise with PC'c, something is working or not, someting is smooth or not. Compromise you have to with ur woman, but a PC must do what u wish and no exeption. Do you control ur pc or does it control you ?

Ur telling me to turn off vsync in LFS for what ? For geting tearing ?
Ur saying that LFS can not be run with vsync on ?
It does not give the desire effect, but why ? I know why do you ?

Ok i wanted to answer to every thing ur did post but i wonna try some thing.
You think that ur beter at pc stuff then me.
Tell me then what does FSB : DRAM 1:1 mean ?
What is Quad pomped bus ? And how does it work ?
How does dual channel work ? And what is the difference between single channel ?
What is beter CL3 or CL4 ?
What is CL ?
What does DDR mean and what is the difference between DDR and DDR2 and DDR3 ?
What is the difference between FSB (Intel) and HTT (AMD) ?
What is Speedstep ? And how does it work ?
When you o/c your cpu to much and it becomes unstable what should you do to make it stable again and im not thinking bout lowering the FSB.
What does FSB mean ?
What are the top two things that u should notice buying a G card ?
Why are dual core cpu's beter for a single core game the single cores cpu's ?
How can you reach Antialiasing x32 ? (there is only 1 way to do that)
What is the bigest difference between SLI and Crossfire ?

rcpilot
25th January 2008, 00:57
Ok i wanted to answer to every thing ur did post but i wonna try some thing.
You think that ur beter at pc stuff then me.
Tell me then what does FSB : DRAM 1:1 mean ?
What is Quad pomped bus ? And how does it work ?
How does dual channel work ? And what is the difference between single channel ?
What is beter CL3 or CL4 ?
What is CL ?
What does DDR mean and what is the difference between DDR and DDR2 ?
What is the difference between FSB (Intel) and HTT (AMD) ?
What is Speedstep ? And how does it work ?
and many more if you wont.
1:1 fsb to ram frequency ratio
quad pumped means quad channel, 4 times the connections, 4 times the bandwidth
dual channel - works like a raid array, spreads your data across multiple blocks so you're reading both chips for the same data
cas latency, 3 is better
ddr is double data rate ram, ddr2 is a marketing term for the most part (works by transfering data on the up and down clocks)
fsb and htt are essentially the same thing, don't throw marketing terms in here (htt is the same crap that they've been using for years with multiple channels for the fsb)
speedstep, declocks your processor depending on load and heat, only useful for laptops

Now, you just listed a bunch of games that have their game/physics engines mixed up in general. WHICH IS WHY THEY WORK WITH YOUR DAMN V-SYNC! Turn it off ffs, changing the engine is a worse option than anything anyone has suggested. Stop assuming you're a computer god and actually listen to what people have been suggesting. (I've been using these damn things since my mind started writing permanent memories and have been tweaking them over half of my life now at the age of 22)

Oh yeah, I'd love to see you maintain 75 fps for an entire race. I have an identical setup to yours as far as LFS is concerned and it still drops down to 50 or so.

And I'd also love someone else who's more familiar with programming come up with a little 'game engine' quiz for you (which this topic is actually about, knowing what any good computer tweaker knows about hardware is nothing in the software world). I know enough about game engines to know that I know barely anything, apparently you don't.

vixer
25th January 2008, 01:09
I wonted Woz to answer :-).
And what bout the rest? i was still adding :-)

DDR double data rate - DDR2 quad data rate. DDR3 is the same as DDR2 but works on lower voltages.
FSB stands for a buss that connects CPU with the Chipset and HTT is a bit different u know ? Integrated mem. controler ?
Speedstep is also good for PC's, lower power compsuntion.

quad pumped means quad channel, 4 times the connections, 4 times the bandwidth
yes but how does it work ? oh and it does not mean quad channel :-)

Quad pumped bus is 64bit wide and double pumped bus was also 64bit wide so how did they make it twice as fast ?

rcpilot
25th January 2008, 01:31
I wonted Woz to answer :-).
And what bout the rest? i was still adding :-)

DDR double data rate - DDR2 quad data rate. DDR3 is the same as DDR2 but works on lower voltages.
FSB stands for a buss that connects CPU with the Chipset and HTT is a bit difrant u know ? Integrated mem. controler ?
Speedstep is also good for PC's, lower power compsuntion.

quad pumped means quad channel, 4 times the connections, 4 times the bandwidth
yes but how does it work ? oh and it does not mean quad channel :-)

Quad pumped bus is 64bit wide and double pumped bus was also 64bit wide so how did they make it twice as fast ?
Oh gnoes, I stopped caring about reading every little review that comes across, I must suck at pc's. All this trivia means jack shit relevant to the topic.

And bump the voltages, front side bus, price and performance (question's way too broad, there are many things I look at when buying a gfx card, and all of them are rather important), computer has a chance to do things in the background with that extra 50%/75% cpu it has available, don't really care (probably has something to do with running quadro drivers or an equivalent), and the way in which they draw the screen. (one splits it half and half, the other interlaces, I believe crossfire's the latter but I'm not sure)

But... (ACTUALLY on topic) what you're asking the LFS devs to do is step backwards in the 'evolution of game coding.' Sure, you've spotted a disadvantage to their system, but the advantages to it FAR FAR FAR FAR FAR FAR FAR FAR outweigh the disadvantages to it. (Especially in a racing game where a stutter in the game engine can easily mean a loss of control.)

Woz
25th January 2008, 01:34
Vsync off is tolerated in RPG games. FPP (racing is also FPP) games require vsync to run smoothly. There is no compromise with PC'c, something is working or not, someting is smooth or not. Compromise you have to with ur woman, but a PC must do what u wish and no exeption. Do you control ur pc or does it control you ?

ROTF. I bow down to your huge computer knowledge :)

If you have so much computer knowledge then why do you not understand that your computer is not a custom games machine but in fact a GENERAL PURPOSE computing device. A device that has huge compromises forced on it its design and implementation by history and the need for backwards compatibility with business and other software that in some cases has legacy back to the days of DOS. It is NOT an XBOX or PS?

Feel free to stay on your high horse and believe what you want. Having written software on computers for the better part of 30 years now I have learnt that ALL software is a compromise.
Even LFS is a compromise. The developers had to decide what they COULD simulate over the widest user base.

They could have decided to only target the highest spec machines and made a far far better simulation that runs at far far higher rates in the physics engine BUT then they would have a far more limited market. Another compromise forced by the need for customer numbers that could run the software, customers being needed to allow them to live the life path they decided on.

I have learnt that life IS a compromise. You DONT always get what YOU WANT. Sometimes you HAVE to accept second best. The QUICKER you learn this the QUICKER you will have a happier life.

Sometimes the following needs to be remembered, it will make life far far far more enjoyable for you............

The grass might be greener BUT it is just has hard to mow.

:)

vixer
25th January 2008, 01:36
Most of what you did post is wrong but i think NVM.
Step backwards ? Fixing the frame skipping on a non 100hz display is a step backwards 4 u ?
So basicly ur telling me that i should turn off vsync and play without it couse its the way to go right ?
Thank you very much.

rcpilot
25th January 2008, 01:39
Most of what you did post is wrong but i think NVM.
Step backwards ? Fixing the frame skipping on a non 100hz display is a step backwards 4 u ?
So... you've got this nice house, brilliant house actually, but you decide that it's a little too close to the street, but moving it further back in the property means living in a trailer. Which would you choose? Programming is all about compromise, and you're asking the developers to choose the ridiculous half of this compromise.

vixer
25th January 2008, 01:43
Ok you guys go with ur compromises and have fun :-).

rcpilot
25th January 2008, 01:48
Ok you guys go with ur compromises and have fun :-).
Every time I play a game that's built the old way, I want to do bad things to the developers. Trust me, there isn't much of a compromise here.

Probably ~95% of pc's out there (honestly just pulling that out of my ass, but you get the point) don't have the speed to run every game at max details at a good framerate. Hell, most of them don't have the speed to run at any detail level with a decent framerate. This is a HUGE fix for them when it comes to gameplay experience. And you're complaining that there's a tiny stutter. That's why I look at you with the biggest "WTF" look in my life.

You ever wonder why a lot of newer games feel nice and smooth at 15-25 fps? It's because of this useless compromise.

vixer
25th January 2008, 01:58
Rcpilot just come to me and play M3 then you will talk exactly like me :-).
I got the picture now. LFS is made for lowend pc's users ?
I did spend a lot of cash (for me cash means a lot more then for you US ppl) and i have to play with tearing ? What bout LFS2 ? :-). A LFS version for ppl with beter pc's ?

rcpilot
25th January 2008, 02:03
Rcpilto just come to me and play M3 then you will talk exactly like me :-).
I got the picture now. LFS is made for lowend pc's users ?
I did spend a lot of cash (for me cash means a lot more then for you US ppl) and i have to play with tearing ? What bout LFS2 ? :-). A LFS version for ppl with beter pc'c ?
I played m3 challenge, for about 15 minutes, then said how on earth is this realistic and haven't touched it since (oops, apparently I don't agree :weeping:). All games should be made to run over as broad a spectrum of pc's as is reasonably possible. And basing your physics refresh rate off of your graphics refresh rate is a horrible idea for racing sims regardless. (More realistic physics based on how fast your pc can go, wtf?) Physics are the basis of any simulation, and if done online should be identical across all computers. Seems like common sense to me.

vixer
25th January 2008, 02:05
Rcpilot do you own a car ?
Did u play M3 with vsync on and did u get the same amount of fps then hz ?

rcpilot
25th January 2008, 02:08
Rcpilot do you own a car ?
Yessum, even gone auto-x'ing as much as I could for about a year, but my car quickly became too much of a POS to pass tech inspection ('84 celica supra). And I'd like to thank LFS for teaching me rwd control before I'd ever sat in a rwd car, saved my ass many times in the winter.

And, I guess you can have your ISI based sims for smooth purty graphics, and I can happily race my ass off in LFS enjoying the most complete online racing package I can get.

vixer
25th January 2008, 02:20
Ok ppl the final what i got from you is that ur tellimg me that white is black and that vsync is not needed, sure maybe for you. I know what this is all about, but remember that time is pasing and there will be a day when you ppl will have fast pc's and till that time you wont agree with me. This is not the first time ppl are telling me stuff that is wonrg and afetr some time they are asking me what to do. I wont to thank you all for your time and im sorry that i wasted a pice of ur lives but remeber that there will come a day when you will ask ur self "how teh hell could i play like that". Thx and bye.

rcpilot
25th January 2008, 02:27
Yeah, that day will eventually come when every pc has the power to render photorealistic graphics with near perfect physics, but...

We're talking about today. (And the next year, the year after that, the year after that, get my jist?)

And I'm quite happy to call this thread quits, this didn't go anywhere and the last thread didn't go anywhere.

vixer
25th January 2008, 02:34
AHA !! So today i have to play without vsync but in future i will turn it on ?
WTF ?????

rcpilot
25th January 2008, 02:39
AHA !! So today i have to play without vsync but in future i will turn it on ?
WTF ?????
No, in the future differences between systems won't matter because they'll have enough power to render a life-like game and make you breakfast at the same time. Today we have different worries. (Like developers making their games run well on the other 95% of the systems out there.) Last post considering I don't understand how my other last post was combative in the least and I give up.

Juls
14th February 2008, 21:33
The problem (very little problem) with LFS is that it does not interpolate between physics steps.

If you want to understand http://www.gaffer.org/game-physics/fix-your-timestep/


For example, if your display runs at 60fps, and vsync is on, every frame LFS will move physics time 0.01s or 0.02s further.
As a result, the objects speed on screen is approximated by steps, one step too fast, one step too slow, to obtain the right expected speed. This is not smooth.

The problem is even more apparent on faster display/computer...at 60fps objects speed is full or half depending on frames. At 30 fps, objects speed is full or 75% depending on frames.

Most games interpolate objects position between physics steps. ISI engine definitely interpolates, and looks smoother.

Vsync is a matter of taste.
For example, on a 60 hz display with vsync on, if the camera turns slowly and you watch the sky, you will see it moves by steps.

With vsync off, you will have some tearing but scrolling will be smoother. On my LCD, 60hz/70hz, vsync off looks better. Because tearing is not too visible as the screen is reacting slowly, and camera movements look a lot smoother. On a 100hz screen with very fast reaction time, vsync on would be better.
Depends what you hate: tearing or view jumping step by step.
Depends what display you have.

Woz
17th February 2008, 10:11
The problem (very little problem) with LFS is that it does not interpolate between physics steps.

If you want to understand http://www.gaffer.org/game-physics/fix-your-timestep/


For example, if your display runs at 60fps, and vsync is on, every frame LFS will move physics time 0.01s or 0.02s further.
As a result, the objects speed on screen is approximated by steps, one step too fast, one step too slow, to obtain the right expected speed. This is not smooth.

The problem is even more apparent on faster display/computer...at 60fps objects speed is full or half depending on frames. At 30 fps, objects speed is full or 75% depending on frames.

Most games interpolate objects position between physics steps. ISI engine definitely interpolates, and looks smoother.

Vsync is a matter of taste.
For example, on a 60 hz display with vsync on, if the camera turns slowly and you watch the sky, you will see it moves by steps.

With vsync off, you will have some tearing but scrolling will be smoother. On my LCD, 60hz/70hz, vsync off looks better. Because tearing is not too visible as the screen is reacting slowly, and camera movements look a lot smoother. On a 100hz screen with very fast reaction time, vsync on would be better.
Depends what you hate: tearing or view jumping step by step.
Depends what display you have.


How can you interpolate between physics steps? You need the start and end step and you won't have the end step because it will not have happened yet.

You have the LAST 2 steps but both are in the past. If you use these to guess a future step you will STILL get the stutter errors, probably worse.

It has ALREADY been stated that ISI sims are not locked physics rate and it has already been stated that this is a BAD thing. While the visuals might be smoother is means that everyone has different physics.

Unlocked physics = BAD.

GobLox
17th February 2008, 18:00
You have the LAST 2 steps but both are in the past. If you use these to guess a future step

= Extrapolate

Woz
17th February 2008, 18:28
= Extrapolate

If you want to play with semantics then you should know that extrapolate is not interpolate, it is GUESS based on history.

Interpolation is finding a speccific point BETWEEN 2 KNOWN points.

And as I stated if you TRY to GUESS where you will be from the PREVIOUS 2 steps it will be wrong in corners when things are not as predicable so it will still judder.

If you do not believe this then look at online. Here extrapolation is used and you see cars JUMP from one location to another because the GUESS based on history was wrong.

How will that help judder?

wien
17th February 2008, 18:41
Interpolation is finding a speccific point BETWEEN 2 KNOWN points.Yes, and like Kegetys already explained in this very thread, all you have to do is delay physics by one frame (actually, more like half a frame most of the time) and interpolate between the last physics frame and the next to last physics frame, both of which are KNOWN points in time. Hey presto; stutter free animation at arbitrary physics/graphics frequencies.

Shotglass
17th February 2008, 19:15
and lag of up to 10ms

wien
17th February 2008, 20:31
and lag of up to 10msOf course. Anyway, I got bored so I threw together a quick program with a movable square decoupled from the rendering frequency in the same way LFS physics are decoupled. Hopefully that will make it clear what the fuss is about for those who don't really see the problem.

I have also implemented frame interpolation that you can toggle on and off to see the difference it could make in LFS, both on animation smoothness and controller lag. It makes quite a difference to smoothness here, and the lag isn't really noticeable when running the animation at 100Hz like in LFS.

"I" toggles interpolation, the numpad "+" and "-" turns the animation frequency up and down, and the arrow keys move the square around. Requires OpenGL. I couldn't be arsed to make a GUI, so relevant information is output to the window's title-bar.

Shotglass
17th February 2008, 20:43
iteresting
at about 150-200hz the non interpolated version becomes as smooth as the interpolated one on my 85hz screen
so maybe just upping the phyiscs rate by only a moderate bit might help while at the same time reducing lag instead of increasing it

wien
17th February 2008, 20:49
Yup, it might. Going that high would have a big impact on FPS though. It would almost double the physics workload unless the inner "tire loop" was turned down accordingly when upping the frequency.

EDIT: The trick though is finding a frequency that is a multiple of your screen refresh rate. On my 60Hz screen 60Hz, 120Hz, 180Hz etc. is totally smooth with the stutter getting worse being inbetween these. Once you go high enough the stutter becomes less noticeable of course, but I personally need to go above 300Hz before I can't tell the difference between the interpolated and non-interpolated versions.

Shotglass
17th February 2008, 21:07
depends on too many variables to be sure how much impact it would have on performance but im not convinced the physics are really the issue with lfs' cpu limitation
afaik ais always run in full physics and as long as there are none on screen my framerates are still well above 60 with 20 ais so doubling the outer physics rate cant have that much impact on the framerate

wien
17th February 2008, 21:14
afaik ais always run in full physics and as long as there are none on screen my framerates are still well above 60 with 20 ais so doubling the outer physics rate cant have that much impact on the framerateYeah, the graphics are accountable for a fair bit of the CPU load I think. I have a sneaking suspicion an API upgrade could make a huge difference to CPU load if it's accompanied with proper use of vertex buffers and batching, even simple shaders. Hard to tell without seeing the code though. It may already be doing all that properly. :shrug:

Doubling the physics frequency would still take its toll though. Not to mention the work Scawen would have to do to stabilise the simulation again. :)

Woz
17th February 2008, 22:56
I love the way non of you have THOUGHT about this...

The trouble with what you all propose is that it effects the physics. Saying "just delay the physics step slightly so you can interpolate means that we are back to a system where the physics ARE different for everyone. It becomes refresh related again.

Is it so hard to see adding delays in steps means you get build up and all of a sudden nobody is really at 100Hz any more. It effects EVERYTHING from online to replays etc.

You then couple FPS and physics. BAD BAD BAD.

The ONLY answer is to up the refresh rate of the physics. I said earlier that 300Hz is a good value for bet hit with the various monitors because it allows vsync with the highest number of refresh rates and becomes high enough to only have small "judder" when not. Trouble is it will demand far more from PCs and drop out half the people that play LFS at the moment.

The physics HAVE to remain locked. ANYTHING else will kill the "feel" of LFS which has always felt solid BECAUSE the physics are locked.

Kegetys
17th February 2008, 23:10
The trouble with what you all propose is that it effects the physics.

No, you run the physics at a constant rate just like you do currently, but you keep the rendered frame (up to) one physics step behind. By doing this you can interpolate between the data from the latest and one-behind physics frame to render a frame that is anywhere in between those physics steps.

I love the way non of you have THOUGHT about this...

I have made my own (ODE-based) apps that work exactly like this so I have thought about it a bit ;)

wien
17th February 2008, 23:13
I love the way non of you have THOUGHT about this...Yeah. I just coded a program that does the exact thing we're discussing here. I didn't think it through at all.

Look here. The physics steps are all 0.01 seconds long (at 100Hz) in the simulated world. Constant physics rate. Same for everyone. Then when you render, you calculate the time since the last rendered frame (F), and figure out how many physics steps (N) you have to do to cover that time. This will advance the physics world 0.01 * N seconds (P). The difference between P and F (D) will then be saved to the next frame and added to the next frame's P to make sure the physics stay synced with real time. That's how LFS works now.

What you can do though (and what my program does) is take the left over time D and use that to figure out how much of a physics step was left (D / 0.01). Then you use this factor to interpolate between the two last physics frames, and render the resulting positions. The result: Constant rate physics, smooth animation.

Woz
17th February 2008, 23:23
ok, Sorry. Had read as though you were on about adding delays to the locked physics loop :)

So we would be looking at upto 10ms delay between world and display depending on where the frame fell. Given the other delays that are introduced in the render from online play that is managable.

This delay would also lower over time as hardware specs increase and the physics engine rate can come up so now I am on the same sheet.

Yep makes sense.

ErrorS
18th February 2008, 02:36
why didn't anyone recommend this?
http://en.wikipedia.org/wiki/Triple_buffering

unless I missed it.. or did you guys get lost trying to 'own' this guy with your vast knowledge of technology, forgetting to try and help this guy. Noone wants those two choices, "tearing or stuttering, pick one", that's all he was trying to say.. There's nothing wrong with this.

and vixy, a lot of people have been using computers for a lot longer than you.. reading a couple of articles at HardOCP doesn't make as knowledgable as those people.. your little quiz was stupid at best, as any of those people could have just typed the question into google to answer, if they cared enough to bother..
Simply grabbing a sentence from some tech dictionary about a piece of hardware and understanding it are two totally different things, that's how these people are different than you.

I think you trying to prove your knowledge pissed people off, YOU were the one here asking for help, most of us would have been able to figure it out by ourselves.. and if we couldn't, we would be so embarrased we wouldn't show our asses on a public forum.

Don't get angry when the answer to your question isn't what you wanted

wien
18th February 2008, 02:47
why didn't anyone recommend this?
http://en.wikipedia.org/wiki/Triple_bufferingWhile it helps by removing tearing (which admittedly was part of the discussion here) it does not solve the fundamental problem of stuttering the OP mentioned. To remove that stutter, you need some form of interpolation or syncing the physics rate to a multiple of the refresh rate as outlined above.

Woz
18th February 2008, 06:08
why didn't anyone recommend this?
http://en.wikipedia.org/wiki/Triple_buffering

unless I missed it.. or did you guys get lost trying to 'own' this guy with your vast knowledge of technology, forgetting to try and help this guy. Noone wants those two choices, "tearing or stuttering, pick one", that's all he was trying to say.. There's nothing wrong with this.

and vixy, a lot of people have been using computers for a lot longer than you.. reading a couple of articles at HardOCP doesn't make as knowledgable as those people.. your little quiz was stupid at best, as any of those people could have just typed the question into google to answer, if they cared enough to bother..
Simply grabbing a sentence from some tech dictionary about a piece of hardware and understanding it are two totally different things, that's how these people are different than you.

I think you trying to prove your knowledge pissed people off, YOU were the one here asking for help, most of us would have been able to figure it out by ourselves.. and if we couldn't, we would be so embarrased we wouldn't show our asses on a public forum.

Don't get angry when the answer to your question isn't what you wanted


The judder is caused by a missmatch between physics core speed and fps. So the tripple buffer does not help as it is time related. You can see this, just force tripple bufffer in your GFX drivers if you have not done so already :)

vixer
18th February 2008, 11:16
Tripple Buffering did not help :-).