to thread or not to thread

Advanced game related topics
yabune
User
User
Posts: 65
Joined: Mon Aug 22, 2005 2:31 pm

to thread or not to thread

Post by yabune »

Hi!

I'm doing a fighter game like the old Street Fighter.
I was planning in creating a thread for each fighter, but I read in purebasic manual that threads are not recommended for directX..

Is it better to create both players in the same loop?

If I have 10 fighter in the same screen, shouldn't work better if each one are in a thread?

thank you!!!
Nik
Addict
Addict
Posts: 1017
Joined: Fri May 13, 2005 11:45 pm
Location: Germany
Contact:

Post by Nik »

I don't think a player in a game is a good reason for a thread, it's not exactly the prupose of threads to do such simple tasks. Gametasks which probably need threading are things like physics engine, in game map loading, networing and so on.
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

Correct. Everything in gaming is typically done in a single process or thread. If you're worried about performance: Note that Quake 3 is not a multithreaded game and look at all it does. ;)

Nowadays some increidbly intensive games like oblivion are starting to use threads for certain tasks to capitalize on multi-core/proc computers but its rare and the effort involved is not worth the gain unless you really need it.

If you just like the style of threads you can see my TaskList code here on the forum for a similar programming style to threads.
yabune
User
User
Posts: 65
Joined: Mon Aug 22, 2005 2:31 pm

Post by yabune »

dracflamloc wrote:Correct. Everything in gaming is typically done in a single process or thread. If you're worried about performance: Note that Quake 3 is not a multithreaded game and look at all it does. ;)

Nowadays some increidbly intensive games like oblivion are starting to use threads for certain tasks to capitalize on multi-core/proc computers but its rare and the effort involved is not worth the gain unless you really need it.

If you just like the style of threads you can see my TaskList code here on the forum for a similar programming style to threads.
ok, I see it's better to put it on a single thread.
thank you for your support!!!
Post Reply