Optimisation Blog
During Total War: Warhammer’s development, our programmers have dedicated more time to engine optimization than any other Total War game. The ultimate aim of this work is to utilise your PC’s resources more effectively, and balance those countless calculations the game performs at any given moment more evenly across CPU cores, while figuring out which tasks we can hand off to the GPU to execute. The net result is improved framerates across the spectrum of PC configurations.
We’re pleased to confirm that Total War: WARHAMMER will also be DX12 compatible, and our graphics team has been working in close concert with AMD’s engineers on the implementation. This will be patched in a little after the game launches, but we’re really happy with the DX12 performance we’re seeing so far, so watch this space!
In non-DX12 news, our graphics team has spent considerable time on engine optimisations and there’s lots of good news in this regard, so let’s talk about specific engine optimisations which benefit everyone.
Total War has traditionally been quite CPU-bound, with the game-draw and graphics render processes both running on the same CPU thread. Over time, as the engine has evolved and become more demanding, this has become an increasingly important bottleneck for us. During the course of TWWH’s development, we’ve spent time separating these so they now run independently on their own threads. We’ve also optimized our task-system to have better multi-threading performance across the board.
In GPU terms, we’ve shifted our particle simulation pipeline from the pixel shader to the compute shader, which is a more efficient use of the GPU’s time. In fact we’ve done this with several parts of the rendering pipeline, further utilizing the GPU and letting the CPU focus on everything else it has to do.
Long story short: all of this means we’re using the CPU and the GPU more efficiently. TW: Warhammer takes better advantage of multicore CPUs, balancing the load across the cores so that no single core is maxed out and limiting framerates while others sit idle.
We’ve also switched up the Total War engine from 32 to 64-bit. While this brings no tangible performance benefits, we no longer have the 32-bit restriction of a maximum of 2GB of memory devoted to processes. The upshot is we can basically cram a greater variety of models, animations and textures into battles. One neat side benefit though is that it’s brought a reduction in end-turn times. Coupled with further optimisation we’ve done on the AI’s decision-making, this means you’ll enjoy quite noticeably reduced end-turn rounds while all the AI factions take their turns.
In the anti-aliasing department, we have morphological anti-aliasing (MLAA) and multi-sample anti-aliasing (MSAA x2, x4 and x8) as our AA options. While MLAA is a post-process effect, MSAA renders the same pixels in the scene multiple times, making it the most computationally expensive form of AA, and it therefore hits the framerate hardest. As you probably know, your typical Total War scene draws a hell of a lot of edges to smooth!
We’ve put time aside to optimize our MSAA implementation so that it runs computations in a smarter, more selective way. It doesn’t blanket multi-sample every part of every pixel now – it looks for pixel-edges and only multi-samples those. The upshot is nice smooth edges at a reduced GPU cost than before, and therefore a lower impact on your framerate. It’ll still have an impact of course; just less of an impact than in previous Total War titles.
It all adds up to a smoother-running Total War game, and we’re pretty confident you’ll feel that when you get your hands on it.