VERC: Embedding Textures into a Map Last edited 15 years ago2003-01-23 22:31:00 UTC by Penguinboy Penguinboy

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.

Introduction

Half-Life stores textures in external files called wads. These wad files are then accessed at runtime, when the map is loaded into memory. When a new map is loaded, Half-Life looks for the wad files in the valve directory (for standard Half-Life maps, HL only looks here), and in the particular mod's directory, if applicable (for example, Opposing Force texture wads can be in either the valve or gearbox directories).

When custom textures are used in a user-made map, Half-Life needs to reference the custom textures in order to successfully load the map. These custom textures can either be distributed in a new wad file(s), or embedded into the map (the .bsp file) during the compiling process. Embedding textures into a custom map will increase the size of the bsp file itself, but there are a couple of reasons why an author may want to compile the custom textures into the map: There are two options for including textures in a bsp file: -wadinclude (the preferred, controllable option) and -nowadtextures (the easy, sloppy option), described below. Keep in mind that both options only embed used textures.

-wadinclude

This is the better, more flexible choice for embedding textures into your map. It is only available if you use Zoner's Tools (Link: index.php?go=zhlt) to compile. It allows you to specify a particular wad file from which to embed textures into your map. This only embeds used textures from the wad file(s) specified.

Essentially, -wadinclude is the preferred option to embed textures because it is more controllable and doesn't unnecessarily inflate file size by embedding textures that everyone already has, in contrast to -nowadtextures.

Using -wadinclude

All examples below assume that custom.wad is the name of the texture file that you want to embed, and yourmap is the name of your map file. So your Parameter box on hlcsg should read: $path$file -wadinclude custom
wcembed1.pngwcembed1.png
So your hlcsg line should resemble: hlcsg.exe -wadinclude custom yourmap

Important notes on using -wadinclude

  1. Make sure you are using Zoner's Tools (Link: index.php?go=zhlt) to compile.
  2. It is unnecessary to fill in the entire path to your custom.wad, and in fact this can cause problems, at least when using TBCC. I recommend just typing in the name of the wad file, without the path, and without '.wad' on the end.
  3. You should always check out your compile log to make sure that the necessary textures were embedded from the wad(s) you specified. Look at a portion of my hlcsg example compile log (using TBCC), with the important line highlighted:
--- BEGIN hlcsg ---

Command line: F:WORLDC~2HLCSG.EXE -wadinclude sandblast -nolog F:Worldcraft3maps-op4sandblast24.map

(edited for space)

Using WAD File: sierrahalf-lifevalvehalflife.wad

Using WAD File: sierrahalf-lifegearboxopfor.wad

Using WAD File: sierrahalf-lifegearboxdecals.wad

Embedding textures from WAD File [worldcraft3sandblast.wad] into BSP

Using WAD File: sierrahalf-lifevalveliquids.wad

added 26 additional animating textures.

Texture usage is at 1.64 mb (of 4.00 mb MAX)

87.44 seconds elapsed [1m 27s]

Make sure every wad that you wadinclude is listed like the above highlighted line.
  1. The -wadinclude parameter is case-insensitive and can match partial filenames and even directory names . This is a very powerful feature that you should take advantage of. This is the easy way to embed multiple wad files using -wadinclude, instead of using multiple -wadinclude parameters. For example, if you name your custom wads custom1.wad, custom2.wad, custom3.wad, etc., all you need is to add '-wadinclude custom' and all these wads will be embedded because of partial filename matching. Or, you could just drop all custom wads you want to use into a special directory, e.g. into sierrahalf-life extures. In this case, add '-wadinclude textures' and all the used wads in that textures directory will be embedded because of directory name matching.
To further clarify this point, refer back to my hlcsg compile log above. Note that the command line at the top has -wadinclude sandblast to embed my custom file sandblast.wad. But I could have just as easily used any of the following with identical results:

-wadinclude sand

-wadinclude BLAST

-wadinclude world - because my sandblast.wad is in my f: world craft3 directory

What this feature also means, if you use it correctly: You'll never have to manually combine wad files using Wally to get your -wadinclude down to one wad.

-nowadtextures

This is the original option for compiling textures into the bsp file. It simply embeds all used textures from all used wads into the final bsp. This was an option on Half-Life's original compile tool qcsg.exe, and was retained in Zoner's compile tools (Link: index.php?go=zhlt) .

Zoner's (Link: index.php?go=zhlt) documentation claims that -nowadtextures has been rendered obsolete by the -wadinclude option, but -nowadtextures is actually still quite useful, because of its simplicity. It is overkill, though, since it will embed every single texture used in the map. Obviously, it is unnecessary to embed textures that everyone has, such as those from halflife.wad, liquids.wad, and xeno.wad. But if you are using a number of non-standard wads in your map, -nowadtextures is a quick (and dirty) way to ensure that players who download your map will not have to download extra texture wads in order to play your map.

In summary, -nowadtextures unnecessarily inflates the size of the final bsp, but it is quick and easy to set up and use.

Using -nowadtextures

All examples below assume that yourmap is the name of your map file. So your Parameter box on hlcsg should read: $path$file -nowadtextures
wcembed2.pngwcembed2.png
So your hlcsg line should resemble: hlcsg.exe -nowadtextures yourmap As you can see, -wadinclude is the more powerful and more useful option to embed textures into your map, while -nowadtextures is the quick, easy method. Please pay particular attention to the Important notes on using -wadinclude section above (especially #4), as these tips can help you to take advantage of the flexibility available with -wadinclude.
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.

Comments

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