Source SDK

Source SDK

66 ratings
Setting up a Source Engine 2013 Multiplayer mod
By Wazanator
A walkthrough for how to create a basic multiplayer mod for Source Engine 2013
   
Award
Favorite
Favorited
Unfavorite
Video Version of this Tutorial
Don't feel like reading or need a visual aid? Here's a video

https://www.youtube.com/watch?v=eD4BtIfYRfU

Join us on Discord! https://discord.gg/SourceEngine
Things You Will Need to Download

VISUAL STUDIO 2015, 2017, and 2019 DO NOT WORK DO NOT USE EITHER , but if you are experienced you know how to just use the 2013 compiler.

Once you have installed both Source SDK base 2013 Multiplayer and visual studio 2013 + MFC run both to make sure they launch before continuing.
Setting Up the Project Folder
Choose a location you want for your mod source files to be. This will serve as the location that you will keep all your files both WIP and final. This includes but isn't limited to maps, models, sounds, textures, scripts, code, etc.

Once you've picked out a spot create a new folder and name it your mods name.

Open up the source-sdk-2013-master.zip and navigate to source-sdk-2013-master\mp and copy both "game" and "src" into your folder.

NOTE: There can't be any spaces at all in the file path, I suggest putting it at the top of one of your drives

Example: C:/modname/src/
Compiling the Code
Inside of the src folder find and run "creategameproject.bat" this will then create the project file "games.sln"

Launch Visual Studio 2013 and open the games.sln project file.

Right click on "Solution 'games'" and go to properties.



Choose Configuration Properties then click Configuration Manager

For the Active Solution configuration choose Release


Click Close, then OK.

Right click on the games solution again but this time choose "Rebuild Solution". Wait for it to compile. If you did everything correctly you should get no errors. If you get an error debug it like you normally would, if you have never really coded before this means google the error and try and figure out why it broke on your own. Yes this might mean spending thirty minutes to an hour to figure out what broke. If you can't figure it out and you have put a good amount of time into trying to do it on your own post on the forums as well as other places like stack overflow.


Setting Up the Mod Folder
Navigate to Steam\steamapps\sourcemods and create a folder for your mod.

Go to your project folder and navigate into the game/mod_hl2mp folder.

Copy the gameinfo.txt, maps folder, and scripts folder from the mod_hl2mp folder into your mod folder.

Navigate to Steam\steamapps\common\Source SDK Base 2013 Multiplayer\hl2mp and copy the cfg folder, custom folder, and resource folder into your mods folder.

In your mods folder create a bin folder, materials folder, models folder, and sound folder.
The gameinfo.txt [IMPORTANT]
The gameinfo.txt is a very important file for your mod. It's what tells the engine what to call your mod in steam, the title to use on the main menu, what kind of mod it is, and most importantly what files to mount.

First thing you need to do upon opening it up is select everything and delete it. Then copy paste in the new text from either pastebin [pastebin.com]or ghostbin[ghostbin.com]

Now then if you want to mount additional content from a game like Counter-Strike: Source this is the file you do it in. Follow Valves example, in the case of CSS it would look like:

game "|all_source_engine_paths|cstrike/cstrike_pak.vpk"

https://developer.valvesoftware.com/wiki/Gameinfo.txt
The bin Folder
The bin folder is where your client and server .dll files will go from your compiled code

Navigate to src\game\client\Release_mod_hl2mp and copy the client.dll and paste it into the bin folder located in your steamapps\sourcemodes\modname

Same thing for server.dll
You're Done!
Restart Steam and your mod should now show up in your Steam library.

If you want to compare here's a finished version.[drive.google.com]

If you found this tutorial helpful and have $3 to spare I would love your support!

Support Me on Ko-fi[ko-fi.com]
Additional Notes
When people ask questions in the comments I'll update with answers here as well so that others don't run into similar issues 😃

"setup file 'gameinfo.txt' doesnt exist in subdirectory '<Directory To Sourcemod>". Check your -game parameter or VCONFIG setting."

This often means you have renamed the mod folder but haven't yet restarted Steam. Steam is still looking for the original folder.
35 Comments
Rasputin's Cheese 29 May @ 8:55am 
@SloppySlime ∫Զ #FIXTF2
Have you found a fix? I've been having the same issue.
SloppySlime ∫Զ 31 Mar @ 5:23am 
when I launch the mod, it displays the singleplayer ui (new game, load save) instead of the multiplayer ui (server list, create server). I don't know what's causing it
LMT | malooy bandit.camp 10 Mar @ 5:53am 
When I create a server the game crashes:steambored:
Armaturo 28 Oct, 2023 @ 8:55am 
Okay if you have "Could not load library client. Try restarting. If that doesn't work, verify the cache" make sure that:
You switched "Active Solution configuration" to Release
You moved client.dll and server.dll to bin folder
Armaturo 28 Oct, 2023 @ 8:41am 
same problem with crashing
seriy.serek 21 Jul, 2023 @ 5:04am 
help
when i start the game it displays valve intro and then crashes
it gives an error "Could not load library client. Try restarting. If that doesn't work, verify the cache"
Wazanator  [author] 9 Dec, 2022 @ 6:22pm 
@tax evasion, DVD version is fine.
jeralt 8 Dec, 2022 @ 2:02pm 
when i try to install visual studio i only have the option of dvd and not exe
Mr. Midex 1 Nov, 2022 @ 2:36pm 
does anyone know how to fix the player animations in HL2MP? coz players are tposing insted of walking
Goldermor 16 Sep, 2022 @ 8:47am 
Yes, I have already solved the problem
for some reason, steam did not recognize any sourcemods at all
I have installed standard Source SDK and now everything works