Seperate thread for game input?
#1
Posted 11 October 2005 - 04:01 PM
Currently my game runs in a single thread with the user input being collected once per game loop. This seems to work OK, provided that it is running at a reasonable frame rate.
Because the game controls can really make or break a game, I'm starting to wonder if I should move collecting player input to a seperate thread.
Is this more trouble than it's worth?
#2
Posted 11 October 2005 - 04:18 PM
Are you having troubles when the framerate drops?
-
Currently working on: the 3D engine for Tomb Raider.
#3
Posted 11 October 2005 - 06:07 PM
I'm not having a lot of troubles, but I do notice a bit of a difference in the "feel" of the controls at lower framerates. If I'm running it on my laptop fullscreen 640 x 480, the control feels a little more responsive then when it's running at 1024 x 768 (and therefore a lower framerate).
You do make a good point, since the input is not going to be processed until the game loop anyway. Am I really going to save that much time by not having to read all the devices, just process the buffered input? Hard to say. Perhaps I'll leave it as is. Cheers!
#4
Posted 11 October 2005 - 06:25 PM
#5
Posted 11 October 2005 - 07:06 PM
#6
Posted 11 October 2005 - 07:49 PM
I once read an article about a new graphics vendor (bitboys probably) presenting a technique to make multiple GPUs cooperate by giving each GPU it's own frame. That effectively means you are giving commands for the second frame while the first is still rendering, which simply adds one more frame to the delay. I'll ask you this: WHAT THE F*CK WERE THEY THINKING?! But enough of that
-
Currently working on: the 3D engine for Tomb Raider.
#7
Posted 11 October 2005 - 07:58 PM
#8
Posted 11 October 2005 - 08:10 PM
-
Currently working on: the 3D engine for Tomb Raider.
#9
Posted 11 October 2005 - 08:18 PM
.oisyn said:
What's the problem with that? If the rasterizing step appears to be the weak link in the rendering process, being able to start a new frame while the previous one is still being rasterized is a good thing. And the delay for commands processing is not superior.
#10
Posted 11 October 2005 - 08:22 PM
.oisyn said:
They do.
http://en.wikipedia.org/wiki/3dfx
#11
Posted 11 October 2005 - 08:48 PM
Quote
-
Currently working on: the 3D engine for Tomb Raider.
#12
Posted 11 October 2005 - 09:14 PM
Of course this might lead to slightly strange things happening at low frame rates where you leap from too far left to too far right without passing through the middle. A thought though.
#13
Posted 11 October 2005 - 10:03 PM
fringe said:
Of course this might lead to slightly strange things happening at low frame rates where you leap from too far left to too far right without passing through the middle. A thought though.
Depending on the UI that you have setup, threading doesn't always provide a faster solution either. Many times, you can just poll for the state you're testing on immediately. If you're using Windows messaging, you're using the window's thread anyway (unless you use a modified thread's message loop).
However, many networking and input thread solutions are possible and can work. This is especially helpful when waiting on a connection or some other blockable/long state.
Corey
#14
Posted 11 October 2005 - 10:48 PM
Max
#15
Posted 12 October 2005 - 01:44 PM
corey: Thanks for your input. Definitely sticking with the single thread.
m4x0r: My game doesn't use the mouse pointer, but it is a good suggestion nonetheless!
Cheers!
#16
Posted 12 October 2005 - 05:18 PM
http://en.wikipedia...._Link_Interface
#17
Posted 12 October 2005 - 05:20 PM
#18
Posted 13 October 2005 - 09:16 AM
Quote
Assigning different frames to different GPU's can be a serious crime, especially when using feedback effects where the contents of the previous frame is needed or when doing hardware occlusion culling and you have to wait for the results.
-
Currently working on: the 3D engine for Tomb Raider.
#19
Posted 13 October 2005 - 12:59 PM
On single GPU there are the same problems: texturing operation waiting for geometry ones to be finished, and so on. The programmer just has to be aware of that, and must take care of bottlenecks.
#20
Posted 13 October 2005 - 01:32 PM
By giving each GPU a part of the same frame, your fillrate doubles and there are no stalls. By giving each GPU a different frame, fillrate is lost while one GPU is waiting for the other. I'm not saying the latter situation is actually slower than having a single GPU, I'm saying that the effectiveness of multiple GPU's is much less when using such a technique.
-
Currently working on: the 3D engine for Tomb Raider.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












