L4D Level Design/Level Organization

Jump to: navigation, search

By now, you may have noticed a vmf file included in this tutorial called "tutorial_standards.vmf". Open Hammer and open this file.

This file contains a lot of examples of how Valve did things in the original Left 4 Dead levels.

Make sure you have "tutorial_standards.bsp" and "tutorial_standards.nav" in your left4dead\maps directory and load it up to see some of these examples.

[edit] Copy/Paste

Copy/Paste works similar with other programs. Use Ctrl+C to copy a brush or entity and Ctrl+V to paste it.

A great feature that Hammer has is that you can copy and paste parts of levels from one file to another. For example, you can copy the staircase in the tutorial_standards.vmf to your own map.

Find the metal staircase in the level shown here:

Selecting the standard metal staircase.
Selecting the standard metal staircase.

Select it by left-clicking on it.

Copy it by pressing Ctrl+C or by using Edit > Copy.

Open the map you want to paste it into.

Position your mouse over the window and the place where you want to paste it.

Paste it by pressing Ctrl+V or by using Edit > Copy.

You can now move it around or edit just like it was created in your level.

You can also paste special. Try using it by pressing Ctrl+Shift+V or by using Edit > Paste Special.

The Paste Special Dialog Box will appear:

The Paste Special dialog box.
The Paste Special dialog box.

If you leave the fields as default settings and click OK, the stairs will be pasted into your map in the exact position they were located in the map you copied them from.

[edit] Groups/Objects/Solids

Hammer allows you to combine objects together to make editing a bit easier. For example, you can combine light entities, the prop_static for the light source, and an env_sprite to represent the glow of the light.

In tutorial_standards.vmf, find the light group in the starting room:

Selecting the light group used in the starting room.
Selecting the light group used in the starting room.

Select it by left-clicking on any of the entities that are part of the group.

You can then duplicate this group or copy/paste it throughout your level.

To group objects together, simply select all the objects you want combined and press Ctrl+G or use Tools > Group from the menu.

Selecting Group from the Tools menu.
Selecting Group from the Tools menu.

Similarly, you can select a group and ungroup the objects that form it by pressing Ctrl+U or by using Tools > Ungroup.

Selecting Ungroup from the Tools menu.
Selecting Ungroup from the Tools menu.

You'll notice in the Select Box in Hammer, there are 3 ways to select:

  • Groups
  • Objects
  • Solids

You just found out what a Group is – where you combine different kinds of objects together. An Object is a single component of a level such as a world brush or a func_detail. It could also be an entity such as a light, a prop_static, or a door.

Switch to Objects Mode and now select just the light underneath the light group that was just selected.

Selecting individual objects that in a group.
Selecting individual objects that in a group.

Some of these components (func_detail, func_brush, etc.) maybe be made up of multiple solids which are brushes created and then combined into a single object.

For example, you can have all of the stairs in the staircase example in tutorial_standards.vmf as a single func_detail. If you wanted to remove a few steps, you can switch to Solids Mode and select the steps you want to remove.

Switch to Solids Mode now and select the bottom 2 steps of the staircase.

Selecting individual brushes in a brush entity.
Selecting individual brushes in a brush entity.

You can then delete these solids or duplicate them to make more stairs.

Image:note.png Note: Any time you duplicate or copy/paste solids, they will not retain their brush entity properties. You will need to use Ctrl+T or Tools > Tie to Entity to recreate them as brush entities. If you select the full staircase in Objects Mode and the new solids that you want to tie them to, you can use Ctrl+T to combine them back to the original brush entity.

[edit] Visgroups

Hammer also allows you to place objects into visgroups. Visgroups are groups of objects that you turn on/off to help you organize your level and to help you edit your level without having to see everything in it all at once.

Select the staircase again but this time also select the railing and the catwalk that are connected to the staircase.

Selecting the staircase, the railing and the catwalk.
Selecting the staircase, the railing and the catwalk.

Now, click on the dotted red cube on the Menu Bar:

Image:l4d_hammer_visgroups_02.jpg

This will bring up the Visgroup dialog box.

The Visgroup dialog box.
The Visgroup dialog box.

You can place the objects into an existing group by clicking on the dot next to "Place object in existing visgroup" and selecting the visgroup you want to add it to. You can also create a new visgroup by typing a new name in the box and clicking OK.

The new visgroup was called "Stairs" in this example.

When you click OK, you'll notice that the stairs, railing, and catwalk are gone from your views. This means that they are now hidden in the visgroup "Stairs".

The staircase, railing and catwalk are now hidden in a visgroup.
The staircase, railing and catwalk are now hidden in a visgroup.

By clicking on the box to the left of Stairs in your VisGroups box, you can toggle on and off the stairs, railing, and catwalk.

You can now hide these objects when you want to continue editing and it may help to see things better.

Auto visgroups are also very helpful.

Click on the Auto tab in the VisGroups box and you will see the visgroups that Hammer automatically creates for you.

The Auto VisGroups tab.
The Auto VisGroups tab.

By clicking on the box next to each of these categories, you can hide or reveal any of these categories of objects.

For example, move around the Camera viewport of the tutorial_standards level with all the auto visgroups on. Then, turn off Brush Entities and Clips and see what a difference it is.

Image:note.png Note: Be careful when hiding visgroups. Your level will compile with the visgroup off. Make sure you double click on the box to the left of "Auto" in the Auto VisGroups tab and then save before you compile the map. By doing this, all the auto visgroups will be toggled to on.