L4D Level Design/Outdoor Levels

From Valve Developer Community
Jump to: navigation, search
English (en)中文 (zh)
... Icon-Important.png

In this tutorial, we'll learn how to incorporate the sky into the level so that we can make it feel like the player is outside. We'll also take a look at creating displacements which are kinds of brushes that you can form terrain out of.

Create tutorial06.vmf

In Hammer, open the map file tutorial05_part2.vmf that you created in the previous tutorial if it's not already open. We will make this level an outdoor level.

Now we'll make a new version to work with:

  • Go to File menu and choose Save As...
  • Change the name to tutorial06.vmf.

The Sky

In the Camera viewport, move to the second room in the level (the one that has the dimensions 512 x 480) and select the ceiling.

Selecting the ceiling brush.

In the Texture box, click on the Browse Button to bring up the Texture Browser.

Type "tools" in the Filter drop-down field and find the texture called "toolsskybox"

The tools/toolsskybox texture.

Double-click on it to set it to the active texture.

With the ceiling brush still selected, click Hammer ApplyCurrentTexture.png 'Apply current texture.

Applying the skybox texture to the ceiling.

Any face of a brush that is assigned this toolsskybox texture will automatically draw the sky in the game engine.

Note.pngNote:You can also apply the skybox texture to wall and floor brushes.

Right now, it's going to be a little weird to have the walls abruptly end so close to the where the player can see. So, let's raise the ceiling and add another set of walls to make the sky a little further out.

Doubling the height of the room.
Note.pngNote:Don't forget to expand the wall over the hallway to completely seal the level if you duplicate the walls.
Selecting Map Properties from the Map menu.

Now, we need to assign the sky that we want seen where the skybox texture is.

Go to the Map menu and select Map Properties.

The Map Properties dialog box will appear.

The Map Properties window.

Change the SkyBox Texture Name to "sky_l4d_urban01_hdr".

This is the skybox texture used in the No Mercy campaign.

See it in-game

Press F9 and click on OK to see the results in the game.

Note.pngNote:Like earlier, just press Continue to bypass the Map is unplayable! message.

Alternative skies

Other skybox texture names you can use:

Death Toll "sky_day01_09_hdr"
Dead Air "urbannightburning_hdr"
Blood Harvest "sky_l4d_rural02_hdr"

Creating a Displacement

Displacements are special brushes that you can sculpt to form more organic shapes with, such as terrain. The easiest example we can start with is a pile of dirt on the ground. Let's create a displacement in this outdoor room we've just created.

Note.pngNote:Displacement brushes can't be used to seal the world. Once you've turned a brush into a displacement, you must seal the world with a regular brush.
  • Go to File menu and choose Save As...
  • Change the name to tutorial06a.vmf.

Displacements can be any texture that you normally apply to a brush. There are blend textures, however, that we can use to paint on displacements and they blend between two textures smoothly.

Click on the Browse Button on the Texture Box.

The gravel to dirt blend texture.

Type "blend" into the Filter drop-down field.

Select the texture "blendgraveldirt001a" and double-click on it to make it the current texture.

Selecting the floor brush.

In the Camera viewport, select on the floor brush in the outdoor room.

Duplicating and reshaping the floor brush.

In the Side viewport, duplicate the floor by moving your cursor over the Side viewport and pressing Shift+{Up_arrow key.

Move the floor up so that the top of the new floor is 16 units above the old floor (if it isn't already that height when you duplicated it).

Now shape the brush so that it is 240 units wide and 240 units long and 16 units high.

Move it so that it covers the bottom left corner of the outdoor room in the Top viewport.

Apply the current texture to the brush with Hammer ApplyCurrentTexture.png 'Apply current texture.

Now, enter the texture application mode by clicking on the Hammer ToggleTextureApplication.png Toggle Texture Application icon.

The Create button in the Face Edit Sheet.

With the Face Edit Sheet dialog box still up, left-click on the top face of the new floor brush to select it.

Click on the Displacement tab on the Face Edit Sheet dialog box.

Click on the Create button.

The resolution for the displacement.

A Displacement Create window will pop up.

Change the Power field to "1" and click OK.

Note.pngNote:The Power number you designate here will change the density of vertices in your displacement. You can change the number later if you need to.
The displacement is created.

You should now see your new floor brush look like a mesh where the top face was.

Sculpting a Displacement

The Paint Geometry window.

Click on the Paint Geometry button in the Face Edit Sheet dialog box.

The Displacement Paint Geometry window will appear.

Leave the default settings for now.

The Paint Geometry node.

In the Camera view, you can still navigate around with the Displacement Paint Geometry window up.

As you move your cursor around on the displacement, you'll notice a green sphere that snaps to each point on the displacement mesh.

This sphere designates the point where you will be editing your mesh.

Note: In Windows Vista x64 with DX10 the screen may start flashing/blinking when you attempt to Paint Geometry. Try this workaround from another Valve wiki page.

Lowering a vertex on the displacement.

Left-clicking on one of the points of the displacement with these settings will raise the point. Right-clicking will lower the point.

Try lowering the point in the middle of the entrance to the hallway by right-clicking on it four times.

Using the Shift key to lower the vertex.

You can also raise and lower the points by holding the Shift key down and holding down the left mouse button. Then, move the mouse up and down so that the point doesn't snap to positions. It moves freely.

Move the point to the left of the first point down into the floor using this method.

Making a mound of dirt.

Using either method, shape the displacement so that it looks like a mound of dirt on the floor.

Painting Alpha on a Displacement

The Displacement Paint Alpha window.

Before we test out the displacement in the game, let's paint it so that it blends with a floor texture.

Close the Displacement Paint Geometry window.

In the Face Edit Sheet dialog box, click on the Paint Alpha button.

The Displacement Paint Alpha window will appear.

Painting the alpha blend on the mound.

In the Camera viewport, just like when you painted the positions of the points of the mesh, you can paint the alpha of the blended texture by left-clicking on the points.

Paint the edges of the displacement so that the gravel texture touches the floor and blends up to the dirt.

Selecting the floor brush under the mound.

We now have our dirt mound. Close the Displacement Paint Alpha window.

With the Face Edit Sheet dialog box still up, click on the Material tab and then select the original floor below the displacement including the hallway floor.

The gravel texture.

Click on the Browse button in the Face Edit Sheet dialog box.

Type "gravel" in the Filter drop-down field and select the texture "train_gravel_floor_01" by double-clicking on it to make it the current texture.

Texturing the floor with the gravel texture.

Click on the Apply Button in the Face Edit Sheet dialog box to apply the gravel texture to the floor.

The mound of dirt on a gravel floor.

You can close the Face Edit Sheet dialog box by clicking on the X at the top right corner of the window.

Press F9 and click OK to run the level in the game.

Your displacement in-game should look something like this image.

Displacements can be any side of a brush. We just used the top of the brush to make a ground, but sides of brushes can be used to make cliffs or cave walls. You can also have multiple sides of the same brush be displacements.

Sewing multiple displacements together

Now we'll make a new version to work with:

  • Go back to Hammer, go to File menu and choose Save As...
  • Change the name to tutorial06b.vmf.

We will use this file to make multiple displacement brushes and sew them together along their shared edges.

Duplicating the displacement brush.

Select the displacement brush.

In the Top viewport, duplicate the displacement by pressing Shift+Right_arrow keys.

Move the new displacement to the right so that its left edge lines up with the original displacement's right edge.

More displacement duplications.

Select both the displacement brushes and duplicate them again in the Top viewport by pressing Shift+Up_arrow keys.

Move them so that their bottom edge lines up with the original displacements' top edges.

Reshaping the displacement brushes.

Shape the brushes so that the top edge in the Top viewport is in the room.

Selecting the displacement brushes.

In the Camera viewport, select all the displacement brushes by holding Ctrl and clicking each of them.

You'll notice that none of their displacement edges line up currently (even though their brush edges do).

The Sew button on the Face Edit Sheet.

Click on the Hammer ToggleTextureApplication.png Toggle Texture Application icon.

In the Face Edit Sheet dialog box, click on the Displacement tab.

Click on the Sew Button to sew all the shared edges together.

Painting multiple displacements simultaneously.

You can also paint the geometry and the alpha with multiple displacements selected. It will edit shared points.

Press F9 and click on OK to run the level in the game.

Note.pngNote:You can try creating your own nav mesh for this level as you did in the Nav Meshes tutorial. Instead of marking the starting areas as PLAYER_START, try marking them as CHECKPOINT.

Rural Template map

The Left 4 Dead Authoring Tools also come with examples and templates for outdoor maps. Open the file "zoo_rural_01.vmf" to see them and copy them into your own levels.

By default, this map can be found at:

C:\Program Files\Valve\Steam\SteamApps\common\left 4 dead\sdk_content\mapsrc\zoo