Team Fortress 2/Your First Map: Difference between revisions
m (→Apply Skybox) |
No edit summary |
||
Line 1: | Line 1: | ||
{{LanguageBar}} | {{LanguageBar}} | ||
{{DISPLAYTITLE:Your First Map}} | {{DISPLAYTITLE:Your First Map}} | ||
{{TF2 topicon}}{{source topicon}}[[Category:Hammer]][[Category:Level Design]][[Category:Team Fortress 2|Your first map]] | {{TF2 topicon}}{{source topicon}}[[Category:Hammer]][[Category:Level Design]][[Category:Team Fortress 2|Your first map]] | ||
<!-- | <!--Quoted a lot from "Level Design Introduction/Your First Level (Portal 2)".--> | ||
In {{tf2|4}}, 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|2}} for the first time. Whether you're using the standard Hammer editor or {{Hammer++|2}}, either one will work just fine. | |||
== | == Getting Started == | ||
=== | The Hammer editor is built into 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 === | |||
[[File:l4d_hammer_brush_01.jpg|thumb|right|300px|caption|Drawing a brush.]] | [[File:l4d_hammer_brush_01.jpg|thumb|right|300px|caption|Drawing a brush.]] | ||
Before | 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. | ||
# Press {{key|Shift}}+{{key|B}}, or select the [[File:Hammer block.png]] "Block Tool" in the left toolbar. | |||
# In the '''Top''' 2D view, left-click and drag from the top-left toward the bottom-right. | |||
# As you drag, you'll see a dotted outline forming a rectangle or square. | |||
# Make a 512×512 square, and make sure it’s visible in the '''Top''', '''Right''', and '''Side''' viewports. | |||
# Press {{key|Enter}} to create the brush you've drawn. | |||
{{note|Hold {{key|Space}} and drag to move the 2D camera view.}} | |||
{{ | {{clr}} | ||
=== Making It Hollow === | |||
[[File:Hammer make hollow.png|thumb|right|400px|caption|Make it empty.]] | |||
Now let’s hollow it out. | |||
# | # Click the [[File:Hammer select.png]] '''Selection Tool''' or press {{key|Esc}} to return to selection mode. | ||
# Right-click the "x" in the center of | # 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| | {{note|You don’t have to use '''Make Hollow'''. You can also build the walls, floor, and ceiling manually with the '''Block Tool'''.}} | ||
{{clr}} | {{clr}} | ||
=== Navigating | === Navigating the 3D Camera Viewport === | ||
3D navigation differs slightly from the 2D views: | |||
{{note| | * Hold {{key|Space}} and left-click + drag to '''rotate''' the camera. | ||
* Hold {{key|Space}} and right-click + drag to move '''up/down''' and '''left/right'''. | |||
* Hold {{key|Space}}, left + right-click + drag to move '''forward/backward'''. | |||
* Use {{key|W}}, {{key|A}}, {{key|S}}, and {{key|D}} to move like in-game (forward, back, strafe left/right). | |||
* Press {{key|Z}} in the 3D viewport to toggle "mouse look" mode, allowing free camera rotation with your mouse. | |||
{{note|You can combine {{key|W}}{{key|A}}{{key|S}}{{key|D}} movement with {{key|Space}} navigation for more control.}} | |||
{{clr}} | {{clr}} | ||
=== Applying a Skybox Texture === | |||
=== | |||
[[File:Hammer face sheet.png|left|300px]] | [[File:Hammer face sheet.png|left|300px]] | ||
[[File:Hammer Texture search.png|right|thumb|700px|caption|tools/toolsskybox]] | [[File:Hammer Texture search.png|right|thumb|700px|caption|tools/toolsskybox]] | ||
Let’s apply the sky texture. | |||
# Move | # Move your 3D camera inside the cube. | ||
# | # Press {{key|Shift}}+{{key|A}} to activate the Texture Application Tool. | ||
# | # Click a face inside the cube. | ||
# In the | # In the Face Edit Sheet, click '''Browse...''' | ||
Search for {{code|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 {{code|toolsskybox}} texture will appear as sky in-game. | |||
{{clr}} | {{clr}} | ||
== | == Adding a Player Spawn Point == | ||
Let’s add a spawn point so we can enter the map. | |||
# Select the [[File:Hammer entity.png]] '''Entity Tool''' using {{key|Shift}}+{{key|E}} or from the '''Tool''' Bar. | |||
# 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 [[File:hammer_SmallerGrid.png]] or press {{key|[}} to reduce the grid size for precision. | |||
* Click the '''Larger Grid''' icon [[File:hammer_LargerGrid.png]] or press {{key|]}} to increase the grid size for faster layout. | |||
To reduce the grid to 16 units, press {{key|[}} 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|Entities have a small '''x''' near their base—click there to select them.}} | |||
[[File:Hammer obj properties.png|500px|caption|Select {{code|info_player_teamspawn}}]]{{clr}} | |||
Select | |||
{{ | |||
Let’s configure it. | |||
Press {{key|Alt}}+{{key|Enter}}, or right-click the entity and choose '''Properties'''. | |||
Change the class name to {{code|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: | |||
{{code|[your Steam Directory]\steamapps\common\Team Fortress 2\tf\maps}} | |||
Then launch TF2, click "Create Server", and find your map in the list. | |||
[[File:Skybox demostrare1.jpg|700px]] | [[File:Skybox demostrare1.jpg|700px]] | ||
And there you have it—your first map! | |||
{{navbar2|Team Fortress 2/Your First Map|Your First Map|Team Fortress 2 | {{navbar2|Team Fortress 2/Your First Map|Your First Map|Team Fortress 2 Mapping tutorial|Team Fortress 2 Mapping|Team Fortress 2/Building Respawn Room|Building Respawn Room}} |
Revision as of 03:09, 26 May 2025


In 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 for the first time. Whether you're using the standard Hammer editor or
Hammer++, either one will work just fine.
Getting Started
The Hammer editor is built into 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
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.
- Press ⇧ Shift+B, or select the
"Block Tool" in the left toolbar.
- In the Top 2D view, left-click and drag from the top-left toward the bottom-right.
- As you drag, you'll see a dotted outline forming a rectangle or square.
- Make a 512×512 square, and make sure it’s visible in the Top, Right, and Side viewports.
- Press ↵ Enter to create the brush you've drawn.

Making It Hollow
Now let’s hollow it out.
- Click the
Selection Tool or press Esc to return to selection mode.
- 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.

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.

Applying a Skybox Texture
Let’s apply the sky texture.
- Move your 3D camera inside the cube.
- Press ⇧ Shift+A to activate the Texture Application Tool.
- Click a face inside the cube.
- 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.
- Select the
Entity Tool using ⇧ Shift+E or from the Tool Bar.
- 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
or press [ to reduce the grid size for precision.
- Click the Larger Grid icon
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.

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.
And there you have it—your first map!