Hey, new here. I got this idea for Warzone. What if we/someone-else-who's-willing-until-I-improve-my-C-skills re-thread Warzone to run on multiple cores. For example:
CORE 0 - Critical Game code and Player.
CORE 1 - AI player 1
CORE 2 - AI player 2
CORE 3 - AI player 3
and etc. If I'm understanding the concept correctly, each core will be dedicated on a specific component of game, allowing main game/critical game code to have more processor time on CORE 0, while each AI player will have also have it's own dedicated CPU core, possibly sharing if less cores than CPU players. Example:
CORE 0 - Main/Critical code, Player
CORE 1 - AI Player 1 & 2
CORE 2 - AI Player 3 & 4
CORE 3 - AI Player 5 & 6
What do you think?
P.S. did I post in the right forum?
[Idea] Multi-threading for multi-core processors
-
MechWarrior001
- Greenhorn
- Posts: 7
- Joined: 15 May 2010, 08:09
- Location: Chico, CA
-
Per
- Warzone 2100 Team Member

- Posts: 3780
- Joined: 03 Aug 2006, 19:39
Re: [Idea] Multi-threading for multi-core processors
It is something I am thinking of doing one day, but it is not so simple, since you need to be very careful in the design to avoid race conditions in the code.
Note that the game can already utilize two cores, if you have that, since we have a separate thread doing path-finding calculations.
Note that the game can already utilize two cores, if you have that, since we have a separate thread doing path-finding calculations.
-
MechWarrior001
- Greenhorn
- Posts: 7
- Joined: 15 May 2010, 08:09
- Location: Chico, CA
Re: [Idea] Multi-threading for multi-core processors
What do you mean by race conditions? I'm still new to C so I'm not sure if that's a function or not.
-
Safety0ff
- Trained

- Posts: 397
- Joined: 18 Jul 2009, 23:23
Re: [Idea] Multi-threading for multi-core processors
Here.MechWarrior001 wrote:What do you mean by race conditions? I'm still new to C so I'm not sure if that's a function or not.
-
Tenoh
- Trained

- Posts: 359
- Joined: 18 Nov 2008, 15:06
Re: [Idea] Multi-threading for multi-core processors
And is there any other way we could use the cores? sadly i only got 2 T_T.
"No, you don't want to buy this Sh[beep]t from me. It shoots sideways, it was built by retard zombies in some f[beep]king outreach program." HL:G
-
MechWarrior001
- Greenhorn
- Posts: 7
- Joined: 15 May 2010, 08:09
- Location: Chico, CA
Re: [Idea] Multi-threading for multi-core processors
Well assigning AI to each core doesn't necessarily limit the total AI per match based on the amount of cores you have, we could simply just assign all AI players to CPU 1 and player+main thread to CPU 0, anything above CPU 1 will have a dedicated AI player.
For example:
Dual Core Config
Game - CPU 0
AI - CPU 1
MultiCore Config
Game - CPU 0
AI 1 - CPU 1
AI 2 - CPU 2
AI 3 - CPU 3
and etc.
For example:
Dual Core Config
Game - CPU 0
AI - CPU 1
MultiCore Config
Game - CPU 0
AI 1 - CPU 1
AI 2 - CPU 2
AI 3 - CPU 3
and etc.
-
MaNGusT
- Art contributor
- Posts: 1154
- Joined: 22 Sep 2006, 10:31
- Location: Russia
Re: [Idea] Multi-threading for multi-core processors
CORE 0 - Main/Critical code, Player
CORE 1 - path-finding calculations
CORE 2 - AI Players, scripts, events, triggers
CORE 3 - something else (mb net code)
I think it should work like - at launch the game detects how much cores system has, then applies/loads prepared "preset" for 2 or more cores.
CORE 1 - path-finding calculations
CORE 2 - AI Players, scripts, events, triggers
CORE 3 - something else (mb net code)
I think it should work like - at launch the game detects how much cores system has, then applies/loads prepared "preset" for 2 or more cores.
-
MechWarrior001
- Greenhorn
- Posts: 7
- Joined: 15 May 2010, 08:09
- Location: Chico, CA
Re: [Idea] Multi-threading for multi-core processors
It might be worth adding the ability to manually assign threads & calculations to certain cores.
What about CUDA and OpenCL? Could Warzone 2100 benefit from either of those?
What about CUDA and OpenCL? Could Warzone 2100 benefit from either of those?
-
Zarel
- Elite

- Posts: 5770
- Joined: 03 Jan 2008, 23:35
- Location: Minnesota, USA
Re: [Idea] Multi-threading for multi-core processors
CUDA is proprietary Nvidia technology. It's not designed for a game designed to run on a variety of platforms.MechWarrior001 wrote:It might be worth adding the ability to manually assign threads & calculations to certain cores.
What about CUDA and OpenCL? Could Warzone 2100 benefit from either of those?
-
Tenoh
- Trained

- Posts: 359
- Joined: 18 Nov 2008, 15:06
Re: [Idea] Multi-threading for multi-core processors
Hmm.. my second core is always used by win7 and always at 27 or 30% and first core is for program use.
"No, you don't want to buy this Sh[beep]t from me. It shoots sideways, it was built by retard zombies in some f[beep]king outreach program." HL:G