Tripwire Interactive Forums

Go Back   Tripwire Interactive Forums > Red Orchestra 2 / Rising Storm Forums > RO2/RS General > General Discussion

Reply
Click here to go to the first Dev post in this thread.  
Thread Tools Display Modes
  Click here to go to the next developer post in this thread.   #21  
Old 06-01-2012, 10:24 AM
[TW]redeye's Avatar
[TW]redeye [TW]redeye is offline
Programmer
 
Join Date: Jun 2010
Location: Roswell, GA
Posts: 329
Default

Quote:
Originally Posted by Proud_God View Post
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?
Think about that again. Hint: The key is to think with parallelism in mind.

Quote:
Originally Posted by Proud_God View Post
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.
Refer to my first post on this thread.
__________________
"A programmer is just a tool which converts caffeine into code"
Reply With Quote
  #22  
Old 06-01-2012, 10:30 AM
Mike_Nomad's Avatar
Mike_Nomad Mike_Nomad is offline
Senior Member
 
Join Date: Feb 2006
Location: Florida, USA
Posts: 4,497
Default

"A programmer is just a tool which converts caffeine into code"

Man, ain't that the truth.
__________________
Regards,

Reply With Quote
  #23  
Old 06-01-2012, 10:33 AM
Proud_God's Avatar
Proud_God Proud_God is online now
Senior Member
 
Join Date: Dec 2005
Location: Belgium
Posts: 2,643
Default

Quote:
Originally Posted by [TW]redeye View Post
Think about that again. Hint: The key is to think with parallelism in mind.
I understand that OFTL gives more pararellellism as the 'frame queue' (which has a max length of, as I understand it, only 1 frame) is being filled. However, once the frame queue is full, you are stalling for the N+2'th frame to finish.

How is this situation better than being stalled for the N+1'th frame with OFTL off (even more, it is worse as you are one frame behind)

Correct me if I'm wrong ofcourse

I also note that for myself, I gain little to no fps from OFTL, only some input lag.
__________________
aka Wakke
Reply With Quote
  Click here to go to the next developer post in this thread.   #24  
Old 06-01-2012, 10:44 AM
[TW]redeye's Avatar
[TW]redeye [TW]redeye is offline
Programmer
 
Join Date: Jun 2010
Location: Roswell, GA
Posts: 329
Default

Ok, for the sake of argument let's assume that your game thread consistently takes 5ms to run and the render thread takes 10ms to run.

If you run with OFTL off, once the render thread has finished rendering the frame (10ms), it has to wait an additional 5ms for the game thread to finish computing the next frame before it can do any work. Since the render thread is not allowed to lag behind (also read as since the game thread is not allowed to work ahead) there is no queued frame. Hence, the effective time to render a frame from the render thread's perspective becomes 15ms.

On the other hand, if you have OFTL enabled, by the time the render thread has finished rendering one frame, it will already have a queued up frame to work on immediately. So the effective render time is now 10ms as opposed to 15ms.

Of course, if the render thread is more than 2 times slower than the game thread, then it will not always have a queued up frame, and as a result OFTL will yield diminishing returns.
__________________
"A programmer is just a tool which converts caffeine into code"
Reply With Quote
  #25  
Old 06-01-2012, 10:54 AM
Proud_God's Avatar
Proud_God Proud_God is online now
Senior Member
 
Join Date: Dec 2005
Location: Belgium
Posts: 2,643
Default

Quote:
Originally Posted by [TW]redeye View Post
If you run with OFTL off, once the render thread has finished rendering the frame (10ms), it has to wait an additional 5ms for the game thread to finish computing the next frame before it can do any work.
The confusion is still not cleared up. In your original post you said, regarding the OFTL off scenario:

"While the Nth frame is being rendered, the game thread can compute your (N+1)th frame in parallel."

This seems in conflict with the quoted sentence above?
__________________
aka Wakke
Reply With Quote
  This is the last developer post in this thread.   #26  
Old 06-01-2012, 11:22 AM
[TW]redeye's Avatar
[TW]redeye [TW]redeye is offline
Programmer
 
Join Date: Jun 2010
Location: Roswell, GA
Posts: 329
Default

Quote:
Originally Posted by [TW]redeye View Post
If you run with OFTL off, once the render thread has finished rendering the frame (10ms), it has to wait an additional 5ms for the game thread to finish computing the next frame before it can do any work.
This is for the render thread.

Quote:
Originally Posted by Proud_God View Post
"While the Nth frame is being rendered, the game thread can compute your (N+1)th frame in parallel."
This is for the game thread.

The game thread is not dependent on the render thread, and hence can start computing the next frame before the render thread has finished. But the render thread is dependent on the game thread, and cannot begin a frame before the game thread has finished.

Also, I was being very simplistic in my 5ms, 10ms example. I hope you get the idea. You'll just have to put 2 and 2 together. Unfortunately, this is about as much detail I can go into in the forums.
__________________
"A programmer is just a tool which converts caffeine into code"

Last edited by [TW]redeye; 06-01-2012 at 11:25 AM. Reason: Clarification
Reply With Quote
  #27  
Old 06-01-2012, 12:13 PM
Proud_God's Avatar
Proud_God Proud_God is online now
Senior Member
 
Join Date: Dec 2005
Location: Belgium
Posts: 2,643
Default

Sometimes pictures say more than words, so here is my understanding of the scenario where game thread = 5ms and render thread = 10ms.
Beyond the initial throughput increase for the game thread, I see no advantage of OFTL. Where is this interpretation wrong?

Note: I realize this is a simplified scenario, but it gets my point across.
In cases where the render thread is sometimes faster and sometimes slower than the game thread, I can imagine there being more benefit.
Attached Images
File Type: jpg OFTL.jpg (39.2 KB, 31 views)
__________________
aka Wakke

Last edited by Proud_God; 06-01-2012 at 12:20 PM.
Reply With Quote
  #28  
Old 06-01-2012, 12:18 PM
mattlach's Avatar
mattlach mattlach is offline
Senior Member
 
Join Date: Oct 2011
Location: Massachusetts
Posts: 394
Default

Quote:
Originally Posted by Proud_God View Post
Sometimes pictures say more than words, so here is my understanding of the scenario where game thread = 5ms and render thread = 10ms.
Beyond the initial throughput increase for the game thread, I see no advantage of OFTL. Where is this interpretation wrong?

Note: I realize this is a simplified scenario, but it gets my point across.
In cases where the render thread is sometimes faster and sometimes slower than the game thread, I can imagine there being more benifit.
I think that is fairly accurate, except for the part where you are assuming that the render pipeline flows at an even rate.

Each frame is different, and as such takes more or less time to finish rendering. Having that n+1 th game thread I think makes more of a difference when things slow down and speed back up again.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:05 AM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2005 - 2013, Tripwire Interactive, LLC