Terms a mapper use:- --------------------
- Map/world:- The playable area of the game that consists of all the sounds, textures, geometries, interactive things (like doors and lights) etc.
- brush:- Non interactive geometrical 3-D shapes with volume greater than zero are referred to as brushes. These are the main components of a map. Brushes could be blocks, wedges, cylinders, arches, spikes etc. Valid brushes are convex.
A brush (or a group of brushes) can be tied to an entity to form brush entity that can interact.
It is important to note that two or more faces/sides of the same brush can not lie in the same plane.
Also Goldsrc Engine do not support brushes having more than 32 faces each. So, if you want to make a brush (lets say cylinder) with 34 faces, you may divide it along its diameter with the Clipping tool into 2 semi cylinders, so now they will be considered 2 different brushes with 17 sides each.
- Entity:- These are the interactive bodies (exeption:- func_wall) that play a characteristic role in the map. For example, a door (func_door, func_door_rotating), lights (light, light_environment), water (func_water), a ladder (func_ladder) etc. Entities are of two types,
- Point entities:- like info_player_start, light, light_environment, ambient_generic (used to play sounds in map) etc. They are point sized and are not associated with any brush.
- Brush entities:- The entities that are associated to a brush (or a group of brushes) thereby making that brush(s) interactive. These entities are created by creating a brush (or more than one) of desired size and shape and then tying it to an entity. For example, doors could be of different shapes and sizes, so we create a desired shape of door and tie it to func_door (or func_door_rotating). Other examples are trigger_once, trigger_multiple, func_ladder, func_water, func_buyzone etc.
- Leaf:- Leaves or Visleaves are convex 3D volumes created when BSP tree is built. These volumes are defined by, and lie in between static world brushes. At any given time when you move around your map, you are inside one or more of these BSP leaves. Knowing which leaves you're in, engine draws only those objects that are in your current Potential Visibility Set, PVS for short. PVS is made of all leaves that you are inside plus all other leaves that can be seen by them. This calculation of "which leaf can see which" is done by VIS compiler beforehand, and it can take hours if your map contains too many world brushes.
- Prefab:- A brush or a group of brushes (and entities) with textures that is resembling to an object in a map, which is then stored as it is for being used in other maps or the same map later on. For example a computer, or a car, or a lamp post, staircase etc.
Difference between a brush and an entity. -----------------------------------------
|A brush is non interactive and non functioning.||An entity is interactive. It plays a certain role in the map.|
|A brush cuts visleaves and forms shadows and thus requires more resources to get rendered.||An entity does not cut vizleaves, nor does it form shadows (though it can be made to form shadows). Thus, it is rendered without much expenditure of resources.|
|Brushes seal the map. That is, they do not allow anything of the map to go out of the playable area. Hence, the outermost walls of the map must be made up of brushes and not of entity.||Entities cannot seal the map. Thus they cause a leak if used as the outermost wall of the map.|
Knowing your tools ------------------ Hammer Editor’s working screen is divided into 4 sections, as we can see in the [image](http://files.gamebanana.com/img/ss/tuts/52a0c646ef7a9.jpg "Hammer screen"), The first one is 3-D viewport. In this viewport, the map appears almost as it would appear in the game. The other three viewports display the 2-D appearance of the map in XY (top view), YZ (front view) and XZ (side view) plane. Now we will see what tools do we have in the hammer editor.
- Selection tool:- Used to select brushes and entities in the map.
- Click on the select tool,
- then click on the brush or entity to be selected in any viewport (preferably 3-D viewport). We can select multiple objects by pressing and holding ctrl while clicking on the desired objects.
- Once we have selected the objects, we can right click on them in any of the 2-D viewport to get further options like cut, copy, group, ungroup, tie to entity etc
- Magnify:- This tool is used to zoom-in or zoom-out a viewport.
- Left click on a viewport to zoom-in.
- Right click on a viewport to zoom-out.
Alternatively, same thing can be done by mouse scroll button, and it is more convenient.
- Camera:- Used to move in 3-D viewport.
- Hold left click and drag on the 3-D viewport to change the direction.
- Hold left click on 3-D viewport and press W,A,S and D to move forward, left, backward and right respectively.
- Hold right click and drag on the 3-D viewport to move in the same plane.
- Entity tool:- Used to insert point entities like light, info_player_start etc.
- Select entity tool.
- Select the desired entity from object bar.
- Click on any of the viewports where you want to insert the entity.
- Press enter.
- Select this entity with selection tool, relocate it and change its properties.
- Block tool:- Used to create brushes and insert prefabs.
- Click on block tool.
- Select the type of the brush (primitive shapes like a block, cylinder etc or a prefab) from the object bar.
- Hold left click and drag it to the desirable size in any of the 2-D viewports.
- Adjust its size in all the 2-D viewports.
- Press enter.
The brush made can be used to create a brush entity. Just select the brush using selection tool, right click on it in 2-D viewport, click on "tie to entity" and select the desired entity in the "class" field.
- Toggle texture application:- Used to apply texture to a particular surface of the brush.
- Click on Toggle texture application tool.
- Click on the desired surface (press and hold ctrl while clicking on multiple surfaces to select them).
- Browse the desired texture.
- Click on apply.
- Adjust texture's scale, Alignment, rotation etc.
- Click on apply.
- Apply current texture:- Used to apply a texture to all the surfaces of a brush.
- Select a brush (or multiple brushes) using selection tool.
- Browse the desired texture in texture bar.
- Click on apply current texture tool.
- Apply decals:- Used to apply a texture (a decal) over another base texture without making a new brush for it. For example, we see "A" and "B" written over the walls in the map, Those "A" and "B" are the decals that are placed over the base texture of the wall.
- Select the brush over which you want to place the decal using selection tool.
- Click on the Apply decal tool.
- Browse the desired decal texture from the texture bar.
- Click on the previously selected wall in 3-D viewport where you want to put the decal.
- Click again on the Apply decal tool to switch it off.
- Clipping Tool:- Used to cut a brush.
- Select the desired brush using selection tool.
- Click on clipping tool.
- Hold left click and drag the cursor in 2-D viewport over selected brush to form a line where you want to cut that brush.
- The brush will be divided into two parts, one red, and one white. The white part will be left as the final result of the cut and the red part will get deleted. To interchange the red and white parts, click again on the clipping tool. And if you want both the parts to remain as two different brushes as the final result, click again on the clipping tool, this will turn both the parts as white.
- Once the desired part(s) is/are white and the undesired part is red, press enter.
- Vertex Tool:- Used to alter the shape of the selected brush by changing the position of its vertices. For now, we won't discuss how to use it, as it may lead to formation of invalid solids if used by a less experienced mapper.
- Path tool:- It is used to create paths for moving entities like func_train. Paths can also be made manually by placing path_corner entities. Each path_entity should be numbered in sequence. Path tool has been reported buggy by a lot of users.
- Toggle grid:- Show/hide grids in 2-D viewports.
- Toggle grid in 3-D view:- Show/hide grids in 3-D viewport.
- Smaller grids:- Reducing the grid size to the half of the current size.
- Larger grids:- Increasing the grid size to the double of the current size.
- Group selected objects:- Used to group the selected objects.
- Ungroup selected group:- Used to ungroup the selected group(s) of objects.
- Texture lock:- Used to lock or fix the texture on the brush. It is recommended to keep it on. Switching it off causes the change in alignment of textures on a brush when the brush is moved to a new position.
- Run map:- Used to compile the map and convert all the data into .bsp file which can be read by the game engine.
Units ----- Units are used as the measurements in the hammer. They could be used as a scale or a reference to create brushes.
Some useful measurements:-
- standing:- 73 units
- crouched:- 37 units
- Width of a standard corridor:- 96 units
- Standard wall height:- 128 units
- Standard door dimensions:- 112*64 square units
- Vent size:- 48*48 square units
- Stair step height(rise):- 8 units (Maximum 16 units)
- Stair step width(run):- 16 units
It is advisable to work on 16 unit grids for making maximum of your brushes. This keeps the map clean and easy to work with. Work with the reduced grid size only when you don't have an option, or when you are adding the final details.
That's all folks.
Keep Mapping :)