Software nerdchow.com

Client class diagram
Server class diagram
Smoke grenade tutorial
Philosophy

a ceejbot project

Check out Planet Half-life

Half-Life mod development

There are a dozen sites already about Half-life mod development. Why this one? Because the code "tutorials" on those other sites are not written for programmers. They're written for non-programmers who want to tinker with mod code without understanding it. As I explore the Halflife mod SDK, I want to take notes that would benefit other programmers also beginning to explore the SDK.

In a previous life I wrote documentation for developers, so the task is within my grasp. I'd rather spend time actually contributing to the development of some mod, though, so lord knows how far I'll get.

My first comment: the SDK partly a framework for mods, and partly an example of a mod. It's Half-Life Death Match. Much of the code you'll probably never touch-- the platform and trains code in plats.cpp, for instance. Other parts you'll need to rip up into your own framework. For instance, much of what you'll need to create your own "vgui" (Valve's word for those good-looking semi-transparent panes and buttons that appeared with TF1.5) is buried in the implementation of a Team Fortress-specific menu system.

Tools

You'll need an IDE. Most people use Visual Studio. Botman has some instructions for building with Borland's compilers and other tools.

Because I can't stand Visual Studio's user experience, I ported the code to Codewarrior on Macintosh, which can cross-compile for Windows. (This was mostly the same kind of work porting to Linux involves: C++ dialect cleanup.) I haven't tried to make it link yet, but just rely on VS C++ to do that. Because Microsoft, as usual, attempts to embrace and destroy a language by implementing undocumented extensions, it's not clear the Codewarrior is able to create a DLL that will work with Halflife at all. It's a comfortable environment for editing, though, which is all I really need from it.

You'll also want to keep the server part of your mod building on Linux. There's no reason why you can't have the same source base building on both platforms at all times. Port once, learn to avoid the old language syntax that Microsoft still allows, and your Linux server will be ready to release on the same day as your client. To get it compiling, though, you will have to jump through some hoops. You will need to build an older version of EGCS: EGCS-1.1.2. For more information, see the very bottom of the "compiling on Linux" page linked to below.

Getting started

Read Shadowman's intro to the SDK.

The client.dll and mp.dll class treess, as generated by Codewarrior:
client_class_diagram.png
server_class_diagram.png

There are some of my own classes in the diagrams (anything with CSpec in the name, mostly). I hide the weapons classes in the server to get the diagram down in size.

Tutorials

I wrote a quick smoke grenade. You might want to use it. It's a nice example of how to do missile weapons in HalfLife.

Links of use:

Half-life programming planet's tutorials
Half-life programming main page
HL coding index
Wavelength tutorial list
Basic mod faq and link list
MOD faq
Shadowman's SDK2 intro: good info
botman's bots: source for a simple bot
half-life programming bbs
Compiling the SDK on Linux
Phineas Bot: more links
Half-Life SDK2
The Open-Source JailBreak Project


Top | Blog | Journal | Software
Part of the world wide web since 1994. Made with Macintosh.
Copyright 1994-2008 C J Silverio.