This article relates to the game "Team Fortress 2". Click here for more information.
This article's documentation is for anything that uses the Source engine. Click here for more information.

Your First Map

From Valve Developer Community
Jump to navigation Jump to search
English (en)Translate (Translate)


In Team Fortress 2 Team Fortress 2, players can enjoy a wide variety of community-made maps, including jump maps, dodgeball, MGE, trading maps, training maps, and more. Even if you're only vaguely interested in map creation, there's probably a type of map you're eager to build. This article covers the basics common to all types of maps. It’s intended for anyone launching Hammer Hammer for the first time. Whether you're using the standard Hammer editor or Hammer++ Hammer++, either one will work just fine.

Getting Started

The Hammer editor is packaged with TF2. Refer to Getting Started to learn how to launch the Source level editor.

Creating a Play Area and Adding a Skybox

Making a Cube

Drawing a brush.

Before we jump in, let’s talk about how the sky works in the Source engine. Many players imagine the world as a flat surface with open sky above, but Source maps are actually built inside a sealed box! What looks like the sky is really a texture applied to the ceiling. Let's recreate that now by making a cube-shaped world.

  1. Press Shift+B, or select the Hammer block.png "Block Tool" in the left toolbar.
  2. In the Top 2D view, left-click and drag from the top-left toward the bottom-right.
  3. As you drag, you'll see a dotted outline forming a rectangle or square.
  4. Make a 512×512 square, and make sure it’s visible in the Top, Right, and Side viewports.
  5. Press Enter to create the brush you've drawn.
Note.pngNote:Hold Space and drag to move the 2D camera view.

Making It Hollow

Make it empty.

Now let's hollow it out.

  1. Click the Hammer select.png Selection Tool or press Esc to return to selection mode.
  2. Right-click the "x" in the center of your cube to select it. Left-click again and choose Make Hollow. Set thickness to 16 units.

This will create inner walls, forming a playable hollow space.

Note.pngNote:You don’t have to use Make Hollow. You can also build the walls, floor, and ceiling manually with the Block Tool.

Navigating the 3D Camera Viewport

3D navigation differs slightly from the 2D views:

  • Hold Space and left-click + drag to rotate the camera.
  • Hold Space and right-click + drag to move up/down and left/right.
  • Hold Space, left + right-click + drag to move forward/backward.
  • Use W, A, S, and D to move like in-game (forward, back, strafe left/right).
  • Press Z in the 3D viewport to toggle "mouse look" mode, allowing free camera rotation with your mouse.
Note.pngNote:You can combine WASD movement with Space navigation for more control.

Applying a Skybox Texture

Hammer face sheet.png
tools/toolsskybox

Let’s apply the sky texture.

  1. Move your 3D camera inside the cube.
  2. Press Shift+A to activate the Texture Application Tool.
  3. Click a face inside the cube.
  4. In the Face Edit Sheet, click Browse...

Search for tools/toolsskybox. Typing "tools" in the filter can help narrow it down.

Once selected, apply it to the ceiling (or whichever surface you want to act as the sky). You can also set it as the current texture to use it more easily later.

Any face with the toolsskybox texture will appear as sky in-game.

Adding a Player Spawn Point

Let’s add a spawn point so we can enter the map.

  1. Select the Hammer entity.png Entity Tool using Shift+E or from the Tool Bar.
  2. Click in the center of your cube to place the entity.

The Grid

All 2D views use a grid. Objects snap to the grid by default, which helps avoid bugs like leaks. It's best to leave this setting on.

The default grid size is 64 units. This value is shown in the status bar at the bottom of the Hammer window.

  • Click the Smaller Grid icon Hammer SmallerGrid.png or press [ to reduce the grid size for precision.
  • Click the Larger Grid icon Hammer LargerGrid.png or press ] to increase the grid size for faster layout.

To reduce the grid to 16 units, press [ twice. Confirm it says Grid: 16 in the bottom-right of the Hammer window.

Back to the Spawn Entity

Now, select the entity using the Selection Tool.

Note.pngNote:Entities have a small x near their base—click there to select them.

Select info_player_teamspawn

Let’s configure it.

Press Alt+ Enter, or right-click the entity and choose Properties.

Change the class name to info_player_teamspawn.

Compiling and Running the Map

Once your map is ready, press F9 to compile it.

To test it, move the compiled BSP file to: [your Steam Directory]\steamapps\common\Team Fortress 2\tf\maps

Then launch TF2, click "Create Server", and find your map in the list.

Skybox demostrare1.jpg

And there you have it—your first map!