Setting up Source SDK Base 2013 Multiplayer

Key points

Setting Up
Install Source SDK Base 2013 (multiplayer or singleplayer depending on your mod) from Steam->Tools
Windows and OS X
- Download GitHub for Windows or OS X depending on the operating system and install it.
- Open the following page, then click the Clone in Desktop button.
- Navigate to
<path-to-git>\sp\game
and copy the mod_hl2 or mod_episodic folder to<Steam-folder>\steamapps\sourcemods
Source SDK 2013 on Windows
Step One
- Download and install Visual Studio 2013.
- Run Visual Studio, then under Tools, select Extensions and Updates.
- From the left list, select Updates, Product Updates, then select Visual Studio 2013 Update 5 and push the Update button.
- Run VS2013.5.exe and agree to the license, push the Install button, then follow the on screen instructions.
- Download and install the Multibyte MFC Library.
Step Two
- Download the following archivemirror and extract the sapi51 folder to
<path-to-git>\sp\src\utils
- 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
Step Three

- Open everything.sln for the desired mode (Singleplayer or Multiplayer) and build it.
- 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
- 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
Notes

Step Two
- Install Xcode 4.2.
- You will also need to have "Command Line Tools" installed. You can find this at XCode Preferences -> "Downloads" -> "Components".
Step Three
To run the tools, run this command under Terminal.
make -f games.mak
Notes

Source SDK 2013 on Linux
Step One
- 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
Notes
This will create games.mak and everything.mak.
Step Two
To build the Source SDK 2013 on Linux you should use the Steam Client Runtime to guarantee compatibility with most Linux distributions. It will only work on Debian-/Ubuntu-based systems though.
- Download the following files.
- Run the following commands in order to extract the files.
tar xvf steam-runtime-sdk_2013-09-05.tar.xz cd steam-runtime-sdk_2013-09-05
3. Download and setup the runtime, pick your architecture and debug/release preferences. Then answer Y to everything else.
4. Run the following ./setup.sh
commannd.
5. Run the (chroot) environment ./shell.sh --arch=i386
. This environment should be used to build your the SDK.
Step Three
> make -f games.mak
At this point you should have client.so and server.so files to load with the Source SDK Base 2013 of your choice. More instructions on using the Steam runtime can be found in README.txt in the installed runtime directory.
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 [https://code.google.com/p/protobuf/ 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.
Manually Setting up Microsoft Speech SDK (SAPI)

The Source SDK requires the Microsoft Speech SDK but doesn't come with it for licensing reasons. Download the Speech SDK 5.1 from here. This should download the SpeechSDK51.exe file. Run this and it should unzip contents to a selected folder. One of the contents it unzips is Microsoft SDK 5.1.msi. Running this with the default settings should create a directory in C:\Program Files (x86)
called Microsoft Speech SDK 5.1
. Copy the Microsoft Speech SDK 5.1
directory into the src/utils
directory and rename it sapi51
.
Compiling now shows a number of errors in the sphelper.h
file. There is more than one way to fix these errors. This section will describe how to fix them manually.
Change the following lines t have the code shown below.
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
Note:Building now might generate an error unresolved symbol _IID_IspPhoneticAlphabetSelection
. This was perhaps caused because you had already built and the partial build is broken. This could be fixed by rebuilding the phonemeextractor
project.
Issues fixed
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))