Source SDK

Source SDK

Недостаточно оценок
◤◢ Source SDK 2013 Setup Guide ◣◥
От Kat
This guide aims to show you how to set up a working environment for developing your own mod / game using the Source SDK 2013.
   
Наградить
В избранное
В избранном
Удалить
Welcome to the Guide!
This guide will walk you through the steps of making your very own functional mod with help of the Source SDK 2013.

In this guide we will set up Visual Studio 2013 along with the important Source SDK 2013.
You will have to download a lot so if you are not patient you should download the neccessary files over night so you do not have to wait.

Side note: Visual Studio 2015 will NOT work with Source SDK 2013!! I tried it myself and I could not get it to work any way possible not even when using the settings from VS 2013! You need Visual Studio 2013 for this guide! I am sorry if you have any other version of Visual Studio installed, but you will have to use Visual Studio 2013 here!
Requirements
What you will need to follow this Guide:
  • Visual Studio 2013 - The IDE (Integrated Development Environment) we will be using. Here[go.microsoft.com] is the link for the version we will be using.

  • A brain. obvious.

  • Multibyte-MFC Library for Visual Studio 2013 - Download link is here[www.microsoft.com].

  • Fixed Microsoft Speech API 5.1 - The Microsoft version has to be changed manually to work with this version of Source. I fixed it so you do not have to. You can thank me later, here is the download. (Update 2019-05-21: link is down, might've been down for some time, never got around to checking it, might edit in a working link again some time soon)

  • Source SDK 2013 - The next two sections will show you two ways you can acquire the source code.

  • Visual C++ Redistributable - This specific version is required for the afterwards mentioned Link Shell Extension. Download either the 64-bit version[download.microsoft.com] or the 32-bit version[download.microsoft.com] according to your system. If possible download the 64-bit version.

  • Link Shell Extension for Windows - This extension for Windows will help you a lot while developing your awesome game. It saves you time by making you not have to copy the compiled files everytime you want to try out your game. In a nutshell: You will start to like it very fast. Download it here[schinagl.priv.at].

  • Source SDK Base 2013 Singleplayer and or Multiplayer - You can get this through Steam. Hover over 'Library' in Steam and select 'Tools'. In there search for Source SDK Base 2013 and then download one or both of the SDK Bases. (You can also download the Deticated Server, but we won't use it anyways in this guide)

  • A functional PC with Windows if possible (I am trying to make a version for Mac and Linux, but right now I have no computer that can run anything at all with Linux installed. BTW I do have a Mac I just do not have the time to make a good guide for the platform)

  • Just a bit of prior C++ knowledge would be useful.
Getting Source SDK 2013 via GitHub Desktop
This part is actually pretty simple! (for once at last)

You will just have to download the GitHub Desktop app from the official GitHub site[desktop.github.com].






Just press 'Run' and 'Install' if you are asked to.












After installing you can just open up the GitHub repository for Source SDK 2013[github.com], press the green button with the text; 'Clone or download'









and press 'Open in Desktop' After that just wait for GitHub Desktop to open and then you are asked to select where to save the files. Just select some directory where you wanna store all your development files. Hit 'Ok' and let GitHub do its thing.
Getting Source SDK 2013 via ZIP-archive
It is even easier than using the GitHub Desktop app. You just have to press 'Download ZIP' on the GitHub page for Source SDK 2013[github.com] and extract the archive to the place you want to save your game development files in.
Installing Visual Studio 2013
After having downloaded the installer for Visual Studio 2013 from the link provided in the 'Requirements' section,






you just have to open the downloaded installer. Simple.









Just choose where to install Visual Studio 2013 (Side note: VS2013 will require a lot of space on your hard drive so be careful where you install it!), tick 'I agree to the Terms of Service' and you do not have to tick the second box, but you can (I usually leave it unticked). Then you press 'Continue' or 'Install' depending on your language you use. Then you will see a screen similar to the one on the right of this text. ONLY tick 'Microsoft Fundation Classes for C++', because you will not need anything else that is provided here. IF you want to install any of the packages later on just re-download the installer, open it, and press the 'Modify' button.

The next step is to press 'Install' on the bottom of the screen and grab about 8 and a half mugs of coffee (Well I drank that many I do not know if coffee is your thing so if you do not like coffee then, first of all wtf, but second of all just grab a tea or hot chocolate if that is more your thing)

## 1 1/2 hours later ##
(Thats how long it took for me, but it is hard to compare since I have a download speed of 7.5 Megabyte per second)

After the waiting game is over you should be greeted with a screen where you can log into a Microsoft account. You do not have to, but it will syncronize your settings over every computer aka. instance of VS2013 you log into. If you do not want to or you do not have a Microsoft account then just press the 'Not now. Maybe later.' link under the Login button.

NOW VISUAL STUDIO IS READY! good work.
Installing the Link Shell Extension
It is pretty simple just run the installer for the VC Redistributable FIRST!! This is very important that you do it in the right order!

Then after installing the VC Redistributable you just install the Link Shell Extension. I advise you to install it on your C:\ drive, because I had some issues with Windows not finding the program sometimes for some random reason when I installed it on a seperate hard drive than the C:\ drive.

Just press: 'Next', 'Next', 'Install' and then you will be asked to restart Explorer. Press 'Yes' or restart your computer, but just restarting Explorer is way faster in some cases.
Applying Speech API to the Source SDK
This is not very complicated just copy the sapi folder from inside the ZIP-archive you downloaded earlier to the following folders:
  • For singleplayer games
    <source-sdk-2013 directory>\sp\src\utils

  • and for multiplayer games
    <source-sdk-2013 directory>\mp\src\utils

Your complete utils directory should look something like this.







Foot note: Since you copied it to the source-sdk-2013 directory you only need to do this once for both branches (sp and mp) and then the next time you make a game just copy the appropriate folder and rename it to your games name or do it like I do and decide the name later and just name everything 'project01', 'project02', etc.
Copying files for your mod
For this step you need to be in your source-sdk-2013 directory. just saying.

Here you will find a folder called "mp" - for multiplayer mods - and a folder called "sp" - for singleplayer mods.

So if you want to make a multiplayer game; copy the "mp" folder to your desired work location. And if you want to make a singleplayer game do the same for the "sp" folder
Setting up the Source SDK 2013
After having copied either the 'sp' or the 'mp' folder and renaming it to something useful, you go into the copied directory and open the "src" folder.


For a game that doesn't need custom shader stuff and doesn't need to modify the engine itself you just need to run the 'creategameprojects.bat' and wait for it to finish. Then refresh the file browser by hitting the 'F5' key.


You should see a new file called 'games.sln'. Open it and wait for Visual Studio 2013 to update, parse and scan all files (As shown below).
Setting up debugging
After having opened up Visual Studio 2013 and letting it load everything you need to hold down 'CTRL' and select the following:
  • For a singleplayer mod in the HL2 engine you have to use "Client (HL2)" and "Server (HL2)"

  • If making a singleplayer mod in the HL2: Episode One/Two engine you are going to use "Client (Episodic)" and "Server (Episodic)"

  • If you are making a multiplayer mod you should have the projects called "Client (HL2MP)" and "Server (HL2MP)"

After selecting the appropriate projects you right-click one of the selected and go to 'Properties'.












Then go click the arrow left of 'Configuration Properties' and select 'Debugging'. After that go to the field 'Command', click the arrow in the right field, select 'Browse...' and then open either...







For singleplayer mods:
<steamapps directory>\Source SDK Base 2013 Singleplayer\hl2.exe







and for multiplayer mods:
<steamapps directory>\Source SDK Base 2013 Multiplayer\hl2.exe







In the next field below ('Command Arguments') you will can just copy the following code:
-allowdebug -dev -console -sw -w 1280 -h 720
This will start the game in windowed mode so you can see any errors showing up.




The next step is to copy do the same for the Release configuration. You can switch to the Release configuration in the top left of the properties window. Just click the drop-down menu that says 'Debug' or 'Active(Debug)' and change it to release. Now do the same as before. The exact same. After that change the configuration back to 'Active(Debug)'.



After that just press 'Apply' and close the window or just press 'Ok', but do not forget to save the changes.
Creating a Symbolic Link
You probably don't want to copy the compiled files everytime you change something. That's why you need the Link Shell Extension. It allows you to trick Windows to think that a symbolic link is a real folder.


To create a symbolic link you just right-click-drag the right folder into the sourcemods folder (eg. 'C:\Program Files (x86)\Steam\steamapps\sourcemods').
  • For a singleplayer mod in the HL2 engine you need to link out the folder
    <source-sdk-2013 directory>\game\mod_hl2

  • For a singleplayer mod in the HL2: Episode One/Two engine you link out the folder
    <source-sdk-2013 directory>\game\mod_episodic

  • For a multiplayer mod you just link out the following folder
    <source-sdk-2013 directory>\game\mod_hl2mp



How to make a symbolic link:
  • Hold down right-click while dragging over the folder for the project you want to make (see above).








  • Then select 'Drop here...' and then 'Symbolic Link'. Press 'Yes' if you are asked for Admin priviliges so the program (Link Shell Extension) can create a symbolic link.







  • Then you should rename the link to something useful so you know which mod you are editing. It can get kind of confusing when working on 2 mods at the same time.
Building the game
This is pretty easy to do. Just select both projects again, right-click and then hit 'Build Selection'. After that Visual Studio will compile the game for the first time. It will take some time tho.

This is a good point to restart Steam so the game shows up in your library.
If you restart Steam you should see a new game called 'My First Episodic Mod' or something in that general direction. Congratulations this is your game / mod.
Комментариев: 14
blackjacksike 26 янв. 2020 г. в 12:05 
Crap, it gave me an error. It said:

Assertion Failed: [LenIsChars or something like that] != 0

Then, I clicked 'Break in debugger', and the game closed.
blackjacksike 24 янв. 2020 г. в 15:52 
For the Speech SDK, you can go to Valve dev wiki, they have a working link. I can confirm.
Silenius 12 янв. 2020 г. в 6:04 
I read you can extract it using exe unpacker included in microsoft speech downloaded from microsoft. But didn't tested it yet.
Kat  [создатель] 10 янв. 2020 г. в 9:26 
Oh wait I'll check where to get the folder in a minute. I'll update the guide as soon as I find it ^^
Silenius 1 янв. 2020 г. в 14:21 
Anyone know where to get sapi folder ? Official download from microsoft has no sapi folder in it and google found nothing, because it is old and it is hard to find download.
delusion express 16 авг. 2019 г. в 4:28 
thank you alot
blackjacksike 22 мая. 2019 г. в 13:25 
*make sure you have .NET Core Server Compact 4.0 installed.

Sorry, I can't edit my post for some reason.
blackjacksike 22 мая. 2019 г. в 13:23 
By the way, I had a problem with VS2013. It would always lag horribly, i.e., that it was nearly impossible to move my mouse to build solutions. As idiot as it seems, it took me weeks to understand that I should have searched with the error message that appears when I'm leaving VS instead of just searching the tags "lag vs2013". For those who have the same problem, you need to make sure you .NET Core Server Compact 4.0 installed. If it is installed and that you still have the problem, uninstall it and reinstall it. I had it installed, the only difference was that it was named .NET Core Server Compact SP1 4.0. I uninstalled it and reinstalled the normal version (without SP1) and the lag disappeared.

Also, what are the advantages at coding with VS2013 on Source engine. I'm just curious about its functionalities.
Kat  [создатель] 22 мая. 2019 г. в 9:39 
I'd disagree personally. Sure you can only use VS to compile and link things easily but it would be a waste since it has a lot of good features that can be really useful when coding.
blackjacksike 21 мая. 2019 г. в 13:21 
I think VS2019 will be available to use when Source 2 comes out. But I'm not sure if you can use it for Source SDKs. Anyway, VS is mainly for building solutions. You can program with Notepad++ I think.