My Half-Life 2 Mod Begins

My Half-Life 2 Mod Begins (Jerz’s Literacy Weblog)

I’ve finally knuckled down and started making a serious effort to teach myself how to create a Half-Life 2 mod.

A “mod” is a user-created expansion to a commercial game. Perhaps the most famous of these is Day of Defeat, a total-conversion mod that turned Half-Life (a sci-fi horror FPS) into a WWII military simulation. To get some sense of what it’s possible to do in Half-Life 2, take a look at A Few Good G-Men, which re-creates the famous “You can’t handle the truth!” confrontation between Jack Nicholson and Couch-Jumping Boy. (The example is not realy a game mod, but rather an example of machinima, but it really sold me on modding with HL2.)

I’ve got several ideas kicking around for what I might do, and my dean didn’t actually laugh in my face when I asked her whether it might be possible to get some release time to invest in this project. But for now I’m just trying to teach myself the basics, so that I’ll be able to introduce modding in this fall’s “New Media Projects” course.

Valve is the name of the company, and Steam is the delivery system. If you buy a copy of a Valve game such as Half-Life 2, it comes with a Software Developer’s Toolkit (SDK) that includes an editor for creating and coding 3D environments, and FacePoser — a tool for manipulating the facial expressions (and gestures) of the 3D characters that make up the Half-Life 2 world.

Last year, I put some time into learning the SDK for a competing product, Deus Ex. When I learned that the Deus Ex 2 game would not ship with an SDK, and that none was going to be available, I jumped ship. I did so reluctantly, because the Deus Ex mod tools included the Conversation Editor, a drag-and-drop tool that permitted the modder to assemble complex conversation trees. Since I’m a big fan of old school text adventure games (better known as interactive fiction) , most of the uses I can think of for mods involve at least some level of NPC interaction.

But Morgan Gordon (duh!) Freeman, the protagonist of Half-Life 2, is a man of action. He doesn’t speak at all during the game, and there are no dialogue-related branches (where the player is given the chance to say either “Yes, I’d love to clear the spiders from your basement for a paltry few coins,” or “Hand over all your gold and I’ll consider letting you live”).

I’m actually a little nervous about this choice. Since the Half-Life 2 SDK includes all the source code, I’m confident that it’s possible to insert some kind of interaction via a pop-up window, but I think I’d really need an experienced programmer to do that. At this state, I may just have to create translucent slabs with buttons on them, that float down from the ceiling and hover in front of NPCs whenever you need to make a choice. Maybe I could create my own custom weapons, named “A, B, C, D and E,” and the player could cycle through them and shoot at a floating icon of some sort.

MyMod1.pngI accomplished quite a few things on my “to do” list this weekend. I’ve created a simple room, lit it, applied some of the pre-fab textures (such as a stone floor and a brick wall), surrounded it with a skybox (a wraparound background image representing the sky and other distant scenery, on which all the 3D objects are placed), and put in a few props and NPCs (all of them used somewhere in Half-Life 2).

Since the educational mods I’m thinking about won’t feature any combat, I’ll need to modify the default behavior of the various NPCs. Eventually I’ll want to modify the appearance of the NPCs, but for the time being I’ll work with what I have.

I’ve carved a hole through a solid wall, though I haven’t yet figured out how to insert the pre-fab window frame into that hole. Pretty soon I’ll probably try to make a door that opens and closes when touched.

The set of textures that ship with Half-Life 2 are pretty grungy. Chipped cement, rusty pipes, dingy plaster. Deus Ex had a mixture of grungy and classy settings, so I felt like I was able to do a better job working on some of the corporate and civic interiors where I want to set parts of my mod.

I’m lusting after the courtroom set that’s featured in the “Few Good Men” experiment. I didn’t finish Half-Life 2 (I’ve been stuck in a damn pipe since June), so I don’t know whether that set’s part of the package, but I doubt it — I don’t see any of those nice woodgrain textures in my copy of the game.

So far, I’ve determined that FacePoser crashes my home computer, so I’ll have to try installing Steam at work and seeing whether I’ve got more luck there.

In addition to Valve’s SDK, I already had The Gimp (a free alternative to Photoshop).

I’ve got Audacity, a free sound-editing tool that I’ll try to use when I get to the stage where I’m recording my own original dialog.

While I’ve been pretty pleased with my g33k rating this weekend, I’m drawing a blank when it comes to how I got the SDK files to compile. I needed a C++ compiler of some sort (I think that’s this MinGW thing that’s on my desktop now… I didn’t want to use Microsoft’s .NET system if I could help it.) I followed some tutorial somewhere, and sadly forgot what I had to do in order to get it to work. I don’t remember struggling with it, though. I’ll pay more attention when I try to get it to work on my office computer.

I haven’t had much time to work with the 3D model tool Milkshape. I downloaded it last week and started fiddling with it, but got sick right away, so I can hardly remember what I did with it. It’s a 30-day trial product. I probably shouldn’t have downloaded it until I was really ready to create my own 3D shapes, but it was one of many things I tried in order to figure out what I can and can’t do on my home computer. I can place and manipulate simple geometric shapes like cubes and slabs, and I can arrange pre-fab items like trees or chairs, but if I want to create an object that I can’t find somewhere online, such as, I don’t know, a linotype machine or a memex, I’ll need to use this tool. Right now, I’ll happily work with whatever I can find (though part of me is just dying to create my own Enterprise bridge).

Along the way, I’ve installed a bunch of free utilities of various sorts, for file conversion and the like, but I don’t remember what they all were. I’m beginning to think that, rather than have my students compile this stuff up all by themselves, I’ll ask them to deliver things in chunks (a bitmap, a decorated room, some recorded lines of dialogue, etc.) and then we’ll do classroom workshops where I do the digital alchemy that gets the components to work together. Perhaps in an earlier class, we could together decorate the common areas. Then, I might let everyone decorate a virtual dorm room, and then I’ll stitch all those separate rooms together into a multi-player game map, and we can have a showcase day where the students show off their rooms. Next, I could let students create a portal from their virtual dorm room to a world of their own creation. Perhaps they should work in small teams, and we could have a design compet

ition of some sort.

Resources that I’ve found very helpful include Valve’s Getting Started tutorial, as well as tutorials at The Snark Pit. I’d love to see more of the textures at Wadfather, but I can’t seem to navigate the site very well.

I’m a bit annoyed with myself, since I want to focus on substance over style, but because the textures of Half-Life 2 depict a grungy, dingy world, I’m probably going to have to find a cleaner set before I feel comfortable with the design possibilities.