Source SDK

Source SDK

175 ratings
How to make a standalone game with Source in 10 steps
By MightyMawse
This guide will show you how to make a standalone game with source.
2
6
   
Award
Favorite
Favorited
Unfavorite
Building a standalone game with source
So to start off you will need to have a copy of Visual Studio 2013 to be able to compile the free source code for 'Source SDK Base 2013 Singleplayer'. If you are wanting to add any kind of content like more weapons or vehicles maybe just change a few things around, then you 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.
https://developer.valvesoftware.com/wiki/Source_SDK_2013 - link to valve source code.

2- Navigate to "sp\src" 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 which requires you do edit Registry Edit )

4- Open the solution and at the top of the screen, change the build mode from Debug to Release or vise versa, it won't matter for what we are doing.
Then 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 inside the folder you have downloaded you will need navigate to "sp\game\mod_hl2" (your dlls will be in the "mod_hl2\bin" feel free the delete the pdb as it takes up lots of space and isn't really useful).

6- Now go to your desktop or where ever works for you and create a new folder for your game, this will be your actual game files, 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 in 'sp/game/mod_hl2' and move it into the "mysrcgame\Game" 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 Source SDK Base 2013 SP into your "C:\mysrcgame\Base" folder.

Nice, you have created the dlls by compiling the source code and you have setup the template for your game. You may have noticed the size of source games are quite large, you can use GCFscape to remove unused content from the .VPK files, the smallest size I managed to get mine was 200mb.
https://gamebanana.com/tools/26 - gcfscape

So by now you should have this:
C:\Mysrcgame\Base\<source sdk base 2013 singleplayer game files>
C:\Mysrcgame\Game\<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, in "C:\mysrcgame\" create a new .txt file and call it something like "mygame", inside of this text file enter this:

@"base\hl2.exe" -game "%~dp0\Game"

10- Now save "mygame.txt" as a .bat, so now your mod/game will run once you run "mygame.bat", If you are interested in making an executable for your game then you can find a 'Bat to exe' converter and convert your .bat to a .exe so that you can run your game with an exe!

I hope this helped, if there are any problems, feel free to message me.

Now go make some source engine games!
:)

61 Comments
Batman 22 Jun @ 2:21pm 
I am Batman:steamhappy:
Crzy 12 Jan @ 5:19pm 
Correcting my last comment, it doesn't throw an error. it just loads a background image and quickly crashes. Is it something to do with the menu?
Crzy 12 Jan @ 5:17pm 
I'm getting an error after the "Powered By Source" screen. It closes the game and throws an error. :(
Xx_The0_xX 7 Dec, 2024 @ 2:10pm 
thx
MightyMawse  [author] 6 Dec, 2024 @ 5:47pm 
There is a git repo 'source-sdk-2013-ce' which is a cleaner version of the original source code, this version also allows you to use vs2022
MiPremix 4 Dec, 2024 @ 8:28pm 
I only had VS2022, could it works with newer VS?
Xx_The0_xX 24 Nov, 2024 @ 4:32am 
why old?
MightyMawse  [author] 23 Nov, 2024 @ 7:49pm 
visual studio 2013
Xx_The0_xX 21 Nov, 2024 @ 10:16am 
VS 2013?
🎄✪12kulnikita✪🎄 4 Oct, 2024 @ 10:43am 
i tried running the "mygame.bat" batch and nothing happened?