Source SDK Guide

How to make a standalone game with Source in 10 steps for Source SDK

How to make a standalone game with Source in 10 steps

Overview

This guide will show you how to make a standalone game with source but do NOT try to sell your game or Valve will send hell to your door step! this is for construction of small games that u can send to your friends.

Building a standalone game with source

So here you will be compiling the free source code that valve distributed for users like yourself to create mods that aren’t dependent on half life 2 or anything like that, if you are wanting to add any kind of content like more weapons or vehicles maybe even just change a few things around, then u will have to make the changes in the code and then re-compile it.

1- Find the source-sdk-2013-master, which you can find on github or the VDC and download it.

2- Navigate to “spsrc” folder and run the batch called “creategameprojects.bat”

3-If everything worked then a new solution file will appear called “game.sln” ( if this doesnt work, there is a fix that can be found on VDC )

4- Open the solution and in the hierarchy, change the build mode from Debug to release and otherwise everytime you open it, it will come up with assertions. Right click on the tab that says “Solution ‘games’ (8 projects)” and click “Build Solutions”. (Make sure that you are using Visual Studio 2013 or it will not work”

5- Now navigate to spgamemod_hl2 (your dlls will be in the “mod_hl2bin” feel free the delete the pdb as it takes up lots of space and isn’t really useful).

6- Create a new folder for your game, then inside that folder, create a new folder called Game. Then create a new folder called Base, so there should be a folder for your game and inside that folder is two folders, one called Game and the other Base. (check images attached for more info).

7- Grab the new mod_hl2 folder that you have got from the source-sdk-2013-master and move it into the “C:mysrcgameGame” folder.

8- Download Source SDK Base 2013 Singleplayer, which you can find in /Tools tab on steam, once downloaded you can copy the files from Src SDK Base 2013 SP into your “C:mysrcgameBase” folder.

Nice, you have created the dlls and setup the template for your game, if u are wanting to make something from like the beginners guide and u may have noticed that the file size is like 2/3 gigs, you can always use GCFscape to scale the size of the VPK’s down, the smallest size I got mine was 200mb.

So by now you should have this:
C:MysrcgameBase<source sdk base 2013 singleplayer files>
C:MysrcgameGame<mod_hl2>

9- Making the exe for your game to run. Now credit to a friend of mine for pointing me in the right direction for this one, as he told me that the source code for Source 2007 may still contain an exe builder for my mod, but I did some digging and managed to put something together.
in “C:Mysrcgame” create a new txt document and call it something like “mygame” inside of it enter this:

@”basehl2.exe” -game “%~dp0Game”

10- Now save the new txt as a bat, so now if you have done everything right, then your mod/game will run once you run the bat, and yes you might be saying “what about an exe for my game??!” well you can find an Bat to exe converter and convert your Bat to an exe so that you can run your game with an exe.

So I hope this helped, if there are any problems, feel free to message me, I built this because of the amount of pain I was in when I wanted to make a standalone game in source and every answer I ♥♥♥♥♥♥♥ got was “it cost $25,000” or “Use Source SDK to make your mod”, but finaly there is now a full guide.

SteamSolo.com