|
-
Jul 7th, 2001, 12:02 AM
#1
Multithreading in games?
Is this commonly done? How much performance loss is there if I don't use more than one thread?
Thanks,
Dennis
-
Jul 7th, 2001, 05:10 AM
#2
Fanatic Member
First of all; are you going to try threads in VB????
But now back to the question. You should only use threading in games when a task has to be done independantly from the main loop, or you would have to synchronize the two, which basically defeats the purpose of a thread. You might see a little increase in speed, but mostly you won't notice it...
I can't think of much use for threading in games.... well, maybe the loading screen, so you can load the graphics and sounds while an animation plays or something... but I think most games rely on the 'moving, drawing, moving, drawing' loop...
I think implementing a good threading system just takes too much time, especially for the one-man (or woman) programmers...
But offcourse I can be totally wrong
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
Jul 7th, 2001, 10:00 AM
#3
transcendental analytic
you might be. Network games might run a lot faster if there's another thread checking for incoming messages and replies according to them. Anyways, I'm about to develope a game which has it's GUI running on a separate thread, but this is a special case, my game will eat more performance on game variable calculations than on rendering the GUI so it's a case where you could benefit from asyncronisation. Also my GUI message queue system will probably be multithreaded until i come up with a reason it's unnessesary. If you make a game with a low framerate you could run the mouse on another thread which checks the mouse for movement frequently.
Multithreading isn't too hard to accomplish, i picked up some ADT classes that can be derived for threads, which included mutexes to protect accessed data.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 7th, 2001, 01:39 PM
#4
-
Jul 7th, 2001, 06:52 PM
#5
transcendental analytic
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 7th, 2001, 08:02 PM
#6
Good Ol' Platypus
I didn't even think you COULD use multithreading in VB..
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Jul 8th, 2001, 08:10 AM
#7
Frenzied Member
You can multithread in VB but its soooooooooooo un-secure and messes alot. i agree tho C++ is like "**** vb" now
-
Jul 8th, 2001, 08:54 AM
#8
I would agree that the most use multiple threads get in games are for multiplayer, and a UI. A few months ago, i was reading through the documentation for UnrealScript, and one of the things that they did was have Latent functions, which would continue to operate over multiple frames, but they didnt use threads. The reason, was because apparently windows doesnt handle thousands of simultaneous threads (im sure). A game design should work well enough to not have to use threads.
As to threads in VB, you CAN use them in version 5, but its impossible in 6.
Z.
-
Jul 8th, 2001, 01:36 PM
#9
What? Huh? *** would MS do that?!?!?!?
-
Jul 8th, 2001, 01:48 PM
#10
Fanatic Member
Maybe because they realised it was too unstable
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
Jul 8th, 2001, 01:51 PM
#11
-
Jul 8th, 2001, 02:01 PM
#12
transcendental analytic
There's too many VB fans out there (especially here) and MS would loose a lot of $$ on it, vb.net gives them $$, but I still hope they're going to improove VC++
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|