Setting up Source SDK Base 2013 Multiplayer: Difference between revisions
RaTcHeT302 (talk | contribs) |
RaTcHeT302 (talk | contribs) |
||
Line 107: | Line 107: | ||
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. | 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== | ==Other information== |
Revision as of 07:59, 27 September 2015

Setting Up
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.
Linux
- See these are instructions.
- Use the following command.
> git clone '''git@github.com:ValveSoftware/source-sdk-2013.git'''
Source SDK 2013 on Windows
Step One
- Download and install Visual Studio 2013.
Step Two
- Download the following archive, then extract the sapi51 folder to <path-to-git>\sp\src\utils.
- Run the following bat files, located here.
// Singleplay Projects <path-to-git>/sp/src/creategameprojects.bat <path-to-git>/sp/src/createallprojects.bat // Multiplayer Projects <path-to-git>/mp/src/creategameprojects.bat <path-to-git>/mp/src/createallprojects.bat
Notes Will create Visual Studio Project (.vcxproj) and Solution (.sln) files in the SRC directory.
Step Three
- Open the "everything" solution file for the project type you wish to make.
- everything.sln
- Build the above solution.
- Open the solution file for the game you are building the mod for.
- games.sln
- Build the above solution.
At this point you should have client.dll and server.dll to load with the Source Engine game you based the mod on.
Source SDK 2013 on OS X
Note: OS X Mavericks users need to change some files in order to compile the project: Remove the -fpredictive-commoning flag from OTHER_CFLAGS in src/devtools/release.xcconfig. Change SDKROOT to macosx10.8 in src/devtools/base.xcconfig.
# Single Player Project > <SDK_ROOT>/sp/src/creategameprojects > <SDK_ROOT>/sp/src/createallprojects # Multiplayer Project > <SDK_ROOT>/mp/src/creategameprojects > <SDK_ROOT>/mp/src/createallprojects
On OS X, this will create src/games.xcodeproj and src/everything.xcodeproj.
Environment & Tools Setup
OS X, you will need Xcode 4.2 installed. You will also need to have "Command Line Tools" installed. You can find this at:
XCode Preferences -> "Downloads" -> "Components"
Building The Tools
Remember to create project & make files first!
To run the tools, run this command under Terminal:
> make -f games.mak
When successfully built, you should have client.dylib and server.dylib files to load with the Source SDK Base 2013 of your choice.
Source SDK 2013 on Linux
On Linux, this will create src/games.mak and src/everything.mak.
Steam Client Runtime
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 Steam Client Runtime Installer/Updater
- Run the following commands to extract the runtime, replace <version> with the version you just unpacked:
> tar xvf steam-runtime-sdk_latest.tar.xz > cd steam-runtime-sdk_<version>
Download and setup the runtime, pick your architecture and debug/release preferences. Then answer Y to everything else.
> ./setup.sh
Run the (chroot) environment. This environment should be used to build your the SDK.
> ./shell.sh --arch=i386
SDK Build
Remember to create project & make files first!
With the above prerequisite installed, run the following:
> 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
Information about VPC
For more information on how to use VPC, look at the scripts themselves or run the following command on any platform:
> <SDK_ROOT>/<gameType>/src/devtools/bin/vpc /help
Note on Git Repository & Ignored Files
The project files generated by VPC are listed in the .gitignore file so that they won't be committed to the repository. Individuals wanting to submit changes via a pull request should be aware of this when commiting.
Adding files to your project with VPC
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.
Naming convention
The Source SDK is split into two directories at the root for <gameType>, followed by source for <gameName>. If you are building a single player mod, use the "sp" directory. If you are building a multi-player mod you should base yourself on the code in the "mp" directory.
- <gameType>
- sp (singleplayer)
- mp (multiplayer)
- <gameName>
- hl2 (Half-Life 2)
- episodic (Half-Life 2 Episodes)
- hl2mp (Half-Life 2: Deathmatch)
Each directory has a matching Source SDK 2013 Base appID to use to get the base mod files:
- Source SDK Base 2013 Singleplayer
- Client AppID: 243730
- Source SDK Base 2013 Multiplayer
- Client AppID: 243750
- Server AppID: 244310 (see SteamCMD for instructions on how to install this one)
These two base apps are very similar, differing mostly in update schedule. The Singleplayer base will only update with HL2 and the Episodes do, which isn't very often. The Multiplayer base will update a few times a year to incorporate engine changes from TF2 and Counter-Strike: Source. None of these updates should break mod compatibility.
Issues fixed
Fatal Error: CDEFS.h No such file or directory (Linux)
> /usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory
See [Steam steam runtime commands].
RegKey Errors While Generating Project Files
ERROR: Unable to find RegKey for .vcproj files in solutions."
Install Visual Studio 2013.Template:CN
error MSB8008: Specified platform toolset (v120_xp) or (v120)

1 - Select all Project Files
2 - Right-click on the file, then choose "Properties"
3 - Choose "Configuration Properties"
4 - And the last, choose in "Platform toolset" this -> (v100)
(Project->Properties->Configuration Properties->General->Platform toolset = Visual Studio 2010(v100))
You can also see action in this screenshot.
It works with Microsoft visual C++ 2010 SP1, as in the "release" and in the "debug"
Visual Studio 2012
A tool has been created by a member of the community to fix this type of error on Visual Studio 2012. Use at your own risk. Download source from GitHub (AutoIt v3 is needed).