![]() |
![]() |
|
#1
|
|||
|
|||
|
With it on, would your client's view stay one frame behind the information you received from the server (such as extrapolated player positions based on momentum, etc.)? 'Cause I swear the feedback from my hits (like shooting at a wall) appear sooner with it OFF. One frame may look like little but if you average 60FPS, one frame = 16.6ms, which is quite a substantial delay to stay behind when you're shooting someone running in the distance using legacy UT netcode.
Perhaps I'm mistaken about what OFTL really does, and it's just a visual buffer thing with no negative consequences to netplay? I'd appreciate a technical post, as I searched this forum and all I found were guesses which are as a good as the one I have right now. ![]() I guess what I really mean to ask is, would playing with it on give you a less accurate idea of what is actually happening (even if by one frame?). If so, I will have to think twice before leaving it ON, despite it netting me a good 10 extra average FPS. --- Last edited by Echo Black; 11-09-2011 at 02:17 PM. |
|
|
||||
|
||||
|
Ok, here goes. Since this comes up quite often, I'll try to be as detailed as possible.
First some background. The game runs essentially on 2 main threads - a game thread and a rendering thread. The game thread calculates all gameplay aspects such as shooting, hit registration, animation, IK, etc. The rendering thread calculates shadows, updates particle systems (such as smoke), and sends all the draw calls to the GPU for rendering. Although for most parts the rendering thread can run on its own, it is not entirely independent of the game thread. The game thread "tells" the render thread where your camera is so that the rendering thread can draw the environment from your current location. Another example would be when you shoot, the game thread evaluates your mouse click, computes the ballistics, and if it hits a wall, it "tells" the render thread the location where it hit so that the render thread can draw a bullet impact decal at that location. Because of this, the game thread needs to "talk" with the render thread. However, it cannot do so anytime it wants (effective threading simply doesn't work that way). So, it syncs from time to time, but otherwise goes about its own business. This sync time is usually at the end of a frame. Now, let's assume that your game thread is running faster than your render thread. The game thread computes the Nth frame, sync happens, and then your render thread renders your Nth frame. While the Nth frame is being rendered, the game thread can compute your (N+1)th frame in parallel. By the time the (N+1)th frame is finished by the game thread, the Nth thread MAY or MAY NOT be finished by the rendering thread. This is where "One Frame Thread Lag" comes in. If OFTL is off, the game thread will STALL at this point, waiting for the render thread, resulting in a performance drop. But, if you play with OFTL turned on, it will allow the game thread to queue up the (N+1)th frame and start working on the (N+2)th frame immediately, and the render thread can pick up and render the (N+1)th frame once it has finished rendering the Nth frame. This gives you MORE PARALLELISM, and hence better performance. Keep in mind that this will only happen for one frame - your render thread will NOT keep falling behind more and more as your game progresses. Now to answer your questions. Quote:
Quote:
Quote:
TL;DR Leave this setting on for better frame rates. It won't adversely affect your hit registration or give you a less accurate idea of what is going on in the game. |
|
#3
|
|||
|
|||
|
always wondered what this setting was for!
thanks devs for the input! now i will turn it on |
|
#4
|
|||
|
|||
|
Many thanks for the thorough (and quick!) post. Far better than wading through incomplete theories and not knowing what to believe.
![]() --- |
|
#5
|
|||
|
|||
|
+1
Fantastic instructive and detailed post. |
|
#6
|
||||
|
||||
|
Very informative and well explained. Have a chocolate cookie, redeye.
__________________
defekt |
|
#7
|
|||
|
|||
|
This info should be in the FAQ.
|
|
#8
|
|||
|
|||
|
Lol, I was just discussing this with someone yesterday and decided to turn it off to see if it would help with with hit detection and did notice the performance hit.
Thanks for the dev input! Guess I'll turn it back on. |
|
#9
|
|||
|
|||
|
Amazing reply from the TWI team.
|
|
#10
|
||||
|
||||
|
I think the name of the option should be changed; you read the word 'lag' and your first reaction is, "Nothankyouverymuch!" How about Sync Parallel Threads?
__________________
i5 2500K 3.3Ghz, OC to 4.5Ghz/GTX 570 1280MB OC/GTX 460 SE 1000MB for PhysX/DDR3-1600Mhz RAM, 8GB/TX-850 850W/ASUS P8P67 Deluxe mobo/Win 7 HP 64-bit, 1920x1080 |
|
#11
|
||||
|
||||
|
That's a correct response to it, though. It's a potential delay versus a potential framerate loss. You get to decide which you dislike more.
|
|
|
||||
|
||||
|
Glad I could help.
That's a good point, and I have thought about this myself as well. I'm not sure if we'll be re-naming the setting, but adding more information about this in the game FAQ and elsewhere is a good idea. |
|
#13
|
|||
|
|||
|
Many thanks. I wasn't sure at all what it done and couldn't find any concrete info.
|
|
#14
|
||||
|
||||
|
I find "one frame lag" to be a more honest name for it. I dislike it intensely as on my PC it actually causes more hitching and at the cost of a laggier mouse. Certainly if you're sitting on 60fps then that one frame of lag isn't so bad, but if your frame rate tends to sit lower than that (as mine does), the lag period starts to get unacceptably high, especially if you have other factors causing "input lag" like a monitor with a high processing time, a low polling mouse, or similar.
|
|
#15
|
||||
|
||||
|
The first two posts in this thread need to be rendered in sync and added to the FAQ, Stickied
.No need to rename, we have the explanation. Liked x 2.
__________________
|
|
#16
|
||||
|
||||
|
Are there any cases where allowing the game thread to render ahead would cause the render thread - once it is ready - to render something that now is outdated compared to if it had been rendered without the feature enabled?
Also, in this case, why not just let the game thread go nuts and render as fast as it can asynchronously, and just let the render thread poll it for the most current data whenever it is ready to start the next frame? You'd think this would lead to the most up to date data being rendered on the screen. Thanks for this explanation though, it helps a lot. I agree the name of the option sets a negative connotation to the feature. Something like "allow 1 frame render-ahead" sounds more positive
__________________
Join us on one of our four servers! |
|
|
||||
|
||||
|
Quote:
Whatever the game thread updates, the render thread has to render within a finite amount of time (same frame if OFTL is off, or next frame if OFTL is on). The render thread cannot skip a frame and go to the latest because that'll make the game choppy. It also cannot lag behind too many frames as that will game the game feel laggy. You can probably get away with being 2 or maybe 3 frames behind in certain games which aren't first person shooters. But being at least 1 thread behind is a good thing to ensure you use your cores effectively. Otherwise, you are basically running single-threaded! (since the game will only use one core at a time) Quote:
. You can still turn it off in the INI if you wanted to, but for a casual user it is too important a setting to simply expose it in the settings menu with no way to properly convey what it does.
|
|
#18
|
||||
|
||||
|
I don't get this. Are you saying that with OFTL off there is no parallelism between the game- and render-thread? Because from your 1st post I got the impression that there was.
__________________
aka Wakke |
|
|
||||
|
||||
|
There is, but it is negligible to the point that you are 'essentially' running single threaded.
__________________
"A programmer is just a tool which converts caffeine into code" |
|
#20
|
||||
|
||||
|
I have 2 questions/ concerns:
1) if your game thread is consistently faster than your render thread, won't you be in the same situation with OFTL on as off, with the added downside that you are constantly 1 frame behind? 2) I suppose the client side hit detection uses the game thread to determine the game state. But, with OFTL on, won't that mean that it is more difficult to hit people, since you might be looking at a screen that is no longer current with regards to the game thread. I seem to notice it is harder for me to hit enemies with OFTL on, which supports this.
__________________
aka Wakke |
![]() |
| Thread Tools | |
| Display Modes | |
|
|