By: Guillaume Gris
You may have been told that a good CPU with multiple cores makes little difference to video games – and that what really matters is the GPU. You might have heard that you cannot expect to run a next-gen, AAA game on a 4K monitor, with all the settings maxed out, without a decent GPU.
However, we have learned that the CPU is vital to the gameplay mechanics, the server interactions, the texture loading, and the procedural generation. And we found that choosing an Intel® processor makes a huge difference.
Dual Universe is a game set in a procedural open world. That world is generated in real time on the player’s CPU. To do this, we split the world into independent chunks. That makes parallelizing the generation straightforward. We spawn procedural generation threads according to the number of cores available on the user’s CPU.
We have threads dedicated to scene graph updates, asynchronous input and output, physics updates, and networking. We typically run three times as many threads as are available on the CPU, and rely on the system scheduler and affinity features to determine the priorities. We change the priorities of our threads depending on the purpose of the thread, and adjust the affinity to isolate the real-time thread from the other threads.
Our procedural generation is optimized for multithreading by dividing the computation cost between the available cores. This ensures that the real-time rendering thread is not slowed by the procedural generation. So the more threads you have, the faster and the farther the world will load.
The procedural generation is highly optimized for SIMD (single instruction, multiple data). We wrote it for an AVX* instruction set. Recent CPUs have improved SIMD throughput. For example, the instruction vandps has a throughput of 0.33 cycles per instruction (CPI), compared to 1 CPI on older processors. Some pure throughput limited code, such as procedural noise computation, runs almost twice as fast. Upgrading from an old 4-core CPU to a contemporary 8-core CPU might yield a four-fold increase in procedural generation speed.
In Dual Universe, you don’t have to wait for the world to load, but the experience benefits visually from everything being in place. On a typical game session, with a normal processor, you can expect 30 seconds of background loading when you arrive at a new location. With the Intel® Core™ i9-7980XE processor, loading appears near-instantaneous. The extra cores and improved multithreading create significantly faster load times, resulting in a smoother game experience that does not compromise performance.
Guillaume Gris is the lead graphics programmer at game developer Novaquark*. He joined as a 3D developer, and now supervises the 3D engine development team responsible for Novaquark’s flagship title Dual Universe. Gris is also responsible for the voxel-based procedural generation engine.