Tech Support Forum banner
Not open for further replies.
1 - 1 of 1 Posts

Hardware Team , Games Team
4,651 Posts
Discussion Starter · #1 ·

This guide is to help new Source mappers into the world of Hammer.

From my experience, Hammer is one of the easiest mapping tools to learn. You can do a range of things from simple brush work to importing hybrid PhysX models (pre-animated models like the bridge collapse in Half-Life 2: Episode 2), actor scenes, lighting affects, wind, gravity, rain and snow, what ever you can imagine is possible with Hammer. However, it is a very low-tech mapping tool. It does not have the ability to play your map straight away. You need to compile it, which, depending on your map, can take seconds or hours. It has only recently been updated to do lighting previews.

Now to get started you need load the Source SDK from the tools section under steam.

After the SDK has loaded you then need to choose what game you want to map for. If its for a mod you are creating need to go here first. There are now officially 4 versions of the Source engine:
  • The original engine from Half-Life 1 (can no longer be accessed by the SDK).
  • The "EP1 Engine", used for Half-Life 2, Counter-Strike: Source, Half-Life 2: Deathmatch, and Half-Life 2: Episode 1.
  • The "Orange Box Engine", used for Half-Life 2: Episode 2 and Team Fortress 2.
  • A fourth version that the SDK cannot access yet, which is running Left 4 Dead.
For this example, I have selected Half-Life 2: Episode 2, using the Orange Box Engine as shown.
*Note* To map for a particular game you first must run the game once before attempting to open Hammer or you are met with an error.

Start Hammer by double clicking on the Hammer icon in the SDK. A splash screen will appear and Hammer will load. When Hammer has loaded, all of the
mapping tools will be grayed out, meaning you are unable to use them because you have no map open. To create a new map you need to click on File
(located at the top of the screen) then click on New. Four screens will be displayed, three of them containing a grid. These three windows are where
your mapping will take place. The fourth is a 3D view screen which allows you to view your map as it will appear in-game.

Each grid window represents a mixture of axes (X,Y and Z). By default, the top-right screen is a mix of X/Y (Looking down on your map), bottom-left is a
mix of Y/Z (Forward and back) and bottom-right is a mix of X/Z (Looking at your map from the side). Each of these windows is very useful as they
will help with brush work and correctly positioning entities.
The 3D View, or Camera, is mainly used to help line up textures and visually see what your map looks like. This saves you from compiling all the time to
view your map in a 3D environment.

Click to Enlarge

A quick list of the keys used in Hammer -

Movement Keys
  • W - Forward
  • S - Backward
  • A - Strafe Left
  • D - Strafe Right
  • Up Arrow - Look Down
  • Down Arrow - Look up
  • Left Arrow - Look Left
  • Right Arrow - Look Right
  • Z - Mouse movement in 3D camera view
  • Mouse wheel up/Page Up - Zoom in on grid
  • Mouse wheel down / Page Down - Zoom out on grid

Some Shortcut Keys
  • Ctrl+C - Copy
  • Ctrl+V - Paste
  • Ctrl+B - Snap selection to grid
  • Shift+A - Texture Application
  • Alt+P - Check map for basic errors
  • Shift+V - Vertex tool (advanced use)
  • Shift+M - Transform (most useful tool, lets you rotate and scale brushes)
  • Shift+H - Make a brush hollow (with some limitations)

Now to create your first hollow brush, in which your player can move around. Select the Block Creation tool, which looks like this
. Create a block of height 320, width 640 and length 640. Then make it hollow by selecting the brush and pressing Shift+H. Make the walls 25 units.

Move to the inside of the brush - from there, you can place a player start point. This is required to spawn the player when the level loads. It is accessed via the Entity tool. By default, the spawn entity is automatically selected, called "info_player_start". You can place this entity either by lining it up in the grid windows or by clicking on the floor in the 3D camera.
Click to Enlarge

Now to add some light to the level. Start by selecting the Entity tool
. A small box will become available (picture below). Make sure "Entity" has been selected in the Categories dropdown box, and in the Objects dropdwon box below it, type "light".
There are also different types of light: "light", "light_spot" (spotlight or down lights), "light_dynamic" (advanced use only - heavy impact on performance) and "light_environment" (sky/sun light, only works when tools/skybox texture is present).
To place a light you need to align it to the grid using each of the windows. This will help you move it to the desired location, though it may take some
time to get used to. Press Enter to finalise the placement.
To edit the light properties like Brightness, Colour and Cast Distance, just double-click on the light in the 3D view.

Now to get different textures onto the brushes. Browse for the texture you want by clicking on Browse under Texture Groups.
First, we are going to place a concrete texture on the floor. By clicking on the Browse button you will bring up the texture browser. In the filter box type "floor". I've chosen "concreteflooe011a". Then to apply the texture to a single face of a brush you need to select this tool
. And then right-click on the face you want to apply the texture to in the 3D view.
You should get the following:

Click to Enlarge

Now, here is the most amazing texture in Hammer. Each brush face uses video memory to render. But there is a texture which tells the compile process that the face it is on does not ever need to be rendered. This texture is called "Nodraw". Apply this texture to any face the player will never see. You will save a lot of memory if your map is large.

Now to add props to your map, such as benches, rail tracks or rubbish. Each prop falls into a different entity category. Objects which don't move are called "prop_static" and entities that do move (like boxes and paint cans) are called "prop_physics".

So select the Entity tool and type in "prop_static". Click on the 3D view to place the entity. Now the entity at the moment is only a red box. This is because there is no selected model for it. To select a model, double-click on the entity in the 3D view to open the Object Properties window, click on "World Model" and press the Browse button.

Click to Enlarge

This will open up the model browser. Follow the screenshot to select the following bench and then press OK. Then press Apply in the prop_static box.
Click to Enlarge

To rotate the object, locate the circle with a line though it in the top-right corner of the Object Properties window. You can move the line to any angle to rotate the object, or you can type in a number for the angle in the adjacent box. Angles range from 0 - 360.

Click to Enlarge

Now save your map by going to File > Save and naming it like "my_map". Then compile the map by clicking on File > Run Map. A window will open, so make sure it looks like the following before clicking on OK.
*Note* There cannot be any spaces in the map name. If there are, it will fail to compile.

After a short time, the compile process will complete and Hammer will launch Half-Life 2: Episode Two. Your map will load automatically.

*Note* Sometimes the game will fail to load. What you need to do then is to start the game up, open the console by pressing the tilde (~) key, type "map <Map Name>" (minus the quotes), and press Enter.

Example: map my_map

Click to Enlarge

You have now made your first map using Hammer. It will take time for you to become accustomed with some of the more advanced features in Hammer, but practice goes a long way.

I will have more guides coming up that will focus on specific areas of Hammer or will address users' personal requests.

1 - 1 of 1 Posts
Not open for further replies.