Major CPU Thread Optimizations in Total War: Warhammer - Detailed Look
Posted on April 23, 2016
We spoke exclusively with the Creative Assembly team about its game engine optimization for the upcoming Total War: Warhammer. Major moves to optimize and refactor the game engine include DirectX 12 integration, better CPU thread management (decoupling the logic and render threads), and GPU-assigned processing to lighten the CPU load.
The interview with Al Bickham, Studio Communications Manager at Creative Assembly, can be found in its entirety below. We hope to soon visit the topic of DirectX 12 support within the Total War: Warhammer engine.
CPU Thread Assignment – Game Logic & Game Render Threads
Total War: Warhammer's engine has been fully updated to 64-bit, which grants more addressable space in memory than 32-bit limitations would allow. Theoretically, this 64-bit conversion could be leveraged to store more content within memory for quicker access than hitting storage, though few games are utilizing greater than 4GB system memory.
Total War has historically been heavy on the CPU, particularly with the first two threads. With Warhammer, the team has refactored major parts of the engine to smooth-out CPU performance across all threads. Creative Assembly decoupled the render and game logic threads (now assigned independently to cores/threads), significantly reducing active load on a single thread within the CPU. Game logic effectively informs the render thread, handling all the real-time AI calculations and object tracking, while rendering gets hammered with draw calls and other draw events. The two together are intensely abusive, and decoupling their processes from a single core will allow for greater load-leveling.
Particle simulation has also been moved to the GPU – a better-suited processor for this particular task – which further improves CPU performance and grants reductions in bottlenecking. Every game bottlenecks somewhere; it is an inevitability by definition that, somewhere in the chain, some device will choke on the commands being pushed through. Total War has generally been a CPU-heavy game, and that will remain the case by nature of its massive unit tracking, AI, and calculations; with the new engine, though, the Creative Assembly team expects a tremendous speed-up for CPUs.
MSAA vs. MLAA in Total War: Warhammer
MLAA (Morpholobical Anti-Aliasing) is somewhat of a post-processing hack that yields a marginally improved look and feel without impacting framerate too negatively. MLAA was originally pushed by AMD with Half-Life 2 and is API and engine neutral, but doesn't do much for those demanding the best anti-aliasing techniques for high-end hardware.
Creative Assembly is using the tried-and-true MSAA (Multi-Sample Anti-Aliasing) approach for that, which samples pixels a number of times to determine appropriate color application to object edges. The Total War: Warhammer engine will institute MSAA in a more resource-friendly manner, targeting only edges which bear perceptible jaggies to the user. In this regard, it's aware of objects that are lit and positioned such that jagged edges may be exacerbated, and will target those objects and edges for selective anti-aliasing. If the edge won't be perceived by the user as jagged, it is ignored and resources are spared (rather than sampling additional pixels and burdening the pipeline).
Bickham provides an example of a soldier “standing side-on, where the edges are lit,” and explains that such a scenario is when CA's MSAA implementation would kick-in.
For more Total War: Warhammer tech coverage, check our initial Dx12 news post. Gameplay interview coverage is this way.
Editorial: Steve “Lelldorianx” Burke
Video Production: Keegan “HornetSting” Gallick