Multiple Threads?

Discussion about the game and its default mods.
Post Reply
whi7ed3vil
Posts: 2
Joined: Sat Oct 06, 2018 4:36 pm

Multiple Threads?

Post by whi7ed3vil » Tue Dec 18, 2018 5:29 pm

Any thoughts given to opening the game up to multiple CPU threads? It seems at present to be a one-core-wonder. Would be nice to see the performance improvement on a multi-core system by at least taking each AI into its own thread. You guys considering that kind of architecture upgrade in the future? I could see this minimizing the (occasional) lag generated by large-scale AI decision making.

User avatar
Sleipnir
Posts: 777
Joined: Wed Apr 10, 2002 11:52 pm
Contact:

Re: Multiple Threads?

Post by Sleipnir » Tue Dec 18, 2018 8:45 pm

The game runs with a main thread for the game logic, a second thread for rendering*, and worker threads for various tasks that use the network or take a long time to complete. Running the AI in parallel with the game logic would be very difficult because it needs to read consistent state from the world.

An intermediate approach that would help a lot on games with many bots would be to split the bot updates across N threads that run in parallel, but serially with the world. This would still require a fair bit of work to manage the optimum number of threads - running 10 AI threads on a system with only 2 cores would be overall worse than running bots all on the main thread.

*the render thread is disabled on Windows because it reliably breaks the windows taskbar, and so far nobody has any idea how this could happen or how to fix it.

whi7ed3vil
Posts: 2
Joined: Sat Oct 06, 2018 4:36 pm

Re: Multiple Threads?

Post by whi7ed3vil » Wed Dec 19, 2018 5:46 pm

I see. Good to know. My comment stems from the idea that no matter how taxing the game seems to be on OSX, it never reports utilization above one core. Assumed that was because it had only one thread, but perhaps another reason?

Post Reply