Your First Left 4 Dead Map: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
Line 64: Line 64:


== Crescendo events ==
== Crescendo events ==
Intermediate objectives. "Crescendo Events" are much like smaller versions of the big finale battle at the end of each campaign, and occur at interesting places along the way
Intermediate objectives. "Crescendo Events" are much like smaller versions of the big finale battle at the end of each campaign, and occur at interesting places along the way, for instance the lift in the Waterworks part of No Mercy.


* <code>func_button</code>
* <code>func_button</code>

Revision as of 20:08, 8 December 2008

This article is currently a work in progress

This tutorial will cover the basics of Left 4 Dead map creation. It will explain the required entities, such as the director, weapons, and spawns. It will also answer some of the questions that Left 4 Dead mappers will have. This tutorial is not intended for new mappers: Basic level construction is already covered in other topics.


Tut title.png

Introduction sequences

In the first chapter, to prevent players from all spawning in the same location, the game uses 4 "info_survivor_position" entities and 4 "point_viewcontrol_survivor" entities. These entities create the camera zoom in on the survivors sequence. Although leaving these 8 entities out and the players spawning in the same location won't create any problems, the entities are fairly easy to set up and should at least be considered as a final touch before releasing a map to the public.

  • logic_choreographed_scene
  • point_viewcontrol_multiplayer
  • point_viewcontrol_survivor
  • info_survivor_position
  • env_fade

Spawn areas

The initial spawn area consists of:

  • an info_player_start to give players a starting point
  • health kits, usually 4 weapon_first_aid_kit_spawn entities
  • 2 weapons; weapon_smg_spawn and weapon_pumpshotgun_spawn.
  • an ammunition resupply, weapon_ammo_spawn

For spawn areas in later chapters of the campaign, you do not have to keep using the same weapons you used in the first map as most players will likely have already swapped these for other more powerful weapons they've found along the way. These more powerful weapons you can use in the spawn areas for the later chapters will usually consist of:

  • a weapon_rifle_spawn, weapon_autoshotgun_spawn, and a weapon_hunting_rifle_spawn.

If your spawn area has a "prop_door_rotating_checkpoint" to exit by, make sure the model is set to models/props_doors/checkpoint_door_01.mdl, the keyvalue "body" has value of 1, and the "Starts Open" flag is unchecked.

The Director

Instead of fixed spawn points for enemies, Left 4 Dead uses the "Director" to place enemies and items in varying positions and quantities based upon each player's current situation, status, skill and location.

  • info_director

Creating areas for the infected to spawn.

The director will spawn infected that are out of the line of sight, so for particularly difficult maps have plenty of places out of sight. Sometimes a spawn area is outside the normal player boundary. To let the infected into the playable area, there must be a func_simpleladder (with team set to 2) on the back side of the barrier, for them to climb over.

Item and weapon caches

Setting spawn flags to randomize the locations.

  • weapon_molotov_spawn
  • weapon_pipe_bomb_spawn
  • weapon_pistol_spawn
  • weapon_pain_pills_spawn
  • weapon_ammo_spawn
  • weapon_smg_spawn
  • weapon_first_aid_kit_spawn
  • weapon_hunting_rifle_spawn
  • weapon_rifle_spawn
  • weapon_autoshotgun_spawn
  • weapon_pumpshotgun_spawn

Rescue closets

Bringing dead players back into the game. Players respawn in a random closet that only their teammates can let them out of. Respawning players come back with basic equipment and without full health. These are fairly basic to make and only consist a room with a prop_door_rotating that contains three info_survivor_rescue entities.

Panic events

Triggering the info_director and summoning the horde.

  • info_game_event_proxy
  • ambient_generic
  • logic_timer
  • Examples
    • Car alarms
    • Metal detectors

Crescendo events

Intermediate objectives. "Crescendo Events" are much like smaller versions of the big finale battle at the end of each campaign, and occur at interesting places along the way, for instance the lift in the Waterworks part of No Mercy.

  • func_button
  • filter_activator_team
  • info_game_event_proxy

The safe house and changing levels

Each campaign is divided into several chapters marked by safe rooms, which are checkpoints where players can heal, re-arm, and dead players can return.

  • prop_door_rotating_checkpoint
  • info_landmark
  • trigger_changelevel
Note.pngNote:Make sure the info_landmark is named and that the landmark name is specified inside the trigger_changelevel settings along with the name of the next map to be loaded. Keep in mind the trigger_changelevel has to come in contact with the floor space inside the safe house due to how nav generation works. The trigger brush doesn't necessarily have to overlap the floor space, but it does have to at least touch it, or a good portion of where the nav square(s) will be generated. If the trigger_changelevel doesn't come in contact with the floor space, you will have nav errors when the map is loaded. For the prop_door_rotating_checkpoint, make sure the model is set to models/props_doors/checkpoint_door_02.mdl and the "Starts Open" option is checked inside the "flags" tab.

Building the navigation mesh

For survivor bots and infected to be able to move, you will need to create a navigation mesh ("mapname.nav" file) for your map. To build a basic mesh you need to have the map already compile and loaded, then open up the console in game and type the following:

sv_cheats 1
nav_edit 1
nav_mark_walkable
nav_generate
nav_analyze
nav_edit 0
sv_cheats 0

The map is reloaded twice during the process, once after nav_generate and again after nav_analyze, but the game should stay in edit mode when the map is reloaded.

Save fine tuning the mesh until after you are completely finished with the map's layout. The build sequence above should only be used for testing purposes. A nav mesh should be thoroughly examined and edited before releasing a map.

Note.pngNote:For more information related to advanced mesh creation and editing, please refer to Navigation Meshes.

After a map is compiled and the nav mesh is built, sometimes the director still won't spawn infected after the map is loaded. To get around this you don't need a point_clientcommand or logic_auto inside the map to start/enable the director every time the map is loaded, all you have to do is load the map and, assuming you've built the nav mesh already and "sv_cheats" is set to 1, type "director_stop" then "director_start" (without the quotes). You only have to do this once inside the map, then every time you load the map after that the director should start on it's own.

Again, the console commands to kick start the director are:

sv_cheats 1
director_stop
director_start
sv_cheats 0

Finale

Ending the campaign. In the final chapter of each campaign, the players must defend a position from an onslaught of Infected until a rescue vehicle arrives.

Notes

Doors

The door model and skin can vary. Use this picture for reference.
Type: prop_door_rotating
Frame Dimensions: width: 56, height: 104
World Model: models/props_doors/doormainmetal01.mdl

FAQ

  • How do I make the infected spawn?
    • Your map must have a info_director that is enabled, you also may have to use the console command "director_start".


  • Why won't the survivor bots move?


  • Why is the molotov fire / Smoker's smoke cloud not visible in-game?
    • This is usually due to the lack of a env_fog_controller entity. Also, check to make sure there were no errors generated during the map's compile process.


  • Why won't my rescue closets work?
    • Rescue closets will not function correctly if there are any nav errors present in the map (the "NAV ERRORS - Map is unplayable!" message appears in game). You will want to make sure the map's nav mesh is properly set-up.


  • How do I play my map in VS Mode?
    • VS Mode is enabled through the map's name. To create a VS Mode map, simply prefix the map's name with "l4d_vs_". For example, if you had a map named "oiltanker_engineroom", to make it into a VS map, just rename it to "l4d_vs_oiltanker_engineroom".


Error messages and what they mean

Navigation mesh related errors

  • The nav file was built for an older compile.

The errors below will cause the message "NAV ERRORS - Map is unplayable!" to be displayed in game when the map is loaded.

  • Missing nav file.
  • Missing Battlefield check found N areas
  • GetGoalArea: Cannot find SPAWN_RESCUE_CLOSET area in FINALE, thus cannot guarantee reachability of goal area.
  • GetGoalArea: Cannot find end area - no checkpoint or finale located.
  • ComputeFlowDistances: ERROR - Cannot compute flow.
Note.pngNote:To remove the "NAV ERRORS - Map is unplayable!" error message, make sure your map has an info_player_start, info_director, prop_door_rotating_checkpoint, info_landmark, trigger_changelevel, and a nav mesh.

Others

  • WARN: CL4DBasePanel::UpdateProgressBar called outside of level loading, discarded!
  • Engine Error: CModelLoader::FindModel: NULL name
    • This is caused by compiling the map using an outdated FGD. Older FGDs do not have the new values for the env_fog and light_environment entities, therefore you are compiling a BSP with missing information.
  • Assert, File: U:\dev\terror\src\tier0\memstd.cpp, Line: 1623, Assert: ***** OUT OF MEMORY! attempted allocation size: 536873088 ****

See also