UPDATE: we have posted a follow-up article which clarifies our claims and answers a lot of questions.

One of our engineers lately has had some fun parallelizing the idTech4 game engine. This world-famous engine was used in first-person shooter games like Doom 3, Prey and Quake 4. During the development of its 500,000 lines of C/C++ source code, it was heavily optimized to run well on single-core machines. Now multicore machines are omnipresent, we decided to have a go at re-optimizing the rendering part of the engine for multicore PCs.

Using dependency analysis and loop-reordering, the Vector Fabrics Pareon tool identified the code segments where to optimize the existing C++ code. Based on Pareon's output he introduced parallelism and improved the performance of parts of the main loop in the rendering framework by 3.8x and 1.8x on a quad core machine.

The results: an impressive 15% frame rate increase during the playback of a pre-recorded demo scene in the Hell level. This frame rate increase is really significant, considering that this is one of the most highly optimized game engines available. This amount of frame rate increase usually is only achievable by buying a newer generation PC or a new graphics card: spending $300 instead of $80 - but it's for free on most modern PCs which have under-utilized x86 cores.

Note that we deliberately limited ourselves: our engineer did not look at game startup, world modelling, the physics engine, nor at the Monsters' AI. We expect to find speedups in all of these parts as well, but for the sake of time we limited the effort to the part of Doom3 that contained most of the groundbreaking code.

The engineer who undertook the optimization was totally unfamiliar with the concept of game engines and had never seen the game before. Yet he came to the aforementioned 15% frame rate increase within about three weeks of effort.

Maurice Kastelijn and Klaas van Gend jointly wrote the 26-page whitepaper.

Maurice presents on the topic on the T-DOSE conference in Eindhoven on October 25, 2012. His slides are available for download (ODP,PDF).

There is also a patch with the improvements so you can see for yourself.


Leave A Comment

Written by:

Klaas van Gend

Recent posts