Setting up Source SDK 2013 - Multiplayer (TF2 branch)

This tutorial walks you through creating a multiplayer mod for Source SDK Base 2013 Multiplayer, using the newest Team Fortress 2 branch. This branch includes the source code for Half Life 2: Deathmatch (
HL2MP
in the code) and Team Fortress 2. You can choose either game as the starting point for your mod.
Key points
- 32-bit
macOS is no longer supported by the Team Fortress 2 SDK. If you need to build macOS binaries, use the singleplayer or the legacy SDK 2013 MP codebases.
Setting Up (All Platforms)
Setting up the Source SDK Base
Install Source SDK Base 2013 Multiplayer from your Steam library, you can use the search function or enable "Tools" in the filters, or from the links below:
- Install/Run Source SDK Base 2013 (MP) Multiplayer (AppID: 243750)

Getting the code
Method 1: Using the GitHub Desktop client (Windows)
- Download and install the GitHub Desktop client
- Open the Source SDK Git repository and click "Clone to desktop"

singleplayer
branch if you are developing for the older SDK 2013 SP branch. On older versions of the SDK 2013 source code, there will be two distinct directories for both multiplayer (mp
) and singleplayer (sp
).Method 2: Using the command line (Windows/Linux)
- Download and install the Git CLI.
Linux users can download it with their distro's package manager (APT, Aptitude, DNF, Pacman, Synaptic...).
Windows users can download Git here.
- Open the terminal/command prompt and run this command:
git clone https://github.com/ValveSoftware/source-sdk-2013.git
Setting up (Platform Specific)
Windows
Step One: Installing requirements
You will need to install Visual Studio 2022. You don't need a Microsoft account to download the software but you may be prompted to log in with one when launching the software.
During installation, Visual Studio Installer will ask you which workloads you want to install. You don't need to install everything, make sure that the "Desktop development with C++" workload is ticked otherwise your Visual Studio installation won't be able to do anything C/C++ related.
In terms of components, you will need:
- C++ core features (you can't untick that one).
- Latest version of "MSVC++ v143 - VS 2022 x64/x86 build tools" (don't confuse with ARM ones, no need to grab "special versions" like the Spectre mitigated).
- The latest version of the Windows 10 or 11 SDK (for Windows 10, SDK build 10.0.19041.1; for Windows 11, 10.0.26100.1)
- Only if you want to support VScript: the latest version of Python 3 (acquired from the official website or via the Microsoft Store), make sure it's in your "PATH" environment variable as well.
Step Two: Preparing the Project Files
Source SDK uses the Valve Project Creator (VPC) to generate the projects and the solution for Visual Studio.
- Navigate to
<path-to-git>\src\
and opencreateallprojects.bat
. - By default, this batch script creates a solution called
everything.sln
which includes projects for HL2MP and TF2 simultaneously, as well as utlities (VBSP, qc_eyes...). You probably wouldn't need all this, so we will modify this batch script to better suit our needs:
If you're creating a Team Fortress 2 mod:
- Replace the contents of
createallprojects.bat
with:
- Replace the contents of
devtools\bin\vpc.exe /tf /define:SOURCESDK +game /mksln games.sln
If you're creating a Half Life 2: Deathmatch mod:
- Replace the contents of
createallprojects.bat
with:
- Replace the contents of
devtools\bin\vpc.exe /hl2mp /define:SOURCESDK +game /mksln games.sln
If you need the utilities (either game):
- Replace
+game
with+everything
.
- Replace
Note:All of these utitlities are already compiled for you under
Steam\steamapps\common\Source SDK Base 2013 Multiplayer\bin\x64\
. Only use+everything
if you need to modify their code.
3. Run createallprojects.bat
. This will create a .sln file in the same directory.
Step Three: Compiling and Running the Source SDK
- Open your solution file, either
games.sln
oreverything.sln
. - Select the solution, located under the Solution Explorer list, on the top bar, right next to the Debug drop down menu (the properties box/pane under the solution explorer), change Debug to Release.
- Right Click on the solution, then select Build Solution.

For those who made the choice of not installing Python at the previous step, you will get compile errors when building the server binary because Python scripts that's supposed to generate some C/C++ files required by VScript couldn't be run due to the missing interpreter. The first part of the fix is to open src/game/server/server_base.vpc
with the text editor of your choice and comment the entire $CustomBuildStep "nut"
section. Re-run VPC (createallprojects.bat), if Visual Studio was opened and says that things changed outside of the editor, click the "Discard" button so that it reloads the local changes made by VPC. Re-select "Debug" or "Release" configuration and compile again. The remaining C/C++ errors can be fixed by commenting the code.

- If something fails at the end, then simply rebuild the solution.
- The client.dll is going to be generated in
<path-to-git>\src\game\client\Release_mod_hl2mp
and<path-to-git>\src\game\client\Release_mod_tf
- The server.dll is going to be generated in
<path-to-git>\src\game\server\Release_mod_hl2mp
and<path-to-git>\src\game\server\Release_mod_tf
- The post-build step automatically moves both dlls to
<path-to-git>\game\mod_hl2mp\bin\x64
and<path-to-git>\game\mod_tf\bin\x64
, which is where they need to reside when you distribute your mod.
If the code compiles successfully, you can press F5 or click 'local windows debugger' to test your mod from Visual Studio. Make sure the client project is the startup project by right clicking on either Client (TF) or Client (HL2MP) and selecting "Set as Startup Project." You can hide projects you don't need by right clicking on them in the Solution Explorer and selecting 'Unload Project.'
Optional Steps
These steps are not required for compiling the game DLLs, these are only prerequisites for compiling these specific projects:
Building the shaders
qc_eyes
- Download and install the Multibyte MFC Library.

phonemeextractor
- Download a ZIP of the Speech SDK
Note:Microsoft has removed the Speech SDK download page. The link above will download a ZIP of the SDK's contents, including code fixes made by the SDK2013CE community that were previously documented on this page.
- Extract the ZIP Archive, and copy the sapi51 folder to the
<SDKROOT>\src\utils
folder.

unresolved symbol _IID_IspPhoneticAlphabetSelection
. This is perhaps because you already had something mounted and the partial build is broken. This issue can be easily fixed by rebuilding the phonemeextractor
Linux
Step One: Introduction
By default, Steam on Linux and everything on top of it (games, apps...) runs through a sand-boxed environment called the Steam Runtime. It is basically a stripped down Ubuntu installation with the necessary stuff (drivers, libraries...) required to run Steam itself and games.
Valve recommends that everything destined to be run on Linux and more specifically Steam is built and running through this runtime. Building "natively" is heavily discouraged as there are no guarantees that the build will be a success (especially with modern C/C++ toolchains) and your mod might not run perfectly.
In the past, Valve used the "chroot environment" technique for the Steam Runtime. However, they changed and recommend the usage of containers based solutions like Podman and Docker. Source SDK 2013's updated code has been compiled with the third version of the Steam Runtime (codenamed "sniper") and we will be doing the same.

Step Two: Requirements
Any operating system capable of running Podman will do the job. Ubuntu has a package so you can easily download it with apt install podman
(use apt-get
instead if you're working on a CI/CD pipeline or remotely when you don't have a "fancy" terminal).

sudo
.Next, you need the Source SDK 2013 source code cloned. It is assumed that a non-modified copy is used, if you need to clone the source code, the instructions are at the top of this page.
Step Three: Building the binaries
All you have to do is run the $SDK_ROOT/src/buildallprojects
shell script (you can also cd src
first then ./buildallprojects
if you prefer), $SDK_ROOT
means where you have cloned the source code earlier. By default, you will be building "release" binaries, if you want "debug" binaries instead, simply add debug
after buildallprojects
(don't forget a space in-between).
If you're getting an error that involves "invalid mount point", open the sdk_container
shell script with a text editor and find the --mount
arguments of the podman run
command. You should see some \"
characters lying around, remove those but be careful not to remove the rest.
Another error you might get is about the .ccache
folder being missing in your "home" folder. Creating the folder simply fixes it (mkdir $HOME/.ccache
).
Binaries should now be built and available assuming everything went fine. If you want to know how the compile process works exactly, look at buildallprojects
and sdk_container
shell scripts.
Setting up on Steam
See Setup mod on Steam.
Other information
Adding new files with the Valve Project Creator
- Add instructions on how to here.
- Open hl2.vpc with a text editor and edit this line or something.
VPC generates project files for all of the platforms that the SDK supports, so if you want to add files to your project in a way that will allow you to easily build on other platforms, consider using VPC. For example, to add a file to a multiplayer game, you could add a line to src/game/client/client_hl2mp.vpc.
Directory structure
- game - Runtime files for the mods themselves. Any mod content will go in here.
- src - All the source code for that kind of mod. The root of the src directory contains .sln or root level .mak files for building the source.
- common - A few files used by the server and client DLLs
- devtools - Scripts and utilities that are used to build the source. These are called by the makefiles and projects and you probably won't need to interact with them directly.
- game - All of the source code for the DLLs.
- client - Code used by client.dll (or client.dylib or client.so). There are also game-specific directories under here.
- server - Code used by server.dll. There are also game-specific directories under here.
- shared - Code used by both client.dll and server.dll.
- gcsdk - A couple of tools used to build the DLLs.
- lib - Binary versions of the libraries that the source code depends on. This is also the build target for vgui_controls, tier1, and mathlib.
- mathlib - Math utilities used by the game.
- public - Header files for all of the DLLs and libraries that are used by the game. Also includes a few source files.
- thirdparty - Third party libraries needed to build the source. At the moment this contains only the Google Protocol Buffers (protobuf) library.
- tier1 - Useful utility classes. Builds into tier1.lib
- utils - Various development utilities
- vgui2 - Source code for vgui_controls, which is used by client.dll.