Game slowdown and multi-threading ?

Jojo_Fr

Prince
Joined
Mar 17, 2013
Messages
361
Location
France
Hello.

- Civ IV's turns tend to become very slows in late game. I have an old computer, so I thougt it came from my ancient configuration.

- But God-Emperor explain here that Civ IV cannot handle multi-threading, which is the main reason that explain the game stay slow compared to the important increase of power of the multicore modern processors.

- According to God-Emperor, there is very few mod which handle a bit the multi-threading to increase the performance, then reducing the time we wait each turn.

- My question is : why is that not possible to mod Civ IV to give it a complet management of multi-threading ? It would be a huge qualitative improvement of our beloved game.
 
As vincentz said it is impossible to modify the game engine itself. With regard to the moddable parts... it is possible, but being theoretically possible and being doable are entirely different things, though.

I already mentioned this at the start of the forum thread that sparked this one, but multithreading the game logic of a single threaded game is far from trivial. It's not just triggering a switch; you need to remake each part of the game logic that allows it in a multithreaded way. This is a huge amount of work, and you also have to make sure that each client runs the randomized parts of the code exactly the same. Otherwise, you will get OOS errors.

Also, bear in mind that modders can only access the DLL code; the main game engine is out of limits for us and it is designed to work with a single threaded DLL. Therefore, the change would not only require to multithread the DLL code in an OOS safe way, but also to make sure that every calculation is finished in the same, old order so that everything works in the same way for the game engine.

Some articles in the Caveman 2 Cosmos development blog explain how complex the situation is and what would need to be done far better than my short summary:

http://c2cdev.blogspot.com.br/2013/06/multi-threading-support-infrastructure.html
http://c2cdev.blogspot.com.br/2013/06/pipelines-as-generic-framework-for.html

I have only talked about how big the task is, but there are also reasons about why it is complicatted for the modding community to address it. The first reason is kind of a cliché, but that does not make it less true: modders work in their free time, and that imposes a limit to the scope of the tasks they can do.

But there is a second reason which in my opinion is even more important. This would not just require to "mod Civilization IV", it would need to modify each mod. Each Civilization IV mod has its own codebase, which is usually quite different than all others. Except in very specific cases porting code between mods is tedious, long and error prone. This situation means that modders do not have a common point which would allow them to work together in multithreading, and that each mod would need to implement its own customized solution anyways.
 
Ok, I see. Thank you very much both of you.

- So, it seems the only possible hope, would perhaps be the work of a professional team which would make a new edited version of the game, made to manage the multi threading.

- I say that because today there are more and more ancients games which are reedited with updated engine, totally compatibles with new Windows 7/8 and modern hardware. As Baldur's Gate HD, game like that. Off course I doubt it could exist, because there is not really a financial benefit to work on a game which is already compatible with modern systems, except for multi threading. :(
 
Hello.

- Civ IV's turns tend to become very slows in late game. I have an old computer, so I thougt it came from my ancient configuration.

- But God-Emperor explain here that Civ IV cannot handle multi-threading, which is the main reason that explain the game stay slow compared to the important increase of power of the multicore modern processors.

- According to God-Emperor, there is very few mod which handle a bit the multi-threading to increase the performance, then reducing the time we wait each turn.

Thankfully what God-Emporer says is only partially true. CIV IV runs MUCH faster on a newer machine. Why? Advancements in PC and chip technology go much deeper than just having extra cores on the CPU.

For example on the cpus themselves, new and improved chip instructions and more L2 and L3 cache. On motherboards you have faster memory and higher memory bandwidth. This is not to mention newer video cards that can easily handle big maps on CIV IV.

Point being 2.4ghz from 10 years ago cannot compete with one core of 2.4ghz today. And you will notice a big difference on a new gaming machine.
 
Top Bottom