Tutorial: Custom Textures Last edited 2 months ago2024-09-03 17:43:29 UTC

Download attachment

There's a limit to what you can do with only the textures provided with Half-Life. Brand new maps quite often need brand new textures, but how do you do that?

What you Need

You could, of course, find the textures you need on the web, but it's always more exciting to make your own. If you do plan to download all your textures, they'll probably already be in WAD format, so you can skip the next couple of stages.

First, you need to know what type of texture you're looking for. What style must it blend in with? Is it for indoors or out? Must it tile or be single? Tiling textures are the kind that are used for structures like walls, rock-faces, terrain, glass etc. while single are used for more specific objects like vehicles, vending machines and buttons. Both require a bit of work to get right.

You'll need a few tools as well, aside from WorldCraft. An image editor is first. Jasc's Paint Shop Pro will do, although you might have problems with fixing up tiling textures (see below), but your best bet is Adobe Photoshop, providing you can (and want to) afford it.
At time of writing, Valve Hammer Editor (VHE) was still called WorldCraft. Nowadays J.A.C.K. is the go-to editor for Half-Life and GoldSource. J.A.C.K. is functionally very similar to WorldCraft/Hammer and the instructions for latter should easily be adapted for the former, but where there are notable differences, this green note will pop up again later.

Photoshop is still Photoshop, though.
Then you'll need a WAD-editing program. Wally is about the only one anybody's ever heard of, so get that ( here).
A better tool has come out since the writing of this page, namely Wadmaker, which can create WADs directly from a folder of images (and also Photoshop .psd project files!)
Official website

Making your Texture

As an example, I made my own (rather cheap) tiling wall texture out of a photo. Let's have a look at the process:
Stage 1: The SelectionStage 1: The Selection
Stage 2: The FlipStage 2: The Flip
Stage 3: The ResultStage 3: The Result

WADing it Up

So, having completed your texture, what do you do with it? Half-Life needs all its textures to be in WAD3 format. WADs are just... yes, wads... of textures, and the idea dates back to Doom. Quake uses WAD2, and Half-Life has a modified version of that, WAD3. WAD3 format allows each texture to have its own 8-bit palette. This just means that each image is stored in 256 colours, and those colours can be anything (as opposed to WAD2, where the palette is the same for all textures in the WAD, restricting the variety of texture colouring).

Putting your textures into a WAD is where Wally comes in. Although Wally is capable of doing some basic image editing itself, you'll probably find the only useful extra feature is being able to see your texture tiled (you can do this in regular image editors, but perhaps less easily).

All you need to do is copy 'n' paste. Pasting into Wally will let you choose the file type. Select 'Half-Life Package', and it will create a new WAD and put the texture into it. To add subsequent textures to the WAD you are working in, press Ctrl+E. Double-click a texture to edit it, and press Ctrl+T in this view to see it tiled. + and - zoom in and out. When you're done, save the WAD anywhere you like (although it will need to be in your Half-Life\valve folder if you plan to use Method 1, below).
If you're using Wadmaker, the entire process described here is replaced with a single drag-and-drop of the folder icon onto the Wadmaker.exe icon in Explorer.

As for viewing image tiles, Half-Life Texture Tools can do it (though Wally remains the only one that can also randomly tile the -0 textures.)

Using your New WAD

Here's where it gets more exciting. Open WorldCraft, go to Tools -> Options, and click the Textures tab. Click Add WAD, and browse your newly-created WAD file. Close the Options window, and you will find that when you create a new map your custom texture(s) will be at your disposal.
In J.A.C.K. the texture list is stored per game configuration vs. globally in WorldCraft/Hammer. The texture lists are in Configure J.A.C.K. > Game Profiles > (select the game profile) > Textures.

Working with WADs

Method 1

The simplest way to work with custom textures is to put the new WAD with all the default ones in your Half-Life\valve folder. In this case any maps using the custom WAD will simply call it like they would the default ones. The advantage is that BSP file sizes are kept to a minimum, but the disadvantage is that anyone could open the WAD and take the textures. So where would you use this method? Well, the Half-Life multiplayer maps all use it, because it's possible that clients may have to download a map on connecting to a server, and downloading a bunch of textures they already have is a waste of time. So as long as the client has the required WADs already, it all works great.

Method 2

This method is a little more complicated, but it's better for some situations. It involves embedding the used textures into the final BSP file, which increases the size of the BSP somewhat, but means you only have to distribute that one file. The single-player maps in Half-Life all have their textures embedded in this manner. You will need to use either of two command-line arguments to do it:
The single-player maps in Half-Life all have their textures embedded in this manner
Is only true for the first few chapters. Later chapters fully relies on external wads.

Including the Textures

Method 1

This is the simplest way, which works with both the default WorldCraft compile tools (the ones you get with WorldCraft), as well as with Zoner's Compile Tools (what real mappers use :) - they're free anyway. Go get them!).

When you're ready to test your map, press F9 or click the Run Map button (as usual), but then click the Expert button at the bottom (doesn't that make you feel cool?) and you should see a list of commands to the left. Find the one that is similar to C:\program files\worldcraft\qcsg.exe (or hlcsg.exe if you are using Zoner's Tools), click it, and add -nowadtextures to the end. Your box should now look something like the one below:
Compile optionsCompile options
What this does is put every texture that is used in the map, not just the ones from your new WAD, but the ones from all the other WAD's, into the BSP. While it is simple, it's also a little sloppy, so only use it when you want a quick and easy single-file distribution. It's sloppy because there's no control over which textures are included, so even ones everyone has will be there. The better method is...

Method 2

...-wadinclude, but this one does not work with Valve's compile tools, you need ZHLT, VHLT, or another custom compiler. Instead of putting all of the textures used in the map into the BSP, it only includes the ones from the WAD(s) you specify. In other words, you can tell it to include only the custom textures that you created. To use it put -wadinclude <wadname> as your CSG parameter, where <wadname> is the name of the file. You don't need the extension or path (these will be taken from WorldCraft). So your Parameters box should say something like this:
$path$file -wadinclude mytextures
To add more than one wad file to your .bsp, all you need to do is add another -wadinclude command
$path$file -wadinclude mytextures -wadinclude mytextures2
and so on...

Yes, you have to use the -wadinclude prefix for every new wad that you want included.
Editor note
-wadinclude matches any part of the path to the WAD file. You can, for example, have all your custom wads in a folder named custom and use -wadinclude custom to match any WADs placed there used in the map. Now you don't have to -wadinclude every single WAD file.
That's about it. Using either of these parameters, you will get a single BSP file at the end that will work by itself.

Hopefully you'll now be able to incorporate custom textures into your maps. Experiment with texture design, as it's obviously the most challenging bit of this to get right. And remember, there are plenty of free custom textures available on the web, if you aren't up for this art thing :)

The example map includes a custom WAD for you to look at. To see it in the map you'll need to add it to WorldCraft's list, explained above.

4 Comments

Commented 7 years ago2016-12-18 05:32:36 UTC Comment #100529
Insanely useful, but the link for Wally is broken, any idea of updating it soon?
Commented 7 years ago2016-12-21 21:46:03 UTC Comment #100530
Google is your friend, or http://gamebanana.com/tools/4774
Commented 3 years ago2021-07-05 09:13:03 UTC Comment #103600
For some reason, even after doing -nowadtextures as well as -wadinclude. After I compile my map, remove the wad file from the valve directory, and load up the map again just to see if it works without requiring the wad file, it doesn't. Please help, I've tried searching on many sites and they all tell you the same thing and it never works.
Commented 3 years ago2021-07-14 14:51:21 UTC Comment #103610
@StanleyLikesCyan:
For me, this works to really embed textures into a bsp file:
-wadautodetect -wadinclude "..."
I'm not using "-nowadtextures".
This is using the "Vluzacn's ZHLT v3.4" tools. :)
Hope that helps!

You must log in to post a comment. You can login or register a new account.