Setting up Source SDK Base 2013 Multiplayer: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
Line 36: Line 36:
===Step Three===
===Step Three===
# Open '''everything.sln''' for the desired thing and build it.
# Open '''everything.sln''' for the desired thing and build it.
#Select the project configuration to be build, either Debug or Release. This is done by right-clicking on the <code>everything</code> solution in the solution explorer, selecting <code>properties</code>, then navigating to <code>Configuration Properties/Configuration Manager/Active Solution Configuration</code>, selecting either Debug or Release (Debug is default), pressing <code>Close</code> and then <code>Ok</code>.
Now build the solution by right-clicking on the <code>everything</code> solution in the solution explorer and clicking <code>Build All</code>. Now close the <code>everything</code> solution, open the <code>games</code> solution and update the projects as you did for the <code>everything</code> solution. Continue the guided setup process from the [[#Building Shaders|Building Shaders]] section.
{{note|Once the build is complete, consider [[Installing and Debugging the Source Code#Debugging| setting up your mod for debugging]].}}
# Open '''games.sln''' for the desired game and build it.
# Open '''games.sln''' for the desired game and build it.



Revision as of 09:25, 27 September 2015

Template:Otherlang2

Broom icon.png
This article or section needs to be cleaned up to conform to a higher standard of quality because:
Outdated, poorly written and incomplete or completely missing instructions. Linux and OS X instructions are incomplete (no instructions on how to build anything on Linux). Windows shader build instructions are poorly written, not crossplatform friendly.
For help, see the VDC Editing Help and Wikipedia cleanup process. Also, remember to check for any notes left by the tagger at this article's talk page.

Key points

Note.pngNote:The Source SDK uses the Valve Project Creator in order to generate the required platform specific files.

Setting Up

Windows and OS X

  1. Download GitHub for Windows or OS X depending on the operating system and install it.
  2. Open the following page, then click the Clone in Desktop button.

Linux

  1. See these instructions on how to use Git.
  2. Open the terminal and run the following command.
git clone git@github.com:ValveSoftware/source-sdk-2013.git

Source SDK 2013 on Windows

Step One

  1. Download and install Visual Studio 2013.
  2. Run Visual Studio, then under Tools, select Extensions and Updates.
  3. From the left list, select Updates, Product Updates, then select Visual Studio 2013 Update 5 and push the Update button.
  4. Run VS2013.5.exe and agree to the license, push the Install button, then follow the on screen instructions.

Step Two

  1. Download the following archive and extract the sapi51 folder to <path-to-git>\sp\src\utils
  2. Navigate to <path-to-git>\sp\src\ and run createallprojects.bat and creategameprojects.bat
  3. Navigate to <path-to-git>\mp\src\ and run createallprojects.bat and creategameprojects.bat

Step Three

  1. Open everything.sln for the desired thing and build it.
  1. Select the project configuration to be build, either Debug or Release. This is done by right-clicking on the everything solution in the solution explorer, selecting properties, then navigating to Configuration Properties/Configuration Manager/Active Solution Configuration, selecting either Debug or Release (Debug is default), pressing Close and then Ok.

Now build the solution by right-clicking on the everything solution in the solution explorer and clicking Build All. Now close the everything solution, open the games solution and update the projects as you did for the everything solution. Continue the guided setup process from the Building Shaders section.

Note.pngNote:Once the build is complete, consider setting up your mod for debugging.
  1. Open games.sln for the desired game and build it.

Notes
The project files will generate client.dll and server.dll once built.

Step Five

See Source SDK 2013: Shader Authoring.

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

Step One

  1. navigate to
  2. open these bats
 # 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

Notes
On Linux, this will create src/games.mak and src/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.

  1. Download the following files.
  2. 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

  1. Add instructions on how to here.
  2. 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.

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:

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: Sys/Cdefs.h No such file or directory (Linux)

Unable to find RegKey for .vcproj files in solutions (Windows)

MSB8008: Specified platform toolset (v120_xp) or (v120) is not installed or invalid (Windows)

  1. Select all Project Files
  2. Right-click on the file, then choose "Properties"
  3. Choose "Configuration Properties"
  4. Under "Platform toolset" this -> (v100)

(Project->Properties->Configuration Properties->General->Platform toolset = Visual Studio 2010(v100))

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).