Welcome, Guest! Login | Register

Downloading and setting up the Half-Life SDK [Print this Article]
Posted by: Persuter
Date posted: May 20 2003
User Rating: 5 out of 5.0
Number of views: 11839
Number of comments: 7
Description: For VC++ 6.0 ONLY
Setting up the Half-Life SDK is very simple if you know how to do it, but unfortunately many people get stuck on it. This article will attempt to outline, in a step-by-step manner, exactly how to set up the Half-Life SDK. If you're already coding in HL, you can probably skip this. Rank beginners ONLY.

Step 1: The first step is, of course, to download the Half-Life SDK. As of this writing, the latest version was 2.3. This, of course, may have changed by now. Google for Half-Life SDK and download the "Source-Only" version. This contains only the source code. It comes in a small setup program. The only choice you will have to make is where to extract the files to. In this case I have chosen C:\projects\Tutorial SDK.

user posted image

Step 2: Now we have extracted the SDK to the folder. Inside that folder will be two folders: Multiplayer Source and Single-Player Source. Ignore Multiplayer Source (in fact, you can delete it if you want to). Single-Player Source is the full Single Player/Multiplayer source as it extists in the latest patched retail game.

(At this point, I would suggest copying Single-Player Source into a backup folder, so that if you want a clean SDK again you won't have to redownload it.)

Enter the Single-Player Source directory. You will find the following directories:

user posted image

dmc and ricochet are the sources for the Valve-produced mods Deathmatch Classic and Ricochet, respectively. You can ignore them. Most important are the cl_dll and dlls directories, which are the client and server code, respectively. common, pm_shared, and engine all hold code common to both projects. pm_shared is the physics code, and engine holds the headers for the interface to the HL engine.

Step 3: Now, open up your copy of Microsoft Visual C++ 6.0. (In my version there are a lot of buttons referring to Source Code Control. These will probably not be in your version. Other than that, the screenshots should look exactly the same as your screen. Note that this IS NOT Microsoft Visual C++ .NET.) Open the File Menu and click New. Now click the Workspaces tab. Type in the root directory of your SDK in the Location window. Then type in whatever name you want your workspace to have. Note that it will try to change the Location name. I changed it back, but you can put it wherever you want.

user posted image

Hit OK. Your screen should now look like this:

user posted image

Step 4: Right-click on the Workspace in FileView, and click Insert Project Into Workspace.

user posted image

Now navigate to the dlls folder in your sdk directory, and click on hl.dsp.

user posted image

Step 5: Your workspace will now have an hl project in it. Repeat step 4, but navigate to the cl_dll folder, and click on cl_dll.dsp. Your workspace is now complete:

user posted image

Step 6: Now we have to set up the project to deposit the compiled dll files in the proper directories. Stay in the Settings menu. Click on the Link tab. Now, on the left side, click on hl. Finally, type in the output file name. It should look like this:
user posted image

Step 7: Click cl_dll on the left side, and type in the client.dll's output directory and name:

user posted image

Step 8: Set up debugging as showed in omega's VS 6 debugging tutorial.

Step 9: Open the Build menu, and click Set Active Configuration. Click on cl_dll - Win32 Debug and click OK.

user posted image

Step 10: Hit F7. If all has gone well, a list of files will start coming up at the bottom of your screen as the client dll compiles. Finally, it will terminate with:

user posted image

If it has any errors or warnings, you have probably done something wrong (or you do not have the latest service pack of VS 6.0).

Step 11: Repeat Step 9, except select hl - Win32 Debug.

Step 12: Hit F7 again. Again you will see a list of files followed by:

user posted image

Again, if it has any errors or warnings, start over from the beginning.

Step 13: Skipped (13 is bad luck).

Step 14: There is no step 14. You're done! Dive into the SDK with vigour and confidence, now that you have mastered the arcane art of downloading and opening it.

Rate This Article
This article is currently rated: 5 out of 5.0 (9 Votes)

You have to register to rate this article.
User Comments Showing comments 1-7

Posted By: Aea on Aug 30 2003 at 22:54:29
Very good tutourial, thanks :)

Posted By: slackiller on Dec 06 2003 at 02:08:38
I liked it too :D

Posted By: gimpinthesink on Jan 11 2004 at 20:53:28
This is going to help me out heaps as I try to learn how to code

Posted By: Elemmire on May 14 2004 at 12:09:40
Thank you so much for taking the time to put this tutorial together - definitely the most comprehensive one available on the topic :o)

Posted By: Evic on Oct 13 2004 at 07:08:24
Awesome tutorial, I looked around for quite awhile before finding this tutorial. The only one I found for the current version of the SDK.

Posted By: Persuter on Feb 21 2005 at 05:28:44
A small addendum: This will only set up the SDK to build the debug versions. When you are ready to build a release version for your alpha, repeat steps 4 and 5, but change the "Settings For" combo box to "Win32 Release". Also, if you don't see the workspace view to insert your project, go to View -> FileView.

Posted By: j14rk1n on Jul 21 2005 at 19:17:22
Awesome tutorial. 5/5
Thanks for helping me set it all up :)


You must register to post a comment. If you have already registered, you must login.

Latest Articles
3rd person View in Multiplayer
Half-Life 2 | Coding | Client Side Tutorials
How to enable it in HL2DM

By: cct | Nov 13 2006

Making a Camera
Half-Life 2 | Level Design
This camera is good for when you join a map, it gives you a view of the map before you join a team

By: slackiller | Mar 05 2006

Making a camera , Part 2
Half-Life 2 | Level Design
these cameras are working monitors that turn on when a button is pushed.

By: slackiller | Mar 04 2006

Storing weapons on ladder
Half-Life 2 | Coding | Snippets
like Raven Sheild or BF2

By: British_Bomber | Dec 24 2005

Implementation of a string lookup table
Half-Life 2 | Coding | Snippets
A string lookup table is a set of functions that is used to convert strings to pre-defined values

By: deathz0rz | Nov 13 2005


Latest Comments
knock knock
General | News
By: MIFUNE | Dec 31 2017
 
knock knock
General | News
By: omega | Dec 22 2016
 
knock knock
General | News
By: MIFUNE | Oct 10 2015
 
New HL HUD Message System
Half-Life | Coding | Shared Tutorials
By: chbrules | Dec 31 2011
 
knock knock
General | News
By: Whistler | Nov 05 2011
 
Particle Engine tutorial part 4
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 18 2010
 
Particle Engine tutorial part 2
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 11 2010
 
Particle Engine tutorial part 3
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 11 2010
 
Game Movement Series #2: Analog Jumping and Floating
Half-Life 2 | Coding | Shared Tutorials
By: mars3554 | Oct 26 2009
 
Particle Engine tutorial part 5
Half-Life | Coding | Client Side Tutorials
By: Deadpool | Aug 02 2009
 

Site Info
297 Approved Articless
8 Pending Articles
3940 Registered Members
0 People Online (6 guests)
About - Credits - Contact Us

Wavelength version: 3.0.0.9
Valid XHTML 1.0! Valid CSS!