Why aren’t more video games optimised for multi-core CPUs?

1.36K viewsOther

It is common for modern video games to be badly optimised due to, partly, inefficient usage of multiple cores on a CPUs.

I’d assume that developers know this, but don’t have the time to rectify this.

So, therefore, what are the difficulties in utilising various cores of a CPU effectively? Why does it require so much focus, money, or perhaps time to implement?

In: Other

18 Answers

Anonymous 0 Comments

Let’s say a game is getting ready to render a single frame. Before it can render that frame, it needs to complete 1000 tasks/computations.

Some are straight forward. You send the that task off to another cpu (thread), itvcomes back with an answer. It’s done for that frame.

Some tasks stack, you cant run task c until task b completes, but that can’t be run until tasks a completes. So that limits the advantages of multi processing.

But we are trying to go as fast as possible, so we’ll have more complicated situations where task a + b can be run at the same time, before we can run task c. Or some more complicated version of this to, again, go as fast as possible.

Some tasks also take longer to complete than others, so you want to process those tasks in the most efficient order.

Now we also have to consider memory, as some tasks (fairly unrelated) needs access to some data in memory. In multi CPU systems, there are several layers of memory. The closer to the cpu, the faster the memory, but the smaller it is, and the more you have to copy that data between CPUs.

There are memory pools like ram that can be accessed without copying data around but that’s the slowest memory. But remember we’re optimizing here, so now we have to figure out what orders these tasks need to run, considering the data we need to access, copy the data to the appropriate CPU / data pools, trying to process tasks that access the same data, and the stacking of tasks.

On top of all that, we are trying to optimize the calculations/algos of all 1000 tasks. Which in itself is a bit of an art, balancing pure speed, with code complexity. Which may need to be updated, rebalanced, reomptimized when a change is introduced elsewhere. You might put dozens of hours multithreading some tasks only to for it to be cut out due to a feature change. So that’s a lot of wasted time that could have gone to big fixed or more content.

So also you can imagine, balancing all these things between cores, to work as fast as possible, in an environment where features are often changing, is complicated.

You are viewing 1 out of 18 answers, click here to view all answers.