Strafe-jumping Acceleration for Game Development

We all remember the days when we were training hours on special Quake 3 maps to improve our strafe jumping skills to gain a competitive advantage in any future CTF or FFA match because we could move at a speed that other players admired us for.

Even though time has moved on, my fascination with the technology of idSoftware has never gone away. As idSoftware released several versions of their game engines over the years, I gradually became more interested in game development. And when you investigate their technology, you eventually end up cloning the source code from their GitHub repository and building it on your own machine. But the build times were just too long.

Accelerating Builds

As with strafe jumping, sometimes you want to take a step to the side to move forward faster. This is where acceleration tools can come in to speed up build times. They can link several computing nodes in your network together to act as a single build farm. The nodes are managed by a central coordinator and share the workload of the build. 

Later in this article, I’m going to show how you can use a dev acceleration tool like Incredibuild’s free license to improve your game development. 

Incredibuild

There are no special requirements for the nodes except that they have the Incredibuild agent installed. So it can be a server VM or the laptop of your assistant as it does not even require that the build tools are installed on that machine.

Equipped with the 2022 version of Visual Studio, I downloaded the source code of the Doom 3 BFG Edition.

Once you open the doom3.sln in Visual Studio, it will automatically migrate the solution and you can immediately start building the projects. Actually, I was quite impressed to see that even after a decade the code is in such great shape that it builds after just some minor modifications.

Making the Code Compilable with VS 2022

There are some places in the code where macros that expand to strings are interleaved with strings without any whitespace in between, like in this example:

“c:\\doomdata\\”SAVEGAMENAME”%c.dsg”d

Just change it to:

“c:\\doomdata\\” SAVEGAMENAME “%c.dsg”

Then there are a few places where one has to replace the “TypeInfo.h” include with the standard conformant <typeinfo> header. Similarly, the inclusion of the obsolete <dxsdkver.h> header has to be removed. And in neo/idlib/sys/sys_includes.h, the definition of WINVER needs to be upgraded from the Windows XP version to something more recent, Windows 7 will do the trick.

#define WINVER 0x0601 // Windows 7

Some projects treat warnings as errors. So you also want to change (/WX-). Finally, one needs to fix the references to the DirectX 9 SDK. Several projects within the solution rely on the headers and libraries of the DirectX version. You can fix that by replacing those links with the content of this GitHub repository.

Timing the Build

The Doom 3 BFG Edition has around 550k SLoC. A fresh build on my machine takes around 100s. If you do not trust the time reported by msbuild, you can time it yourself by using this command in PowerShell:

(Measure-Command { MSBuild.exe /t:Rebuild doom3.sln | Out-Default }).ToString()

The stats of my machine are given below.

CPUIntel Core i5-2500 @ 3.3GHz
RAM8GB DDR3
SSDCrucial CT525MX300SSD1
Network adapterRealtek PCIe GBE Family Controller
OSWindows 10 1586

I also have a laptop in my network that has the following stats.

CPUIntel Core i7-6600U @ 2.6GHz
RAM20GB
SSDSamsung MZVLB512HAJQ-000L7
Network adapterIntel Ethernet Connection I219-LM
OSWindows 10 1586

Let’s see if we can use them jointly to speed up the build. They are connected via a 1Gbps link with a Netgear GS105E switch.

Speeding it up with Incredibuild

Download and Installation

Just download the latest version of Incredibuild from their website and install it on all the machines you want to link together. I recommend that you start with the coordinator node. For that, you will also need to get a license. There is an option to get a 30-day trial license for Incredibuild. This license allows up to 5 nodes to be connected, or 4 agents and one coordinator node respectively.

During the installation of the coordinator, you will be asked to load the license file sent to you by email. On the agent nodes, you can already fill in the coordinators’ network address during the installation. Remember, you do not need to install anything but the agent. There is no need to install Visual Studio as well.

Once you are done installing, you can do a sanity check from Visual Studio. Go to Extensions > Incredibuild > Agent Settings and hit the “Test Network Connectivity” button. This is what it gives on my machine:

Network Test

Executing and Timing the Build

In the same menu item as before, you can also start the build of the solution (i.e. Extensions > Incredibuild > Build Solution). On the build agent, you will see in the Task Manager that there are tasks spawned that build part of your solution on that remote machine.

Using one remote agent as in my example gives an overall build time of less than 40s. This is why acceleration tools can be so helpful! 

Good Game

I am still amazed that the Doom 3 BFG engine’s source code aged so well. That is what made it so easy to it compile using the Visual Studio 2022 toolset. I have, of course, used the Incredibuild extension in Visual Studio before, but I had never tried to measure its performance. 

This time I had a closer look at it. It took me only five minutes to set up my two machines and now I get a build speed of more than a factor of two. After eight full builds, that time investment will already have been paid back. More time to practice my strafe-jumping skills again!

Featured Image Source: https://www.gamewatcher.com/previews/quake-champions-preview/12831

Pankaj Kumar
Pankaj Kumar
Articles: 208