Chapter IV. Textures and Decals.

Working with textures and decals: types, WAD files, transparency, glowing surfaces, and sound textures.

4.1

What Are Textures and Decals?

From this article you will learn what textures and decals are, what textures are called in Half-Life, you will learn about standard texture files, as well as what size and scale is best to use textures on your maps.

1. Textures

1.1 What is texture?
Texture is a picture, a graphic image that is applied to the sides of objects. Thanks to textures, we distinguish a sandy path from an asphalt one, a wooden box from a block of stone, a brick wall from a rock, etc. Of course, simply repainting an object, for example, with the texture of a car, will not make it drive, just as a regular brush painted with the texture of a door will not open - to do this, you need to turn the brush into an entity object and set properties for it.
Also, textures, oddly enough, affect penetration objects. In the folder "Cstrike\sound"there is such a file materials.txt, which lists the names of some standard textures and the material type assigned to them (wood, metal, rock, dirt, etc.). It was experimentally found that objects painted, for example, with a metal texture penetrate worse than objects with a wood or rock texture. However, if the texture name is not specified in materials.txt (and this is what happens when using non-original, custom textures), then the penetration of all objects on the map will be the same, regardless of the applied texture.
1.2 Where are textures stored?
All textures for Half-Life are stored in the folder Valve. Maps for CS use textures from folders Valve And Cstrike. To store textures in Half-Life, files with the extension *.WAD are used. One such WAD file can contain any number of textures from one to several thousand, and maybe millions (we haven't checked :)
1.3 How can you view textures?
To view textures you can use the program Wally (you can also create your own texture libraries in it, i.e. WAD files). Textures can also be viewed in the Hammer editor, in the built-in texture browser.
1.4 What are the standard texture files called?
The word "standard" refers to those textures that are located in the Half-Life and CS folder after installing these games. It's no secret that map creators often use their own (or taken from somewhere else) textures. So these textures are not standard.
It turns out that the textures are from the folder Valve do not change and move from version to version. And here are the texture files for CS maps, which are in the folder Cstrike, may be removed or changed by developers. In principle, this is correct - if some official CS map was excluded from the list, then there is nothing to keep its textures for. Now imagine that your map used textures from this excluded WAD file...
After removing the WAD file from the standard game distribution, your card will not work. When the game does not find the WAD file that is used on the card, the card does not start and the game crashes with an error. And when some WAD file simply does not have the necessary textures, the map starts, but instead of the missing textures, black and purple squares are displayed. There is only one way out of this - include textures directly in the map (in the BSP file itself). But this is a topic for a separate article.
Below we provide a list of WAD files that are unlikely to ever be removed from the game and are therefore safe to use. You can use textures from these files and not include them in the map (in the BSP file). This will also slightly reduce the size of the map. After all, everyone has standard textures and it is unnecessary to transfer them along with the map.
  • halflife.wad — the main WAD file of the Half-Life game with a huge number of textures (more than 40 MB)
  • liquids.wad - water textures
  • decals.wad - decals (see below)
  • cstrike.wad - standard WAD file for CS
Also a large number of textures are in the directory Cstrike - these are the textures of official CS maps. For example, very good textures can be found in the following WAD files:
chateau.wad
cs_bdog.wad
cs_havana.wad
de_piranesi.wad
de_vegas.wad
itsitaly.wad
These are also standard texture files (since they are installed with the game), but there is no guarantee that at some point the maps, and along with them the textures, will not be removed from the CS distribution. That is why we recommend including textures from such WAD files as part of the BSP file of the map.
Remember, if you use textures from non-standard (your or any other) WAD files, then be sure to distribute them along with your map (in one archive). It's best to include textures from all custom files in the BSP map, but you can also create a separate WAD file.
Let's say you create a map and use textures from 10 non-standard texture files: 2 textures from the first, 2 from the second, 5 from the third, etc. So, for the map to start, all WAD files involved in creating the map will be needed. There is no point in distributing them all along with the map. We don't use all the textures from these files. So why increase the archive size? That is why it is necessary to create 1 WAD file and write down the textures used in it. And it's even easier and faster, we repeat, to include textures in the BSP file of the map.
1.5 Including textures in the BSP map file
Including textures in the map's BSP file means writing the textures directly into the map itself (without separate files). This eliminates the need to distribute separate WAD files along with the map.
Standard textures from the 4 WAD files listed above do not need to be included in the map. Everyone has these textures, and they are unlikely to ever be removed from the game. All other textures must be included in the map using special parameters during compilation. You can read more about how to do this in one of our next articles in this Chapter.
1.6 Texture sizes
The minimum texture size in Half-Life is 16x16 pixels. Less is not possible, more is possible. The maximum texture size typically used by mappers is - 512x512 pixels. We never saw more. We instruct you to check what will happen when using larger textures :) By the way, the length and width of the texture should be a multiple of 16, for example: 128x64, 256x192, 48x32, etc.
Usually, when applying texture, 1 texture pixel equate to 1 unit of object length. This is considered a normal scale, i.e. 1:1. For example, a texture with dimensions of 64x64 pixels should be applied to the side of an object with dimensions of 64x64 units or smaller (in this case, the texture is "adjusted" by the button Fit).
With a 1:1 blending scale, the textures look good. But if the texture is smaller than the size of the object, then in the game we will see some smearing, depending on the scale value. But sometimes, in order to save polygons, textures are specially applied with an increased scale of 2:1, 4:1, etc. You can read more about this in Chapter VI from the article about R_Speeds. There, this technique for dealing with "brakes" is described in some detail on the map.
If you pay attention to the sizes of textures in standard WAD files, then it becomes clear from them what size standard objects are: boxes, doors, walls. For example, very often there are textures of boxes with a size of 64x64 or 128x128 pixels, this indirectly indicates the sizes of standard boxes of 64x64x64 and 128x128x128 units. Of course, no one forbids using other sizes; it's just that boxes that are too small or too large (and any other objects in general) may seem unrealistic. The main thing here is to maintain the correct scale so that it doesn't turn out like on the maps from the series de_rats, although the idea is interesting :)
1.7 Texture scale
As we mentioned above, 1 texture pixel is equal to 1 unit of object length. This is a 1:1 texture mapping scale. If we apply a 128x128 pixel texture to a 64x64 unit box, then the scale will be 1:2 (or 0.5). If we stretch a small 32x32 pixel texture onto a 64x64 unit box, the scale will be increased 2:1.
The scale of textures is directly related to the number of polygons visible to the player when he moves around the map. The larger the texture scale, i.e. the more they are stretched, the fewer polygons the game engine processes, and the less the card slows down. In this regard, we recommend increasing the scale of textures in unimportant places (maybe mountains, ground, somewhere else).
Again, we recommend reading the article about R_Speeds from Chapter VI, it gives more specific recommendations for optimizing the map.
1.8 Texture names
Textures in Half-Life, namely in the main file of this game halflife.wad They are named for a reason. For example, the word "crate" or "crt" in the name of a texture means that the texture is for a box ("crate" in English is a box).
  • "crate" or "crt" - boxes
    "water" or "wtr" - water
    "ground" or "grnd" - earth
    "fence" and "grate" - fences and gratings
    "wall" - walls
    "light" or "lgt" - light bulbs or lanterns
We recommend that you name your textures in a similar way. This will allow you to quickly find the desired texture type in large WAD files. By the way, our mappers often name textures, for example: Zabor, Doska, Doroga - so, by textures, you can accurately determine the country of origin of the map :)
In addition to these words, there are certain prefixes (a set of 2-3 characters) that come immediately before the name of the texture, or rather make up the very first part of the name of the texture. These prefixes determine whether a texture belongs to a certain type. For example, a prefix in the form of an exclamation mark "!" means it is the texture of water; if at the beginning of the name there is a curly brace "{", then this is a partially transparent texture (i.e. a texture with a mask; used to create transparent fences, trees, etc.).
You can get the most detailed information about texture types from the next article in this Chapter.

2. Decals

Decals are special textures that can be applied on top of regular textures. Examples of decals are bullet marks on walls, traces of grenade explosions, traces of blood - in general, these are various types of traces. All decals are in the file decals.wad in the directory Valve.
Unfortunately, you can only use standard decals on your maps. Unlike textures, decals cannot be included in the map and you cannot use your own decals, so you have to be content with the standard ones from the decals.wad file, although they are not so bad.
4.2

Texture Types in Half-Life and CS

From this article you will learn what types of textures in Half-Life and CS are divided into, what they are called depending on the type, and you will also learn about the compatibility of textures of different types.
There are several different types of textures in Half-Life: simple textures, textures with a mask, liquid textures, etc. The type of texture is determined by its name, or more precisely, by the first few characters in the texture name. For example, all liquid textures begin with an exclamation mark "!", and textures for transparent fences and stairs begin with a curly brace "{" (more on this below).
Some textures cannot be applied to one object together with other textures, because... this causes an error, so it is extremely important to be aware of the compatibility of different texture types. There are also special textures that are used to create the sky, triggers, bounding planes, etc.
Types of textures:
  1. Regular textures
  2. Randomly overlapping
  3. Animated
  4. Switchable
  5. Glowing
  6. Textures with a mask or transparent textures
  7. Texture of water, liquid
  8. Scroll textures (moving)
Special textures:
  1. AAATRIGGER
  2. SKY
  3. CLIP
  4. ORIGIN
  5. HINT/SKIP
  6. NULL

PART 1.

1. Regular textures

The names of common textures begin with English letters (a-z, A-Z) or numbers (0-9).
Examples of common textures:
Example of a regular textureExample of a regular textureExample of a regular texture
Example of a regular textureExample of a regular textureExample of a regular texture
As you can see from the examples, ordinary textures can be very different: doors, floors, drawers, walls, ground, rocks. Basically, maps are painted with just such simple textures.
Textures, oddly enough, affect penetration objects. In the folder "Cstrike\sound"there is such a file materials.txt, which lists the names of some standard textures and the material type assigned to them (wood, metal, rock, dirt, etc.). It was experimentally found that objects painted, for example, with a metal texture penetrate worse than objects with a wood or rock texture. However, if the texture name is not specified in materials.txt (and this is what happens when using non-original, custom textures), then the penetration of all objects on the map will be the same, regardless of the applied texture.

2. Randomly overlaying textures

The names of such textures begin with numbers (from –0 to –9), with a minus sign. Then after the numbers there is a simple name.
An example of a series of two overlapping textures:
Examples of random texturesAn example of randomly overlaid textures
From the example you can see that textures from the same series are called like this: –0name, –1 title, –2name etc.
In general, these are also ordinary textures, as in the first case, only the game engine, seeing the "minus" in front of the name, applies them randomly (for example, the wall will be painted with different textures from the same series). They say this makes the map less monotonous - well, maybe so, but the size of the map increases significantly (if the textures are large). In general, the benefits of using such textures are questionable and are often not visible to the average player.
Requirements for such textures
Textures that are randomly overlaid should fit well together, i.e. each texture should be a continuation of the previous one and all neighboring textures (they also say: textures should be tiled, from the English tile - tile). Thus, when creating such textures, you need to achieve smooth transitions between the edges of the textures, i.e. There should be no visible seams.
Comment
On some older video maps, textures are not randomly applied. But this applies to OpenGL and Direct3D modes. In Software mode (and at best, 0.1% of players use it) everything will be fine. In general, there seems to be no problem if you don't take into account this 0.1%.

3. Animated textures

The names of such textures begin with numbers (from +0 to +9), with a "+" sign.
An example of a series of animated textures:
Examples of animated textures
Textures starting with numbers from +0 to +9 in the game are shown one after another continuously, thus creating animation. The simplest example of using animated textures is computer monitors (available on the map cs_militia, and Half-Life is full of them). Another example: a waterfall, when several successively changing water textures create the illusion of a water flow. In general, the thing is quite useful.
Requirements for such textures
Animated textures should fit well together, i.e. have the correct animation sequence.

4. Switchable

The names of the switchable textures begin with +A and numbers (+0 ... +9).
Example of a series of switchable textures:
Examples of animated switchable textures
The only difference between switchable textures and animated ones is the presence in the series of one texture starting with +A (see figure above).
Switchable textures can be used to create switches, buttons, switches and more. For example, the texture shown in the figure above can be applied to a small button, then when you click on it, the texture will change to the next one, and it will seem that the button was actually pressed.

5. Glowing textures

The names of such textures begin with a tilde "~", although in principle any texture in Half-Life can emit light, but more on that later.
Examples of glowing textures:
Examples of textures that emit light
Textures with a name starting with a tilde emit light only if they are written in a special file with the *.RAD extension. In general, you can make any texture glow, even without a tilde, the main thing is to write its name in the RAD file. This file is included during compilation and is used when calculating lighting from luminous textures.
By default, compilers look for information about glowing textures in files lights.rad or map_name.rad, but in principle you can name the RAD file whatever you want, only then you will have to specify this name in the compiler parameters.
You can read more about using glowing textures and creating your own RAD file in a separate article in this Chapter.
Possible problems and disadvantages
You should not overuse glowing textures on the map, because... they significantly (sometimes by several times!) increase the lighting rendering time. If you need to create some beautiful lanterns, go ahead, but don't make all the lighting with glowing textures. You should also be aware that more RAM is required to calculate lighting from light-emitting textures, and an error may occur when applying multiple glowing textures to one object.
Why then the glowing textures?
Indeed, many of you may ask: why use glowing textures if the compilation time increases, and you also have to spend time creating a RAD file?
It seems to us that the following picture clearly demonstrates "why":
Difference between using glowing textures (left) and a light object
As you can see from the picture, the luminous texture makes the lamp seem to really be on. But if you use a regular light source - the light object, then the sides of the lamp turn out dark.
By the way, there is another way to make an object glow. Only in this case it will not emit light at all, but will simply be bright. A significant advantage of this method over glowing textures is much lower compilation time.
Method: turn the lamp into an entity object (func_wall, func_illusionary, perhaps some other object) and set the parameter Minimum light level (sometimes found _minlight) to some value other than 0, for example, 0.5. Now the lamp will have minimum brightness. You will need to create a light source near the lamp light, because it itself does not emit light.
Note: to use the advice described above, you must have a new version of the FGD file (0.7.7 and higher) and ZHLT 2.5.3 compilers and higher.

6. Textures with a mask or transparent textures

The names of textures with a mask begin with a curly brace "{". With the help of such textures the following are created: stairs, fences, gratings, trees and other objects.
Examples of textures with a mask:
Examples of textures with a mask (transparent textures)
Such textures are called textures with a mask, because... the blue parts in the game will be transparent. For this to happen, you need to turn an object painted with a texture with a mask into func_wall, func_illusionary, func_breakable or another entity object depending on the purpose. Then you need to set the following display parameters:
  • Render Mode: Solid
    FX Amount: 255
You can read more about the display parameters of entity objects from the website section "Entity".
Possible problems
Often, when making such textures yourself, problems arise due to the wrong color palette. Transparent areas should be pure blue in the format R=0 G=0 B=255. It is also advisable to paint the object on all sides with the same texture. But in principle, it is possible to paint one object with different textures with a mask and also the SKY texture.

7. Texture of water, liquid

The names of liquid textures always begin with an exclamation mark "!".
Examples of liquid textures:
Examples of liquid textures
If you paint an object with a water texture, then you need to paint ALL SIDES of the object. Otherwise an error will occur.
In almost 100% of cases, the liquid texture is applied to the object func_water, which is actually used to create water. But you can apply the water texture to a regular brush. In this case, the game engine will automatically turn such a brush into water. However, such water will not move, it will not have waves and it will not be transparent - and in general it is no longer water :) It is better to make water a func_water object.
Water transparency is set in the object display parameters func_water:
  • Render Mode: Texture
    FX Amount: from 50 to 150 (optimal)
You can read more about the display parameters of entity objects from the website section "Entity".
Possible problems
All sides of the object must be painted in the same water texture! It is not allowed to mix regular textures with water textures. This inevitably causes an error when compiling the map.

8. Scroll textures (moving, scrolling)

The names of such textures begin with the word "Scroll". Moving textures are used to create conveyors, flowing water, waterfalls and other similar objects.
Examples of moving textures:
Examples of scroll textures
Any regular texture can be turned into a scroll texture; to do this, you just need to add the word at the beginning scroll. The first texture (in the picture on the left) can be used to create the illusion of a moving stream of water, and the second to create a conveyor.
It should be understood that the scrolling texture itself does not push the player, but simply creates the illusion of movement (a conveyor belt or a flow of water). In order for the conveyor to actually move the player, it is necessary to create an appropriate entity object.
Possible difficulties
It is necessary to empirically select the correct angle for applying the texture, because it can move, for example, against the movement of the conveyor or at an angle of 90°. Apply the texture to the conveyor, compile the map and check that the texture movement matches the direction the player is pushing.

PART 2.

Special textures

There are several special textures in total. Here are their names:
  • AAAtrigger
  • SKY
  • CLIP
  • ORIGIN
  • HINT/SKIP
  • NULL
You will use these textures (most of them) a lot. We recommend that you remember their names and carefully read about the cases in which they are used.
Also remember that textures CLIP And ORIGIN The object should be completely covered. They do not allow other textures to be present on the object along with them. All these textures are invisible in the game and are used in strictly defined cases. Read about it below.
It should also be noted that the appearance of the textures below may differ from yours.
The main thing is that the texture has exactly this (service, special) name. Those. if the texture is named AAATrigger, but it is not the same as presented here, then you can safely use it, there will be no error. The same applies to other special (service) textures. You can even make your own pictures for service textures and then use them when creating a map, you just need to give them exactly the same names.

9. AAAtrigger - texture for triggers

Used to create triggers and other brush entity objects that are invisible in the game.
Below is an image of the texture (may be different if using a non-standard wad file):
t5tex14 This texture is located in the main texture library of the Half-Life game - halflife.wad in the Valve folder. Used to create triggers and other brush entities that are invisible in the game. Examples of objects: trigger_once, trigger_multiple, trigger_hurt, trigger_push, env_bubbles, func_buyzone, func_bomb_target, func_ladder, etc. It is not recommended to use this texture for painting regular brushes, because this may cause an error.
Possible problems
This texture should be used ONLY to create triggers and other brush entities that are invisible in the game, but not for regular brushes. And yet, applying this texture to a regular brush does not make it invisible. Only certain entity objects will be invisible.

10. SKY - sky texture.

Used to create the sky. Brushes painted with the SKY texture (SKY-brushes) are created around the map, forming a kind of cap. When compiled using an object light_environment Light is projected with SKY brushes.
Texture image:
t5tex15 This texture is located in the main texture library of the Half-Life game - halflife.wad in the Valve folder. Used to create the sky around the map. All sides of the brushes that make up the sky should be painted with the SKY texture. If there is a point object on the map light_environment, this texture emits light. This creates general lighting on the map.
This texture can also be used to reduce the r_speeds parameter by applying it to those sides of objects that the player will never see in the game (roofs of houses, back sides of walls and fences, etc.). You can read more about using the SKY texture to reduce the "brakes" on the map in the articles: "Improved version of ZHLT Custom Build" and "All about r_speeds".
Possible problems
Problems can only arise if you use standard compilers (qcsg, qbsp2, vis, qrad) for compilation, and not ZHLT. When using older compilers, the player will be able to "fly" through the sky. To prevent this from happening, it is necessary to build CLIP brushes near the sky brushes. But since we use ZHLT compilers, there should be no problems with this texture and there is no need to create any CLIP brushes near the sky.

11. CLIP - restriction of player movement

Used to create invisible barriers (walls, other objects) that the player cannot pass through. However, bullets and grenades fly freely - this is a very important property.
Texture image:
t5tex16 This texture is located in the main texture library of the Half-Life game - halflife.wad in the Valve folder. Used to create walls, floors, etc. that are invisible in the game, through which the player cannot pass (fall). In mapping, the expression "CLIP brush" is common. CLIP brush is a regular brush, but painted on all sides with a special CLIP texture.
The Tutorial contains a detailed article on the use of CLIP brushes; it is assigned to Chapter VII.
Possible problems
The brush that restricts the movement of players must be painted with a CLIP texture on absolutely all sides, otherwise an error will occur when compiling the map. When using invisible limiting CLIP brushes in the wrong place, you can cause irritation to players - this is when you really want to go somewhere, but an invisible wall prevents you from doing so :) Therefore, use CLIP brushes wisely.

12. ORIGIN - determines the placement of the axis of rotating objects

Used to determine the axis of rotating objects (func_door_rotating, func_vehicle and many more etc.).
Texture image:
t5tex17 This texture is located in the main texture library of the Half-Life game - halflife.wad in the Valve folder. Used to create an ORIGIN brush (a regular brush, but painted on all sides with a special ORIGIN texture). The ORIGIN brush, with its center, defines the point through which the axis of rotation of entity objects passes: revolving doors, fans, platforms, pendulums. Also, the ORIGIN brush sets the center for a train, car, or rotating platform. In general, if an entity object rotates or rotates in any way, then it must have an ORIGIN brush.
ORIGIN brush must be included included in entity object, i.e. be an integral part of it. First, a brush of the desired shape is created (door, fan, etc.), then an ORIGIN brush is created (it should be placed in the intended location of the rotation axis), and then all together: both the brush and the ORIGIN brush are turned into an entity object, for example, func_rotating (fan). The same procedure must be followed when creating any rotating object.
You can read more about using ORIGIN brushes in the article: "Using ORIGIN brushes."
Warning
The ORIGIN brush must be painted with the ORIGIN texture on absolutely all sides. It is not allowed to apply any other texture together with ORIGIN. The ORIGIN brush must be part of the entity object, and not be separate. If one entity object contains two or more ORIGIN brushes at once, an error will occur. There should be only one rotation axis for each rotating object (it is defined in the properties of the entity object). The shape and size of the ORIGIN brush do not matter, the location of its center is important.

13. HINT/SKIP - map optimization, fps increase

This pair of textures is used to reduce the r_speeds parameter. You can read more about the use of HINT brushes in the articles from the "Map Optimization (R_Speeds)" section.
Below are images of textures (may be different when using different wad files):
t5tex18 You can make these textures yourself or find them in texture libraries zhlt.wad And zeditor.wad , which are included in the ZHLT utilities. Correct use of HINT/SKIP brushes helps reduce the slowdown on the map (i.e. increases fps).
In the game, HINT brushes are completely invisible and you can walk through them freely. It is not recommended to paint simple objects with these textures!
Possible problems
It is difficult to understand the principle of operation of HINT/SKIP brushes, and even more difficult to place them correctly on the map. Illiterate use can cause the opposite effect - increasing the brakes on the map. It should also be remembered that brushes painted with these textures cannot be painted with any other texture.

14. NULL - map optimization, fps increase

It is applied to the sides of objects that the player cannot see in the game, thereby reducing the r_speeds parameter and increasing FPS.
Below is an image of the texture (may be different when using different wad files):
t5tex19 This texture is in the texture library zhlt.wad , which is included with the enhanced ZHLT Custom Build utilities. NULL texture can ONLY be used with improved ZHLT utilities, that is, with ZHLT Custom Build. It doesn't work with simple ZHLTs. This texture can be applied to any objects (both brushes and entity objects). It is also allowed to combine this texture with other textures that allow this. By the way, you can successfully use the SKY texture instead of the NULL texture. The action is absolutely the same.
More detailed information about the NULL texture is in the article: "Improved version of ZHLT Custom Build".
4.3

How to Apply Textures and Decals?

From this article you will learn how to apply textures and decals, how to work with the texture panel, how to replace textures, and you will also learn about the main errors that occur when texturing a map.
Contents of the article:
  1. Textures panel
  2. Texture Browser
  3. Applying textures
  4. Replacing textures
  5. Texture usage statistics
  6. Basic mistakes with textures
  7. Applying Decals

1. Panel for working with textures

Now we will show in practice how textures are applied to objects. Let's launch the Hammer editor. Before starting work, we need to check whether our textures are connected. This is done in the menu "Tools/Options.../Textures". To get started, you can connect the following standard texture files: halflife.wad, decals.wad, liquids.wad, cstrike.wad (the first 3 are in the Valve folder, and the 4th is in cstrike).
Now let's create a new map [Ctrl-N] and select a tool for working with textures (a multi-colored cube). A panel for working with textures will appear on the right side of the screen. "Face Properties" (see picture below). The main functions of this panel are described in the figure below.
t5texpanel Scale (X/Y)
Texture scale along the X and Y axes (normal 1x1).
Shift (X/Y)
Allows you to more accurately adjust the texture and align it along the X and Y axes.
Justify
Various options for aligning the texture to the side of the object (along the left edge, in the center, along the right edge, Fit - adjusting the texture to the size of the side).
Rotation
Texture rotation angle (used when it is necessary to align the texture on an unwrapped object).
Align (World/Face)
Texture alignment method (World - relative to the coordinate axes; Face - relative to the sides of the object). These flags often fail. Sometimes it happens that they are marked at the same time, but in fact the texture cannot be aligned in two different ways at the same time. In this case, it is recommended to click on the desired checkbox again, just in case.
Texture group
WAD files with textures are shaved here ("All Textures" - textures are taken from all connected texture WAD files).
Current texture
The name of the current texture is shown here; slightly higher - its size in pixels; Below is a picture of the texture.
Hide mask
Clicking this button removes the red highlight from the side of the object. This button allows you to see the texture better.
Apply
"Apply" button - applies a texture to the selected side of the object (it's easier to use the mouse).
Browse
Launches the texture browser, where you can view connected textures and select the one you need. The texture browser functions are discussed below.
Replace...
Replacing textures. For example, when you need to replace one texture throughout the map with another.
Mode
The function of the left mouse button is specified here. We recommend installing: Lift + Select. In this case, the choice of texture will be on right button, and applying texture to left button.

2. Texture Browser

Let's look at the functions of the texture browser, where you can view connected textures and select the one you need. On the textures panel, click the button Browse.
t5texbrowser The window that appears displays all the textures connected to the Hammer. If in the texture work panel in the list Texture group If you select one WAD file, then only textures from it will be visible in the browser. This makes it easier to find the right texture when there are a large number of connected files.
To select a texture, you just need to click on it with the mouse and close the browser window. In this case, the panel for working with textures will display a reduced view of the texture, its name and dimensions in pixels. Now any created object on the map will be painted in this texture on all sides.
Size
The size of the displayed texture icons. There are four values: 1:1 (life size), 128x128, 64x64, 32x32.
Comment: when viewing all connected WAD files in the texture browser at once, the textures overlap and cover each other. This is an editor bug. This can only be corrected by setting a size other than 1:1, for example, 64x64.
Filter
Search for textures by name. For example, if you enter the word Crate, then the browser will display all textures whose names contain the word Crate. This filter function is useful for viewing textures of the same type, for example, with the word Crate textures of boxes will be displayed ("crate" - box), however, this only applies to the standard file halflife.wad, because in it the textures are sorted by name.
Another example: if you enter an exclamation point "!" (without quotes), then all liquid textures will be displayed in the browser, because Liquid textures have an exclamation mark at the beginning of their names. You can read about the different types of textures in Half-Life in the article Texture Types in Half-Life and CS.
Only used textures
Display in the browser window only the textures used on the map.

3. Applying textures

Now we will select a certain texture and apply it to an object, this will be a box.
In line Filter let's write bcrate09a (this is the texture of the box), close the browser window. Now we are building a square brush with dimensions of 128x128x128 units. You can read how to build a brush in the article How to Create a Brush, Entity, or Prefab?. Switch to 3D texured view, because... it is in it that the map is colored. It should look something like this (see picture below).
Brush painted with bcrate09a texture with dimensions 128x128x128 units
Moving in the 3D view is done by clicking on Z, then the buttons are used W, A, S, D and a mouse. To exit the moving mode, you need to press again Z.
Now check if you have selected the mode Lift + Select in the texture panel. If not, select it. In the 3D textured view, left-click on any side of the brush. The selected side will be highlighted in red; to remove this selection, click the button Hide mask in the texture panel.
The selected side of the brush is colored red
There are small multi-colored dashes in the center of the object's side (see figure below). They indicate that this side of the object is selected, as well as what type of alignment is applied. Click on the checkboxes World And Face. You will see the texture alignment change. World — alignment relative to common coordinate axes, and Face - relative to the sides of the object (useful for aligning textures on inclined surfaces). It's up to you to decide which type of alignment to use; it doesn't make much difference.
If you need to reflect the texture symmetrically, for example, when the door handle is on the right, and you need it on the left, then try clicking on the flags World/Face or enter a value with a "–" sign in the Scale field (for example, –1).
Dashes indicate that the side of the object is selected
Select any side of the brush and click on the button Fit in the texture panel. This button allows you to adjust the texture to the size of the side (a very useful thing :). If the texture is larger than the side of the object, it will fit, and if it is smaller, it will stretch.
Filling the entire side of an object with texture when the Fit button is pressed
Other buttons L, R, T, B, C align on different sides: left, right, etc. You can align or stretch textures with the button Fit on several surfaces at once. To do this, you need to select surfaces with the button pressed Ctrl.
Now click on the up and down arrows next to the word Shift. The texture on the object will shift along the X and Y axes (see figure below). This can be used to more accurately align textures.
Move the texture along the side of the object using the arrows in the Shift field
A field is used to change the texture scale Scale, which indicates the texture scale along the X and Y axes. The normal texture scale is 1:1.
Let's press the button again Browse, select a texture bcrate12. Let's paint one of the sides of the box with the right mouse button (we remind you that selecting a texture in the Lift + Select mode is done with the left button).
One of the sides of the brush was painted with a different texture
To paint all sides of an object with the current texture at once, you need to hold down Shift and then right-click on any side.
All sides of the brush can be painted over with the current texture in one click while holding down the Shift button

4. Replacing textures

Click on the button Replace... in the texture panel. A window will appear showing the texture that will be replaced on the left and the texture with which the selected texture will be replaced on the right. Use the button Browseto find the required texture.
t5tex27 By checking the box Hidden objects too, You can replace textures on hidden objects as well.

5. Texture usage statistics

You can find out statistics on the use of textures on the map through the menu Map/Show Information (see picture below).
t5tex30 This window shows the number of different textures, the total amount of memory required for textures, as well as a list of WAD files that are used on the card (sometimes extra WAD files appear in the list).

6. Basic mistakes with textures

Sometimes when loading a map, it looks completely white (no textures). This means that the required textures were not found. In this case, you need to check whether all WAD files used by the card are connected.
If you check the map for errors by pressing [Alt-P], then unfound textures will be detected as an error "Invalid texture (texture name)" Often this error occurs when you select one WAD file from the list, create an object, then change the WAD file to another and, forgetting to select a new texture, continue creating objects. The editor tries to find a texture with the old name in the new WAD file and, not finding one, creates new objects as white, without textures.
t5tex32 Error Invalid texture for the object on the left
If you are sure that all the necessary WAD files are connected, then to fix this error, select from the list Texture group paragraph "All Textures " Close and reopen the map. All errors should disappear.
If the textures are really missing, i.e. If you don't have the necessary WAD files, you can manually paint white objects with some other texture or by clicking [Alt-P], select item Fix or Fix all (of type).
Another error related to textures is the message "Texture axis perpendicular to face". Basically, this error occurs due to incorrect manipulation of the vertices (vertices) of objects, i.e. when the result is an irregularly shaped brush, but sometimes also due to applying a texture with too large a scale (scale > 10, and more often > 100).

7. Applying decals

Decals are special textures that can be applied on top of regular textures. Examples of decals are traces of bullets on walls, traces of grenade explosions, traces of blood - in general, decals are various types of traces. All decals are in the file decals.wad in the Valve directory.
To apply decals in Hammer, a special tool is used (a brown cube with a red target). Select it. In the textures panel in the list Texture group select decals.wad. If this WAD file is not in your list, then it needs to be connected to the editor. Then click the button Browse.
In the browser window you will see various black and white pictures - these are decals. In the game they will have a certain color (black, red, yellow, etc.). The white backing will be transparent. Select some decal :) and left-click on the side of the object (see figure below).
Decals are applied with the left mouse button
Decals are not just a texture, but a whole entity object that has some properties that are generally useless. Select the decal with the left mouse button (it can be quite difficult to do this in a 3D view; it is better to use some 2D view for selection). After you select the decal, click [Alt-Enter]. You will see a window with the properties of the decal, that is, the object infodecal (see picture below).
t5tex29 Name - decal name (no need to give it), texture — the name of the texture from the decals.wad file; you can change it if necessary (just don't forget to select decals.wad in the list).
4.4

How to Make Your Own WAD File?

In this article we'll show you how to make your own texture file to use on your map.
Very often, mappers create their own WAD files, which include textures from some other games or their own. A simple example where your own texture can be useful is creating a secret room (so-called Easter Eggs) with information about the map, about the author or about the people who helped make the map.
To create your own WAD file you will need a program Wally.
So, let's say we want to place a photo of our city on the map (see figure below).
Opening the image in Photoshop
The image for the texture must meet the following requirements:
  • The dimensions (height and width) of the image in pixels must be a multiple of 16
  • The image must be one of the following formats: BMP (256 colors), JPG, TGA, PCX, PNG
Both requirements are mandatory, i.e. you need to change the image dimensions so that they are completely divisible by 16 (for example: 256x256, 144x64, 128x64, etc.) and save the image in one of the listed formats. Remember that before saving a picture in BMP format, it must first be converted to 256 colors, otherwise Wally will not be able to open it. To make a 256-color picture, you can, in particular, in PhotoShop, in the "Image/Mode/Indexed Color..." menu, select "Local (Selective)" or "Local Adaptive" (in the Russian version: "Image/Mode/Indexed Color...", "Local selective"). Then save the image in BMP, 8-bit format.
If you save an image in JPG format, then it makes sense to set the image quality to the maximum so that there are as few losses as possible from compression.
Then we launch Wally. Create a new texture file for Half-Life (see figure below).
t5wad2 Copy the picture to the clipboard (for example, from ACDSee or IrfanView) and paste it into the newly created file: Paste (you can click Ctrl-E ). Save the WAD file under some name.
After the WAD file has been created, it must be connected to the editor. This is done in the menu "Tools/Options...", "Textures" tab. Now you can use your textures on the map.
It should be remembered that all non-standard textures (i.e. those that do not come with Half-Life and CS) must be distributed along with the map (in one archive), otherwise other people will not be able to run your map. When the map starts, Half-Life checks for the presence of all necessary texture WAD files. This problem can be solved in another way: by "including" (writing) a WAD file or several WAD files into the card itself (directly into the BSP file). This is done by certain parameters when compiling the map. You can learn about this from the next article in the Tutorial.
In principle, textures from official CS maps (for example: de_dust, de_train) should not be included in the BSP file of maps or in the distributed WAD file, because Everyone has these textures. However, there is some possibility that these WAD files may be changed by the developers or completely deleted, and then your card will not start. So, after all, it's probably better to include textures from these maps in your map - it's more reliable.
4.5

How to Include a WAD File in a Map?

In this article we will look at incorporating custom textures into the map using the official ZHLT 2.5.3 compilers and their improved version ZHLT Custom Build (there are some differences).

1. General case (for ZHLT and ZHLT Custom Build)

So, you have your own WAD file with textures. In order for other people to be able to run your map, you must either distribute this WAD file in an archive with the map, or include (write) it directly into the map itself (in the BSP file).
In general, WAD files are included in the map using the parameter –wadinclude wad, Where wad — name of the included WAD file without extension. This parameter must be added to the HLCSG compiler. Let's say on our map we use non-standard textures from the 123.wad file and want to include it in the BSP file. Then the HLCSG compiler launch line in the BAT file (we recommend using a BAT file for compilation) will look like this:
hlcsg.exe –wadinclude 123 "%mapname%"
If we have several WAD files, for example: 123.wad, 456.wad and 789.wad, then we must write a parameter for each WAD file -wadinclude, i.e. The HLCSG startup line should look like this:
hlcsg.exe –wadinclude 123 –wadinclude 456 –wadinclude 789 "%mapname%"
This is all that needs to be done to ensure that all custom textures are included as part of the map's BSP file. Remember that compilers and textures must be located on the same logical drive (for example, on C:\ or D:\). This method of including WAD files works with both the official version of ZHLT and the improved version of ZHLT Custom Build.

2. Including textures in the map when compiling with ZHTL Custom Build utilities

An improved version of the compilers allows for fairly flexible management of WAD files used to create the map.
1. Automatic detection of WAD files (ZHLT Custom Build only)
This simple feature allows you to connect any number of texture WAD files to the editor, and only the actually used WAD files will be included in the final BSP map file.
To enable this function, you need to add the parameter to the HLCSG compiler startup line –wadautodetect.
2. WAD configuration file (ZHLT Custom Build only)
WAD configuration file named WAD.CFG must be in the same directory as the compilers. This is a very convenient way to include the desired textures in the map.
Using the WAD configuration file, we can create for each specific card a list of texture files that are used on it. The list is given a name, then the paths to the WAD files are written down, and when compilation starts, the parameter is added to the HLCSG.EXE program –wadconfig name, Where name — any configuration name.
Below we provide the syntax of this file:
  • name
    {
    c:\111.wad
    c:\222.wad

    include c:\333.wad
    }
Where:
  • name — any configuration name. For convenience, you can use the name of the card for which this configuration is intended. For example, if the card is called de_dust7250, then you can write the configuration name de_dust7250to know which card this list is for.
    c:\111.wad — full path to the first WAD file
    c:\222.wad — full path to the second WAD file
    ....
    include c:\333.wad — path to the WAD file that will be included (word include) to the map. Word include should only be used for non-standard WAD files. And, for example, for standard WAD files such as: halflife.wad, cstrike.wad and other words include no need.
You can use an unlimited number of entries in this file. By the way, by the number of entries it will later be possible to calculate how many attempts to create maps were made (it's no secret that not every map is completed to the end :)
Let us remind you that before compilation you need to add the following parameter to the HLCSG.EXE compiler: –wadconfig name. In this case, textures written in the configuration will be used, but only textures with the prefix include will be included in the BSP file.

3. Path to wad.cfg file (ZHLT Custom Build only)

Parameter –wadcfgfile path allows you to manually specify the path to the wad.cfg file. By default, compilers look for this file in their directory and in the Half-Life directory. If wad.cfg is located in some other directory, then you need to add the parameter –wadcfgfile path to the launch site of the HLCSG.EXE compiler.
4.6

How to Make a Transparent Texture?

In this article we will look at creating transparent textures (or textures with a mask), which are used to create stairs, grates, fences, trees, etc.
It is very easy to recognize a transparent texture: it has a bright blue background (although sometimes in the program Wally a different background is displayed, but the last color in the color table is correct - bright blue); in the name of such a texture there is a curly bracket "{" at the very beginning.
To make the blue parts of the texture in the game transparent, we must use the mode for the entity object: Render Mode: Solid and FX Amount: 255, this is known from the article "Display parameters of entity objects".
The picture below shows a texture whose blue areas will be transparent in the game.
t5tex33 The main difficulties when creating textures with a mask arise from the shades of blue, which must be painted with pure blue (RGB: 0-0-255). We recommend painting in PhotoShop not with a brush, but with a pencil, because... it does not give shades of color. Look at the picture below:
t5tex34 On the left is an example with more shades of blue. In the game, such a texture most likely will not be transparent. On the right is the correct version of the texture, in which all shades of blue are filled with pure blue (RGB: 0—0—255).

Technique for creating a transparent texture

Next we present a somewhat tricky method for creating a transparent texture :) The fact is that all textures in Half-Life have a maximum of 256 colors (transparent textures are no exception). We can look at the color table in PhotoShop, where we can see what colors are used in the picture. In transparent textures, the last color (bottom right) defines the transparent background and it should be pure blue (RGB: 0-0-255).
Let's say we want to create a transparent texture from an image like this:
Texture with mask - Helicopter
First, you need to use a pencil to paint all the "transparent" areas blue (RGB: 0—0—255). Then you need to convert the picture to an indexed color (i.e. 256 colors) and see what number this blue color goes under.
t5tex361 Select "Local (Selective)".
t5tex362 Next, go to "Image\Mode\Color Table..." and look at what color we have blue under. It needs to go last - bottom right, if this is not the case - you need to change the palette.
t5tex363 As you can see, we were a little unlucky, and the blue color is in the 3rd square. Such a picture will not be transparent, even if we set the correct display parameters for the entity object.
Blue comes 3rd, but should come last...
The palette needs to be adjusted. Let's replace the 3rd color (now it is blue) with any other. And we'll make the last square (lower right) blue (RGB: 0—0—255).
Replace the 3rd color with any color except blue, and make the last one blue
As a result, our palette will look like this:
This is what the correct palette for a transparent texture looks like - blue is the last color
In this form we save the PALETTE, but not the picture (the "Save..." button).
ATTENTION! Now close the picture without saving it! At this stage we just needed to keep the right palette. After all, when we changed the blue color to another, the background of our picture changed to it.
Now open the image a second time and convert it to an indexed (256 colors) color. BUT THIS TIME we select the "Custom..." palette and load our saved palette.
Load the previously saved palette through the "Custom..." item.
After all these operations, the blue color will be the last one, which will ensure its transparency in the game. Save the image as BMP, 8-bit and paste it into a new document in the program Wallyto turn into a texture.
Remember that textures with a mask should be given names starting with a curly brace "{". Examples of names: {ladder1, {fence05, {grate37. Well, let us repeat once again that only an entity object can be partially transparent, but not an ordinary brush. For the entity object you need to set the following parameters: Render Mode: Solid, FX Amount: 255.
4.7

How to Extract Textures from a Map?

In this short article we will tell you how you can extract textures from a map if they were included in it during compilation.
Quite often, when compiling, mappers include textures as part of the map's BSP file. This is done using the parameter –wadinclude or –wadconfig (if a WAD configuration file and utilities are used ZHLT Custom Build). This reduces the total number of files required to run the map. Fewer files - easier to install the card. This is especially true when there are several texture files. All these files have to be copied into the "Cstrike" folder, and when you need to delete the card, you are unlikely to remember which textures are no longer used by any other card.
Also, including textures in the map helps a little to protect your original textures from illegal use. But really only "a little"... Everyone in this world steals from each other :) Therefore, there is nothing criminal if you use textures that have already been stolen before you (just kidding).
By the way, identifying a map with textures included in it is quite simple. If there are no WAD files in the archive with the card, this means one of two things: 1) or the card uses only standard textures (then there is nothing to take from it); 2) or textures are included in the map.

Extracting textures

To extract textures you will need a small console program Textract (30 KB, www.thewall.de).
We put the program in the same folder with the card, launch the command line (Windows-R or "Start/Execute..."), find our program with the "Browse" button.
Then we write, for example:
TEXTRACT.EXE  de_dust2.BSP  de_dust2.WAD
The output is a texture file with all the textures included in the map. By the way, it is possible that some textures will not be recorded correctly. Nothing can be done here.
4.8

Glowing Textures and RAD Files

Any texture in Half-Life can emit light. But for this it must be written in a RAD file (text type file). This file must be included during compilation. Creating such a file will be discussed in this article.

Why do we need glowing textures?

It seems to us that the following picture clearly demonstrates "why":
Difference between using glowing textures (left) and a light object
As you can see from the picture, the luminous texture makes the lamp seem to really be on. But if you use a regular light source - the light object, then the sides of the lamp turn out dark.
By the way, there is another way to make an object glow. Only in this case it will not emit light at all, but will simply be bright. A significant advantage of this method over glowing textures is much lower compilation time.
Method: turn the lamp into an entity object (func_wall, func_illusionary, perhaps some other object) and set the parameter Minimum light level (sometimes found _minlight) to some value other than 0, for example, 0.5. Now the lamp will have minimum brightness. You will need to create a light source near the lamp light, because it itself does not emit light.
Note: to use the advice described above, you must have a new version of the FGD file (0.7.7 and higher) and ZHLT 2.5.3 compilers and higher.
Returning to luminous textures, let's say that they can be used instead of light sources (light And light_spot), but you need to do this carefully and not get too carried away, because it is fraught with long (and very long) compilation time.
The light emitted by such textures is more realistic than when using the above-mentioned objects. The disadvantage of glowing textures is the restriction on their use: one object cannot have more than 8 different glowing textures, and it is also VERY undesirable to use many such textures on the map, because Calculating lighting will require more memory and compile time will increase accordingly. By the way, when compiling a map with glowing textures, the number of light sources is displayed incorrectly. There may be, for example, 1520 of them, when in reality no more than 20 or 25 of them were created. Glowing textures are to blame.
A RAD file is a regular text file with a *.rad extension. Let's look at the syntax of this file.
  • +0~GENERIC65 255 255 255 100
    +0~GENERIC86B 60 220 170 7500
    EMERGLIGHT 255 200 100 50000
Everything is simple here. Each glowing texture is described on a separate line. First comes the exact name of the texture, for example, EMERGLIGHT, then the next three numbers indicate the color of the emitted light in RGB format. You can select it in any graphic editor, at least in the usual Paint Brush. After the 3 color numbers, another number is placed indicating the brightness of the light. Brightness is determined differently than for light objects. As you can see, it can be 100 or 50,000 or even more.
When determining brightness, you should be guided by the size of the texture. For example, a texture with dimensions of 16x16 and a texture with dimensions of 256x160 at the same brightness will emit different amounts of light. If you need a small texture (used, for example, as a light bulb) to illuminate the entire room, then you need to set fairly large brightness values ​​(tens of thousands). To create a simple glowing advertisement, a small value (100-200) is suitable.

How to include a rad file during compilation?

By default, the HLRAD compiler uses information about glowing textures from files lights.rad And map_name.rad. Thus, in order for the texture in the game to emit light, you need to create a rad file with the name of the map (for example, the map is called mybest.map, then the rad file must be named mybest.rad), write the names of the textures into it, select the color of the light and its brightness for them, and place the rad file in the compilers folder. There is no need to do anything additional, i.e. There is no need to add anything to the compilers; they will find this file by name.
If the name of the rad file is different, then here you will have to indicate to the compiler HLRAD (namely, it uses the rad file) the name of the rad file. This is done using the parameter -lights. We write: -lights filename.rad. But in any case, the rad file must be located in the same directory as the compilers.
4.9

Sound Textures

This article will talk about how to make textures in Counter-Strike sound, i.e. When a player walks on different surfaces, so that the sounds of footsteps are different, the same goes for shooting: the sounds of hitting wood and metal should be different. This is what we will talk about.
The article (with some changes) is published with the permission of the author - PYaEe, http://www.cstrike.wallst.ru/. Thanks to PYaEe for the wonderful article!
First of all, it is necessary to say that in order for the texture to sound, its name must be written in the file materials.txt, which is located in the folder "cstrike\sound" The problem is that we cannot change this file and distribute it along with the map, because another map created by Vasya Pupkin has its own sounding textures, and he will also "update" materials.txt, which means that your textures will no longer sound.
There is a way out and it is quite simple. As we know, the Half-Life engine, when choosing a texture material, takes into account only the first 12 characters of its name. The maximum length of a texture name is 15 characters. This means we have 3 signs left. This is enough for any card - after all, using, for example, these three signs for numbers, something like this:
  • zvukitexturi001
    zvukitexturi002
    zvukitexturi003
...we can get 999 different textures of the same type of sound. But you can also use letters... So, these three characters are enough for us.
That is, we need to find in the standard materials.txt texture names that are 12 or more characters long. We leave the first 12, and the remaining 3 are at our disposal. We will make your task easier and tell you exactly what you need to name your textures:
(The asterisk means your symbol)
  • Tree: cstrike_CJ2B***
    Metal: cstrike_CE2X***
    Tile: cstrike_FH4W***
    Snow: only three options: snow; A_snow; znow1 (no name for the standard 12-character snow texture)
    Glass: GLASS_BRIGHT***
    Electronics: LAB1_RADSCRN***
    Dirt (sand, gravel): cstrike_FT2D***
    Ventilation pipe: There are no standard 12 character names - so either use the standard one or name yours exactly the same as the standard one.
    Liquid or liquid mud: the same.
At the same time, you do not need to perform any manipulations with materials.txt - neither edit nor distribute.
For mass renaming of textures, an image viewer will be very useful for you. ACDSee. If you have already made a lot of textures, convert them to BMP (with the Wally program), put them in some folder, then run ACDSee, select, for example, only wooden textures, click "Rename series", in the "Template" column write cstrike_CJ2B###, and "Start at" set to 000. Write down the original and future names of the textures and click the "OK" button.
Next, launch Hammer/Worldcraft and actively use "Replace textures"!
Important Note: textures will only sound if they are applied to BRUSHS. Textures applied to entity objects (func_wall, etc.) WILL NOT sound! So keep this in mind when creating, for example, a drawer with a wood grain texture. If you turn it into func_wall, then there will be no wooden sound when hitting the box...