Hammer tutorial 2 – Your first room

In this section you’ll learn about the layout of the editor, its various functions and the first steps to creating a playable level.

First off, it’s worth taking a look at the layout of the editor. Hammer is a pretty simple tool once you get to know it, 3 main tool bars and four “panes”. There are three 2D panes, and one 3D pane, below is a picture of the four.

Hammer Panes

The 3D Pane

This shows your progress, the map takes shape in this window and it’s used to display an unlit version of the map. The 3D pane has a primitive shading system to give your work a 3D look. You can select objects from the 3D pane. Clicking on the black tab in the top left of the 3D window, you can cycle through the render modes. Wireframe shows the brushes as wireframe, flat shows them untextured (usually in their visgroup colors) and textured returns it to textured brush mode.

The 2D Pane’s

These are where the action takes place. You’ll notice each of the 2D panes are labeled either XY, YZ or XZ corresponding to their projection of the 3D object you’re trying to create. XY is the top down view, XZ is usually the side view and YZ is usually end on. I say usually, since it depends on the orientation of the object you’re working on. By clicking on the black tabs in the top left of each pane, you can change which view they display.

With each of the panes, you can navigate them with some handy shortcuts. The mouse scrollwheel will allow you to zoom in all panes. The 3D pane allows you to move about using W,S,A,D on the keyboard. 3D pane navigation is explain in greater detail in the toolbar explanation below.
You can resize the panes by moving the dividing bars around, giving you the option to have a fullscreen view of the 3D pane for example.

The toolbars

A lot of these stuff here will be covered in more detail during the “your first room” walkthrough. It’s a lot to take in, so take your time and make sure you understand what each tool is used for.

Hammer has 3 main toolbars, starting with the top toolbar:

Hammer toolbars

1 – Grid toggle. This toggles the display of the grid in the 2D panes.
2 – 3D grid toggle. This toggle the display of a 3D grid in the 3D pane. It will show up when the camera is close enough to a brush in the 3D view.
3 – Smaller Grid. (makes grid size smaller – smallest is 1 unit)
4 – Bigger Grid. (makes grid size bigger – biggest is 512 units)

5 – Load independent window configurations. (Only when the checkbox to use independent window configurations has been checked in the options tab of Hammer)
6 – Save independent window configurations. (Only when the checkbox to use independent window configurations has been checked in the options tab of Hammer)

7 – Carve tool. The carve tool is used to cut a brush with another brush. For example, if you have a wall, and you want a window, you’d create a brush the size of a window and carve it into the wall, then delete the brush you carved with to leave a hole. It’s worth noting this tool can create some big problems. Carving complex solids often creates invalid brushes and brush splits. It should generally not be used if you’re not 100% sure what you’re doing.

8 – Group brushes. When a number of brushes have been selected, clicking this will group them together. You can group brushes, entites or even group 2 groups together. When an brush has been carved it’s individual pieces will automatically get grouped by hammer. Grouping is purely to make life easier for you, it has no bearing on the map you’re making at all.
9 – Ungroup brushes. The inverse of grouping.
10 – Ignore groups. With this toggled on, any groups will be ignored allowing you to select parts of that group without selecting the entire group. Handy for making small changes to groups without having to reselect all the individuals. When you toggle this off, any selected brushes will be automatically de-selected.

11 – Hide selected objects. These three buttons are part of Hammers VISGROUP system. This is a convenience tool that allows you to hide bits of the map to make it easier to work on a large map. Selecting an object(s) and hitting hide will make the objects disappear and will create a new entry in the visgroup panel on the right hand side of Hammer. I’ll explain VISGROUPS in more detail later on.
12 – Hide unselected objects. Hides everything you DON’T have selected.
13 – Show all objects. As the name suggests, this makes all VISGROUPS visible.

14 – Cut. Same as anything in windows, but for Hammer objects.
15 – Copy.
16 – Paste.

17 – Toggle cordon state. The cordon tool is used to select an area to compile, rather than compiling the entire map. Once the area has been set using the “Edit cordon bounds” and the cordon state has been toggled to on (the dashed cordon boundary lines will turn into a solid red line) you can compile the map in the normal way (explained later). However it will only compile the area in the cordon boundary.
18 – Edit cordon bounds. Selects the area of the map you wish to compile with the cordon compile tool.

19 – Toggle select by handles. This will toggle how you select a brush. By default, you only select brushes by the center X, but with this on, you can select brushes by their vertices.
20 – Toggle auto-selection. By default, dragging a selection box automatically tries to select whatever is inside the box you dragged. With this option off, you will need to hit enter to confirm the selection.
21 – Texture lock. With this off, textures are not held to the face of a brush. On by default.

22 – Texture alignment. To quote from the Hammer help file (that explains it a lot better than I can): This button toggles the texture alignment style between world alignment and face alignment. World alignment will align textures according to the world grid coordinates. Face alignment will align textures according to the brush face.

23 – Compile. Compiles the map (explained in the next tutorial)

The left hand toolbar:

Hammer toolbars

1 – Selection tool. This tool selects objects from the 4 panes, drag over multiple objects to select them.
2 – Zoom tool. Left mouse button to zoom in, right mouse button to zoom out. Alternatively, use the mouse scroll wheel (which basically bypasses the need to use this button)
3 – Camera tool. Used to manipulate the 3D view, when selected you can navigate the 3D view in the following ways:

*Hold left mouse button to look around
*Hold right mouse button to “strafe” the camera
*Hold both mouse buttons to move forward and back (scrollwheel does the same thing)
*hold left mouse button and use W,S,A,D to fly about in the 3D view.

To place a new camera in the map, go to one of the 2D panes with the camera tool selected. Hold shift and drag a line and a new camera will be created. The blue “ball” on this camera is your view point, and the red line notes the direction. You can add as many cameras as you want. You can delete a camera by clicking the ball (to select it) and hitting delete.

Cameras are only visible when the camera tool is selected.

4 – Place point entity. This will allow you to place a point entity from the list of entities in the FGD file. When you click this, a list of entities will appear in the entities list box in the bottom right of Hammer. Select the entity you wish to place and position the entity in the 2D views with the green crosshair that appears when you click the place entity tool. Hit enter to confirm the location.
5 – Create brush. This creates the individual brushes that makes up the map. Select the tool and drag the shape the of the new brush in the 2D views. Hit enter to make the brush. You can select a different type of brush (cylinder, arch, wedge etc) from the drop down box on the bottom right of Hammer. When you have a brush made you can manipulate it by using the clip tool, vertex manipulator or sheer/rotate/resize toggles. The clip tool and vertex manipulator are explained below. The sheer/rotate/resize toggles are part of each brush. When you select a brush (selection tool) you’ll see a small square in each corner of the brush that you can grab and change the shape of the brush. When you click the corner of the brush once these corners will change to four small circles. These are used to rotate the brush. Click it once more, and four small squares will appear along each side of the brush. These are used to “sheer” the brush.

Experiment with these basic functions and when you’re comfortable with the brush tool move on.

6 – Texture applicator. (I’ll cover this below)
7 – Apply texture to entire brush. With a brush selected, and a texture chosen from the texture brower in the upper right of Hammer (see below, Toolbar 3, item 9) you can click this button to assign the chosen texture to the entire brush.
8 – Decal applicator. Half-life uses a system of decals to apply small dings and bullet holes in the game. In the half-life folder, there is a WAD called “decals.wad”. If this is loaded in the texture tab in the Hammer configuration, you can browse it and select a decal to place in your map. When you have a decal selected, click the decal applicator tool and you’re able to place one by clicking where ever you want it in the 3D window.
9 – Clip tool. The clip tool is used to nibble off bits of a brush. With a brush selected, select the clip tool and click on part of the brush. Without letting go of the mouse button, drag a line across the brush where you want it to be cut and the brush will reshape along the area you’re clipping off. Hit enter to confirm. If you press the clip tool button more than once, it will cycle through the 3 types of clip you can use. It’s worth experimenting with this tool to make sure you understand exactly how it works.
10 – Vertex manipulation tool. (I’ll cover this below)
11 – Path tool. The path tool isn’t really used anymore, you can ignore this.

The right hand toolbar:

Hammer toolbars

1 – Texture group. Selects the WAD’s from the list, you can ignore this as it’s much easier to choose a WAD in the texture browser itself.
2 – Current texture. The name of the current selected texture.
3 – Texture image. A handy image of the texture you have selected.
4 – Visgroup list. This is the list of visgroup’s you have assigned (explained in detail later on)
5 – LOL there’s no 5 because I’m a douche who can’t make images.
6 – “To world” button. When you have a brush tied to an entity, hitting this with the brush selected will remove the entity assignment of the brush making it a normal world brush.
7 – Prefab/primitive drop down. Hammer contains a library of prefabs (a prefab is a bunch of items already made, computers/shelves etc) that save you having to remake them all. This drop down selects between primitive brushes (cylinders/rectangles etc) and the prefabs.
8 – Primitive shape selector. This selects the type of shape you wish to create with the brush tool.
9 – Texture browser. This allows you to browse and select the texture’s loaded into Hammer.
10 – Texture replacer. This replaces one texture in the entire map with another selected in the texture browser.
11 – “To entity” button. When you have a world brush (a world brush is a brush NOT tied to any entity) you can select it and press this button to assign an entity type to it.
12 – Prefab creator. This allows you to add your own prefabs to the prefab libraries.

That covers the toolbars found in Hammer, this was just a brief explanation of what the various buttons do. You’ll come to learn more about them as you use them. I’m going to explain 3 of them in detail during the “first room” tutorial.

Building your first room

This is the first logical step in Level design, placing the first six brushes and two entities to create a playable map. From this point onwards, I’m assuming you have Hammer installed and configured correctly and you’re fairly familiar with the tool names and their uses.

*Start Hammer and create a new map.

*Go to the texture browser and in the filter type in “C1A1C_W2” and select the texture.

*Set the grid size to 16 units by pressing [ or using the grid size button (toolbar 1, button 3) on the top toolbar. Hammer tells you the current grid size on the status bar along the bottom, below the lowest 2 panes.

*Using the brush tool (toolbar 2, button 5) make a brush 256 units long, 128 units tall and 16 units thick. Do this by dragging out the shape of the brush you want to make (with the brush tool selected) and confirm the new brush by hitting enter. You can judge this by using the size reading at the bottom of Hammer (next to the grid size) You may want to add a new camera here, select the camera tool (toolbar 2, button 3) and hold shift+drag. Point the camera at the new brush.

*Select the brush and with shift held down, drag a clone.

*Make a new brush 256 units wide by 256 long and 16 units tall

*Move the brush you just created to meet up with the first wall and align it to the bottom (as in the picture). This is your floor. Clone this brush as you did above, and move it opposite the floor to form the ceiling.

*With the wall you cloned earlier, position it opposite the first wall to form the opposite wall.

*Select the two walls (select one, then hold ctrl and select the other) Hold shift and make a clone of the two walls. With the two new walls still selected, click a white corner of the selected brushes in the XY (top down) window. The corners should change to small circles. Grab one of these corners and spin the brushes around so they can be placed as the two missing walls. This is where having “default to 15 degree rotations” is very helpful. If you have this turned off, you can hit ctrl+m and rotate them 90 degrees.

*You should end up with something that looks like this:

Move the camera inside the room and you’ll notice it’s a bit dull. Let’s give the floor and ceiling a better texture. This is a good opportunity to discuss the texture application tool (feel free to skip this if you’re already familiar with the texture tool):

The texture application tool (toolbar 2, button 6)

When you place a brush in Hammer, it will be coated entirely in the texture currently selected in the texture browser. When you hit the browse button of the texture browser (top right of Hammer, toolbar 3, button 9) you can scroll through all the textures from all of the wads loaded into Hammer. Select one by double clicking it. You can filter the textures if you happen to know the name, or you’re looking for a particular texture set. For example, typing “crete” will bring up the concrete Half-life textures.

You can browse textures in two places; the above example is used when you want a brush to be made from that texture. The other browser is part of the texture application tool, used to search for textures to apply to individual faces.

When you click the texture applicator tool, the face properties toolbox appears. You’re now free to select one or more faces (hold down ctrl to select multiple brush faces in the 3D pane). When a face is selected, you can browse for a new texture and then hit “apply” to change the selected faces to the new texture.

The texture applicator tool has a number of features:

Scale: Pretty simple, set this to a higher value to make the texture bigger, lower to make it smaller. By putting a minus before the scale values you can flip the texture.

Align to world/face: World will align the face to co-ordinates of the world, where as Face will align them to face co-odinates.

Position: Adjust these to move the texture on the face.

Rotation: As the name suggests, this rotates the texture.

Fit: When you have a face selected, hit this and the texture will perfectly fit to the face. You can use this in conjunction with “treat as one” to fit across multiple faces.

Treat as one: See above.

Justification: This will adjust the texture to justify it to one or another side of the face.

Application Modes: I suggest you leave this set to lift+select. It changes the way the texture applies itself. You can change this to align the texture to your viewpoint if you require.

Now you know all about the texture application tool, let’s select the floor of our room and browse for a new texture. Put C1A3FLOOR2 in the filter field and select it, then hit apply in the texture applicator. Your floor should be a nice stone slab effect. Now do the same thing for the ceiling, but use the texture C3A1_W3C. Your room should now look something like this:

Congratulations!, this is your first room. In order to play, it needs some light and a place to spawn.

Click the place entity tool (toolbar 2, button 4) and select “info_player_start” from the entity list (toolbar 3, item 4) and position it inside the room. Make sure it’s not touching the walls and is not stuck into any of the brushes. Hit enter to confirm the placement.
This entity will form a spawn point where the player starts after the map has loaded.

Next, you will need to place a light in the room. Select “light” as you did with the info_player_start and position it somewhere near the ceiling. Hit enter to confirm the placement.

Select the light and right click it, go to properties and choose a color you want the room to be lit with. There are four sets of numbers in the color properties of the light. The first three are the Red Green Blue values for the color, and the fourth is the brightness of the light.

Your room should look something like this:

This concludes your first room, play around with the editor and get fully used to the camera modes, brush creation and placing entites. When you’re ready, move on to the next section. Below are two slightly more advanced features of Hammer, the vertex manipulator and the Visgroup system.

The vertex manipulator (toolbar 2, button 10)

This tool is exceptionally useful, but also potentially the cause of a lot of problems, unless you know how to use it properly. The vertex manipulator is essentially a tool for moving the nodes and vertices of a brush (the corners, or points of the brush and the vertexes) allowing you to make new shapes, or alter the dimensions of an existing brush without having to use the resize tool. In addition, it allows you to combine points and split the vertexes of a brush.

When a brush is selected, and this tool is pressed the brush will instantly go into Vertex manipulation mode. It will appear semi-transparent (so you can see all the nodes) and a series of yellow and white squares will appear around the brush.

Yellow squares are used to grab vertices (the lines of the brush)
White squares are used to grab the nodes (the points at which the vertices meet)

Pressing the vertex manipulation button on the toolbar more than once will cycle through its three modes that allow you to hide the white squares, or yellow or have both visible. This is handy for manipulating complex solids with a lot of nodes/vertices.

First off, the white node points:

These small white squares appear where vertices of a brush meet. When in vertex manipulation mode, you’re free to grab these points and move them around. By grabbing pairs of points you’re able to change the shape of the brush and form triangles, rhomboids and other shapes. Create a cube 128 units square and experiment with moving the white points to create some new shapes. You can press ctrl+p to check for invalid solid structures (read on below).

This however, isn’t without problems. One of the biggest complaints with the vertex tool is it creates invalid solid structures. The Half-life engine can not cope with concave brushes. That is, a brush that bends in on itself, OR an invalid shape such as a flat plane that is bent out of shape and becomes no longer flat. Here are some examples:

You can combine nodes by moving them into each other (make sure they meet in all 3 of the 2D windows) and hitting enter to confirm the union.

The yellow vertex points:

Create a new brush, 128 units x 128 units x 128 units, select it and click on the vertex manipulation tool. The cube will go into vertex manipulation mode and you’re free to make some changes.
Grabbing one of the yellow vertices in the 2D views will select all the points directly in line to the one you have clicked on. To avoid this (unless you wanted to select them all) you can use the 3D view to select an individual point. You can move these vertices by dragging them that will change the shape of the brush.

The yellow nodes have another very useful feature. Selecting a single yellow point and pressing ctrl+f will split the brush along that point. Say for example you have a cube, you can select one of the yellow nodes and split the vertices allowing you to grab the new point and pull it out to form a square with a point on (as in this image).

You cannot use ctrl+z to undo any of the steps you make in the vertex manipulator until after you have selected another tool, so make sure you get it right first time. This is a tricky tool to get used to, so take your time.

This covers the basic uses of the Vertex manipulation tool, in a later installment I’ll try and cover creating terrain and rock work using the vertex tool.

The visgroup system (toolbar 3, item 4)

Although not strictly necessary to know how the visgroup system works, it can be a very useful tool in Hammer, especially when maps get larger and more complicated.

Basically, visgroups are used to hide parts of the map from view. This is only relevant to Hammer and doesn’t affect the map running in the game at all. This involves 3 buttons (toolbar 1, buttons 11,12 and 13) and the visgroup menu (toolbar 3, section 4).

When you have an object selected (a brush, sprite entity etc.) or a number of objects, you can choose to hide them from view by pressing the “hide selected objects” button (toolbar 1, button 11). This will make the objects invisible, although they still exist in the map. When you hide objects, an entry will appear in the visgroup list (toolbar 3, item 4). You can toggle the objects in and out of view by clicking just to the left of the object name in the visgroup list (by default the name is x objects where x is the number of objects you have hidden. You can change the name of the objects by selecting it and hitting edit and giving it a new name. You can also assign a color to it here.) and hitting “apply”. To remove an object from the visgroup list, press “edit” and select the group and press “remove”.

You can do the inverse of the “hide selected objects” by selecting an object and pressing the “hide unselected objects” button (toolbar 1, button 12) and everything you DON’T have selected will be hidden. This is handy when you want to work on a small area without having a lot of other parts of the map in view.
The third button along (toolbar 1, button 13) will show the entire map, even those items hidden with a visgroup.

<< Back to page 1 || >>

Leave a Reply