Source SDK 2013
![]() |
This article needs to be cleaned up to conform to a higher standard of quality because: OS X instructions are incomplete, the files cannot be possibly built due to the Windows dependencies, they need to be re-written from scratch. Shader build instructions are poorly written, not crossplatform friendly. Valve Project Creator instructions are incomplete.
|
Key points

Setting Up (All Platforms)
Setting up the Source SDK Base
Install Source SDK Base 2013 (multiplayer or singleplayer depending on your mod) from Steam->Library->Tools or from the links below:
- Install Source SDK Base 2013 singleplayer (AppID: 243730)
- Install Source SDK Base 2013 multiplayer (AppID: 243750)
Getting the code
Method one: Using the GitHub Desktop client (Windows/OS X)
- Download and install the GitHub Desktop client
- Open the Source SDK git repo and click "Clone to desktop"
Method two: Using the command line (Windows/OS X/Linux)
- Download and install the git CLI from here and choose the build for your platform.
- Open the terminal/command prompt and run this command:
git clone https://github.com/ValveSoftware/source-sdk-2013.git
Method three: Downloading the ZIP archive

Download from here
Setting up (Platform Specific)
Source SDK 2013 on Windows
Step One: Installing Visual Studio

Just install both VS 2013 and 2015, open the solution in VS 2015, and skip the dialog where VS 2015 tries to upgrade your projects.
- Download and install Visual Studio 2013.
- Download and install the Multibyte MFC Library.
Step Two: Installing the Microsoft Speech SDK
- Download the Microsoft Speech SDK
- Extract install files and run
Microsoft Speech SDK 5.1.msi
- Copy
C:\Program Files (x86)\Microsoft Speech SDK 5.1
to<SDKROOT>\sp\src\utils\sapi51
or<SDKROOT>\mp\src\utils\sapi51
depending on your mod. - Open
sphelper.h
and fix the following errors: - Make sure that your directory looks like this : \sp\src\utils\sapi51 then should contain Bin Docs IDL etc. And not like this : \sp\src\utils\Microsoft Speech SDK 5.1\sapi51. If it's like the latter it will throw up error code 1 on compile.
Line 769
const size_t ulLenVendorPreferred = wcslen(pszVendorPreferred); // no size_t
Line 1418
static long CoMemCopyWFEX(const WAVEFORMATEX * pSrc, WAVEFORMATEX ** ppCoMemWFEX) // missing long
Line 2368
const WCHAR * PropertyStringValue() const
{
// Search for the first NULL and return pointer to the char past it.
SPDBG_ASSERT(eEventId == SPEI_PROPERTY_STRING_CHANGE);
const WCHAR * psz = (const WCHAR *)lParam; // moved this from for init
for (; *psz; psz++) {}
return psz + 1;
}
Line 2560
SPPHONEID* pphoneId = (SPPHONEID*)((WCHAR *)dsPhoneId); // improper casting
Line 2634
pphoneId += wcslen((const wchar_t *)pphoneId) + 1; // improper casting
Step Three: Compiling the Source SDK and preparing project files
- Navigate to
<path-to-git>\sp\src\
and run createallprojects.bat and creategameprojects.bat - Navigate to
<path-to-git>\mp\src\
and run createallprojects.bat and creategameprojects.bat

- Open everything.sln for the desired mode (Singleplayer or Multiplayer).
- Select the everything solution, located under the Solution Explorer list, then from the middle menu, right next to the Auto drop down menu, change Debug to Release.
- Right Click on the everything solution, then select Build Solution.
Notes


<path-to-git>\sp\src\game\client\Release_mod_hl2
and <path-to-git>\sp\src\game\client\Release_mod_episodic

<path-to-git>\sp\src\game\server\Release_mod_hl2
and <path-to-git>\sp\src\game\server\Release_mod_episodic

Step Four
See Source SDK 2013: Shader Authoring.
Source SDK 2013 on OS X
Step One
- Install Xcode 4.2.
- You will also need to have "Command Line Tools" installed. You can find this at Xcode Preferences -> Downloads -> Components.
Step Two
Run the following scripts to generate project files.

cd <SDK_ROOT>/sp/src ./createallprojects ./creategameprojects cd <SDK_ROOT>/mp/src ./createallprojects ./creategameprojects
games.xcodeproj and everything.xcodeproj will be generated in the src
folder.
Step Three
To compile the tools, server and client libraries open everything.xcodeproj and games.xcodeproj in Xcode and build the projects (Product -> Build).

Notes

Source SDK 2013 on Linux

Step One: Getting the basic C/C++ development tools
You should already have these, but to be sure, you can run the following command in a terminal :
sudo apt-get install build-essential
AMD64 (64 bits) users will need to download and install additional packages to target the i386 (32 bits) architecture, this can be done with this command in a terminal :
sudo apt-get install gcc-multilib g++-multilib
Step Two: Preparing the Source SDK 2013
Just run the following commands (by replacing [SDK_ROOT] by the location of the Source SDK 2013) :
cd [SDK_ROOT]/sp/src ./createallprojects ./creategameprojects cd [SDK_ROOT]/mp/src ./createallprojects ./creategameprojects
games.mak and everything.mak will be generated in the src
folder.
Step Three: Downloading, installing, setting up the Steam Client Runtime
The Steam Client Runtime will help you guarantee compatibility with most GNU/Linux distributions. It is required to install it in "/valve/steam-runtime", if you don't like this and wish to install the Steam Client Runtime elsewhere : symbolic link is your friend. We are going to assume you want to do the first option. Run the following commands in a terminal, make sure to replace "[USER]" by your login and "[GROUP]" by your group name (on Ubuntu, the login and group name are identical) :
cd / sudo mkdir valve cd valve sudo wget http://media.steampowered.com/client/runtime/steam-runtime-sdk_latest.tar.xz sudo tar xvf steam-runtime-sdk_latest.tar.xz sudo mv steam-runtime-sdk_2013-09-05 steam-runtime sudo chown <USER>:<GROUP> * -R
Run the "./setup.sh" script in the "steam-runtime" directory, select the architecture and configuration you wish to target, say "Yes" to everything related to updates.
Before compiling the SDK, you have to run the (chroot) environement, this is done by running the "./shell.sh --arch=i386" script.
Step Four: Time to compile

dpkg
AUR package to compile the game.In a terminal (like always), "cd" into the "sp" (singleplayer) or "mp" (multiplayer) directory of the SDK and the "src" directory, just run the following command to compile :
make -f games.mak
If everything went well, you should have the "client.so" and "server.so" files in the "game" directory to load with the appropriate Source SDK Base 2013. You can get more instructions on using the Steam Client Runtime by reading the "README.txt" file in the installed runtime directory.

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.
Troubleshooting
Unable to find RegKey for .vcproj files in solutions (Windows)
- Install and update Visual Studio 2013. See Source SDK 2013 on Windows (Step One).
MSB8008: Specified platform toolset (v120_xp) or (v120) is not installed or invalid (Windows)
- Select all Project Files
- Right-click on the file, then choose "Properties"
- Choose "Configuration Properties"
- Under "Platform toolset" this -> (v100)
(Project->Properties->Configuration Properties->General->Platform toolset = Visual Studio 2010(v100))
Issues with "min" or "max" from Steam Runtime when Compiling on Linux
Copy and paste the following lines:
#undef min #undef max
to the beginning of the following files:
/valve/steam-runtime/amd64/i686-unknown-linux-gnu/i686-unknown-linux-gnu/include/c++/4.6.3/limits /valve/steam-runtime/amd64/i686-unknown-linux-gnu/i686-unknown-linux-gnu/include/c++/4.6.3/bits/random.h /valve/steam-runtime/amd64/i686-unknown-linux-gnu/i686-unknown-linux-gnu/include/c++/4.6.3/bits/algorithmfwd.h /valve/steam-runtime/amd64/i686-unknown-linux-gnu/i686-unknown-linux-gnu/include/c++/4.6.3/bits/stl_algobase.h