VERC: Custom Decals Last edited 22 years ago2002-09-22 01:55:00 UTC

You are viewing an older revision of this wiki page. The current revision may be more detailed and up-to-date. Click here to see the current revision of this page.

This article was recovered from an archive and needs to be reviewed

  1. The formatting may be incorrect as it was automatically converted to WikiCode from HTML, it needs to be revised and reformatted
  2. Some information may be out of date as it was written before Half-Life was available on Steam
  3. After the article is re-formatted and updated for Steam HL, remove this notice
  4. Please do not remove the archive notice from the bottom of the article.
  5. Some archive articles are no longer useful, or they duplicate information from other tutorials and entity guides. In this case, delete the page after merging any relevant information into other pages. Contact an admin to delete a page.
This beginner's tutorial will discuss how to make your own custom decals for
inclusion in your maps. Please notice that this is not a tutorial about
how to make your own spraypaint tag for use in multiplayer games. There are
plenty of tutorials about this on the web, so look elsewhere.

I am talking about the in-game decals that are placed manually in Hammer/Worldcraft.
Remember the various signs stenciled on the walls throughout Black Mesa, such as
"Processing Area 2" and "Explosives"? Such decals, when used correctly, can add
a great deal of atmosphere to a map. The stock Half-Life decals, contained in decals.wad , include all of those seen in-game; by placing them carefully,
you can pre-place bullet holes, scorch marks, arrows, and other markings with
ease.

However, when I begin to see the same set of stock Valve decals in many, many
different singleplayer mods, things begin to get old. Here's how to make your
own.

First of all, realize that unlike the spraypaint tag, custom decals must be
monochrome. Although this limits us somewhat, it allows for a very nice effect:
decal transparency, based on intensity of the applied color, so that you can
still slightly see the texture of the wall on which the decal is placed. Without
this effect, decals could look very fake:
lame.giflame.gif
Admittedly, there are some uses for flat decals like that, but you can tell
by looking at it that it doesn't seem to be stuck to the brick wall behind it -
almost as if we painted the words right on to the screenshot. In real life this
doesn't happen: paint applied directly to a wall inherits some of the physical
surface texture properties of that wall: bumps, grooves, ridges. (Flat decals
like the one above are best suited for use as clean text or diagrams on clean
backgrounds, but even then it is often useful to vary the intensity as we shall
see in a moment)

The decal must be 256 color, its palette constructed as follows: Pure white
(255 255 255) to pure almost black (1 1 1) in palette index 0 thru 254
respectively. The last palette color, index 255, may be whatever color you wish
the decal to be:
pal.gifpal.gif
To be sure that I am using the right palette, I import a palette from any of
the original Half-Life decals, then apply it to my decal after I have made it.
It is then simple to edit the palette and change the last color to be whatever I
wish.

Note: Sometimes, especially if you start with pure black (0 0 0) in
palette index 255, changing the last color will cause it to appear in places in
your decal. To fix this, change, within the picture, all pixels of this color to
the one just before it in the palette. Most graphics editors have a 'Replace
Color' function that will do this.

Draw the decal using the black and white and various shades of gray. In the
game, pure white will be transparent, and the near-black will be an essentially
opaque pixel in the color of the last palette index. Thus, the 'grayness' of the
pixel determines how transparent it will appear in-game. This gives the decal
the appearance of being stuck to the irregular texture of the surface beneath
it.

With the decal made, save it as a 256 color (8 bit) Windows bitmap (.BMP),
and make sure that you its filename begins with the character { (the left
curly brace). Example: {MYDECAL.BMP This indicates that the texture
within the bitmap contains transparency. Realize that this is set up somewhat
differently than the standard textures that contain transparency (the pure blue
color which is 100% transparent) because decals have variable transparency, but
the naming convention remains the same.

Now go to your Half-Lifevalve folder and copy decals.wad to the folder where
you are making your mod. Go into the properties of this new copy and make sure
that the "Read Only" file attribute is not checked. Otherwise, Wally will
crash when you attempt to insert the file. Fire up Wally, and insert this new
decal into the new decals.wad . Save and close, and you can now place your
decal in Hammer/Worldcraft. (Make sure that the 'Textures' setup in the Hammer
configuration points to the new decals.wad, not the old one in Half-Lifevalve.
Otherwise it won't appear in the texture selection window.)
graffiti.gifgraffiti.gif
graffiti2.gifgraffiti2.gif
Make sure that you include the modified decals.wad in the distribution of
your mod, or find some way to include the new textures, otherwise your users
won't see the decal (and may possibly have an error).

Having trouble? Make sure that all of the following are true:
  1. The decal palette is set up correctly.
  2. The decal is saved as a 256-color Windows bitmap.
  3. Its filename begins with the left curly brace. {
  4. It is placed into decals.wad , and is in the proper directory.
I hope that you have found this tutorial useful. Now get off the computer and
go outside for a while!
This article was originally published on the Valve Editing Resource Collective (VERC).
TWHL only archives articles from defunct websites. For more information on TWHL's archiving efforts, please visit the TWHL Archiving Project page.

3 Comments

Commented 3 years ago2020-11-18 21:31:11 UTC Comment #103051
I'm having a lot of unexpected trouble trying to edit half life's decals.wad
I was trying to translate the half life decals..
But i can't edit decals using wally..whenever i try to compile it, the game don't recognizes it
At first i tought the problem were the edited images
But then
even if i just export and recompile the original vanila decal files,the same problem happens
In the normal half life engine some decals just becomes invisible while others loses its transparency
In xash 3d all the textures loses its transparency(meaning its a big white box)
And i can't find any other apps like wally to edit wads,and wally is not working for me
I see a lot of people can edit decals no problem
Any ideas on what i am doing wrong?

Edit. Someone helped me out
Commented 3 years ago2021-06-01 22:38:48 UTC Comment #103584
It turns out that the only color in the palette that has any effect is the last one (it determines the overall decal color). All other colors are irrelevant - there's no need for black-to-white or white-to-black gradients, although gradient palettes can be useful for certain workflows, and helpful when viewing decals in Wally or Hammer. What really happens is that Half-Life uses the image data as an alpha channel, instead of a set of indexes into a palette.

WadMaker, a command-line wad-making tool that I made, can turn 32-bit images into decal textures if the output wad name is 'decals.wad'. It'll use their alpha channel to create the decal, and the average color of the image to set the decal color. To add textures to decals.wad, first drag decals.wad onto WadMaker.exe - this will extract all decal textures and store them as png files in a 'decals_extracted' folder. Rename the folder to 'decals', add your own images, then drag the folder onto WadMaker.exe - this will update decals.wad with your new images.
Commented 4 months ago2024-06-22 01:03:25 UTC Comment #106208
Curious about how the engine differentiates between monochrome and alphatest decals. I've seen (and used) decals that has full colour with the last index being the transparent colour, just like regular { textures. My working theory is that it checks that palette indices 0-254 are monochromatic (black→white or the reverse). If it's neither then it assumes alphatest mode. I think I've also seen decals.wad in the wild that have the palette indices 0-254 all zeroed out (i.e. black all the way), but I haven't loaded them in game and see how the engine interprets that decal.

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