The Source SDK is a collection of software used to create custom content for games made with Valve's Source engine. Also known as authoring tools, the Source SDK contains all the tools you need to start creating your own levels. In order to get started with the Source SDK, you first need to get a hold of Steam. Steam is Valve's entertainment platform that allows its users to download and play a multitude of different games.
In this chapter, we will cover the following topics:
Downloading and installing Steam
Gaining access to the SDK
Glancing at the tools
Creating your own modification (mod) with the Source SDK
So, let's get started!
You might ask yourself what is Steam, and why do I need it? First and foremost, the only way to gain access to the Source SDK is by downloading the SDK or a Valve game that uses the Source engine. All of Valve's Source engine games are downloaded and managed with a program called Steam. Steam lets you purchase, organize, and update thousands of games, and it's completely free.
In order to download and install Steam, you need to visit store.steampowered.com, and click on the Install Steam button in the top-right corner of the web page, as shown in the following screenshot:

This will redirect you to another page where you can download the actual installation file. After you have downloaded and installed Steam, you need to log in or create a new user account if you do not already have one. All you need is a valid e-mail address in order to create a new Steam account.
Great! You have installed Steam. Now what? There are a multitude of games that run on the Source engine. There are also many different versions of the Source engine: 2006, 2007, 2013, and multiplayer and single player variants for each. This book will focus on Half-Life 2: Episode Two (HL2: EP2) since it's the most recent single player build of the Source engine at the time of writing this book. In order to create content for HL2: EP2, you just need to own a copy of the game. Steam makes it easy to install games. So, if you haven't already, purchase and install HL2: EP2.
Tip
You don't need HL2: EP2 to follow this book. The principles taught cover the Source SDK tools, which are applicable to multiple games.
Downloading and installing games with Steam is easy! Steam lets you securely purchase any game and will automatically install them once downloaded. The steps for installing Half-Life 2: Episode Two are as follows:
Open Steam and log in.
In Steam, just below the main toolbar, you will see STORE, LIBRARY, COMMUNITY, and your username in a large white font. Click on STORE.
Search for
Half-Life 2: Episode Two
, purchase it, and install it.You can monitor the download progress within the Downloads tab in the LIBRARY drop-down menu. HL2: EP2 will begin to install automatically once the download is complete.
The STORE is located in the top-left corner of Steam as shown in the following screenshot:

Browse for Half-Life 2: Episode Two
as shown in the following screenshot. You can also get any other Source game.

Once the download and install is complete, launch the game and play around with the engine you will be developing for, as shown in the following screenshot:

All the SDK tools come with the game, so you don't need to install anything extra. (This also means you don't need to wait for something else to download!) The tools are located in the Steam\steamapps\common\Half-Life 2\bin
folder. The folder is packed with applications, batch files, and DLLs, but there are a few key programs that we're interested in right now. In the bin
folder, you will see Hammer, HLMV, and HLFacePoser. Hammer Editor is the tool you will most likely use; it is the application that you use to actually create the levels (maps). HLMV or Half-Life Model Viewer is a tool you can use to inspect game models in detail. HLFacePoser is used to sync lips to speech, and create custom scenes and NPC interactions.
Half-Life 2: Episode Two ships with its own set of authoring tools, but if you want to make your own mod, you need the Source SDK. The Source SDK is a program that organizes all the authoring tools for specific mods and engine builds and has the ability to automatically create a mod based on the code from Half-Life 2: Episode Two. If you want to create your own mod, you will need to grab the Source SDK.
Installing the Source SDK is just as easy as any regular game. The best part is its price: free! The steps for installing the Source SDK are as follows:
In the top-left corner of the games library, select the dropdown that says All Games and select Tools.
Find the Source SDK in the list of Tools.
Right-click on Source SDK and select Install game, or just double-click to begin the download process.
You can monitor the download progress within the Downloads tab in the LIBRARY. The Source SDK will begin to install automatically once the download is complete.

When you first launch the Source SDK, it will need a minute or so to copy files and complete the install, but once that is complete, you're ready to go! You will notice that the Source SDK contains a variety of tools, documents, and links. At the very bottom are two fields labeled Engine Version and Current Game. Engine Version is used to select which version of the Source engine you would like to develop for.
The later engine versions have more features and graphics upgrades compared to the earlier versions. There is also the Source Engine MP option, which lets you create maps for Valve's multiplayer games such as Counter-Strike: Source and Team Fortress 2.

In the APPLICATIONS list, you will see Hammer Editor, Model Viewer, Face Poser, and itemtest. Hey, doesn't this look like the set of authoring tools we had for HL2: EP2? It is, with the exception of itemtest that allows you to look into details about specific games items such as the items available in Team Fortress 2.
In the DOCUMENTATION list, you will see Release Notes and SDK Reference Docs. The Release Notes option will link you to the Valve Developer Community website that describes the changes made to the current version of the Source SDK. SDK Reference Docs will link you to the Valve Developer Community website's collection of notes about every aspect of the Source SDK.
In the UTILITIES list, you will see Create a Mod, Refresh SDK Content, Reset Game Configurations, and Edit Game Configurations. Create a Mod will open a wizard that allows you to create your own modification, or mod, for a certain Source game. Refresh SDK Content will refresh all the game content in the event that the Source SDK is not functioning properly. Reset Game Configurations will return all games to their default configurations. Edit Game Configurations will allow you to modify the path of any game you want.
In the LINKS list, you will see Valve Developer Community and Softimage|XSI Mod Tool. Valve Developer Community will link you to the main page of Valve Developer Community. Softimage|XSI Mod Tool will link you to an Autodesk website where you can download a free version of character modeling and animation software that is compatible with the Source engine.
So you have this amazing idea for a video game and want to create your own mod. You want to include lasers and Samurai, and you want to make a fast-paced, WWII-era, team-based shoot-em-up game called Samurai Laser Paratroopers. Well, guess what—the Source engine can do this, and the Source SDK makes the mod setup easy! In this example, we will be creating a multiplayer Mod for the 2007 Source engine from a template:
To create your very own Half-Life 2 mod, double-click on the Create a Mod utility.
Select the Start a Multiplayer mod from a Template radio button on the first prompt of the Create a Mod wizard and then click on Next.
In the first entry, specify the drive directory location where you want your game to be stored. I chose
C:\SLP\
for easy access. In the second entry, specify the name of the mod you want to create, and click on Next to continue.Choose the options you want available in your mod.
The wizard will then copy all the necessary files into the directory you have specified.
The instructions are pretty straightforward. Choose carefully when you select the options shown in the following screenshot; they're harder to change later on:

Have patience, we're almost done!

Now, let's take a look at the folders the wizard has created. There are four folders in your new mod's folder (shown here as C:\SLP
). Three of those folders have suffixes of "src" as shown in the following screenshot:

The mapsrc
folder is where all your maps should be saved (although you can always save your maps elsewhere). All texture and material files go into the materialsrc
folder, while all models should be saved in the modelsrc
folder. The code generated specifically for your mod is saved in the src
folder. Utilizing these folders to store all your source materials will make your life easier later on.
Restart Steam and check out your library of games. Your new mod is in there!

Also take a look at the Source SDK; your mod will be listed as one of the games in the engine build you selected, as shown in the following screenshot:

When you create a mod with the Source SDK wizard, it creates a barebones game. You will need to dive into the game code to make your mod what you want it to be. This book does not cover custom code, but it's still relevant for mapping techniques for your custom mod.
Getting your hands on Steam is quick and easy. It is required to use the Source SDK tools, and it is also useful for keeping your games and tools organized. Once Steam is installed, downloading and installing Half-Life 2: Episode Two is a snap. Creating a mod is a great way to begin developing your own game with the source engine base code, but you still need to code to get what you want out of the game. Let's pick up the Hammer and see what we can do!