Your First Left 4 Dead Map: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (notes)
(added info)
Line 29: Line 29:
* <code>info_director</code>
* <code>info_director</code>


The director will spawn zombies that are out of the line of sight. Sometimes this is outside the normal player boundary. To let the zombies into the playable area, there must be a <code>func_simpleladder</code> (with team set to 2) on the back side of the barrier, for them to climb over.
The director will spawn infected that are out of the line of sight. Sometimes this is outside the normal player boundary. To let the infected into the playable area, there must be a <code>func_simpleladder</code> (with team set to 2) on the back side of the barrier, for them to climb over.




Line 51: Line 51:
* <code>prop_door_rotating</code>
* <code>prop_door_rotating</code>
* <code>info_survivor_rescue</code>
* <code>info_survivor_rescue</code>
<!--
** <code>rescueEyePos</code>
This doesn't seem to affect whether the rescue closets work or not
-->




Line 79: Line 75:
* <code>info_landmark</code>
* <code>info_landmark</code>
* <code>info_changelevel</code>
* <code>info_changelevel</code>
{{note|Keep in mind the <code>trigger_changelevel</code> 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 <code>trigger_changelevel</code> doesn't come in contact with the floor space, you will have nav errors when the map is loaded.}}
{{note|Make sure the <code>info_landmark</code> is named and that the landmark name is specified inside the <code>info_changelevel</code> settings along with a map name. Keep in mind the <code>trigger_changelevel</code> 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 <code>trigger_changelevel</code> doesn't come in contact with the floor space, you will have nav errors when the map is loaded.}}




Line 113: Line 109:
== Notes ==
== Notes ==
<!--  
<!--  
This is a rough list of notes for now, eventually these notes should be integrated into the article and removed from here.
This is a rough list of notes for now, eventually these notes should be integrated into the article (if possible) and removed from here.
-->
-->
'''Doors'''
'''Doors'''
Line 119: Line 115:
:'''Frame Dimensions:''' '''width:''' 56, '''height:''' 104
:'''Frame Dimensions:''' '''width:''' 56, '''height:''' 104
:'''World Model:''' models/props_doors/doormainmetal01.mdl
:'''World Model:''' models/props_doors/doormainmetal01.mdl
'''NAV ERRORS - Map is unplayable!'''
*you can remove this with 8 entities and a properly built nav mesh
:4 <code>info_survivor_position</code> entities, an <code>info_director</code>, <code>prop_door_rotating_checkpoint</code>, <code>info_landmark</code>, and an <code>info_changelevel</code>




== FAQ ==
== FAQ ==


* How do I make the infected spawn?  
* '''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".
** Your map must have a [[info_director]] that is enabled, you also may have to use the console command "director_start".
<br>
<br>
* Why won't the survivor bots move?
* '''Why won't the survivor bots move?'''
** The most likely cause is a faulty or missing .nav file. ''See [[Navigation Meshes]]''
** The most likely cause is a faulty or missing ".nav" file. ''See [[Navigation Meshes]]''
<br>
<br>
* Why is the molotov fire / Smoker's smoke cloud not visible in-game?
* '''Why is the molotov fire / Smoker's smoke cloud not visible in-game?'''
** (not answered)
** This is usually due to the lack of a <code>env_fog_controller</code> entity.  You also want to make sure no errors were generated during the map's compile process.
<br>
<br>
* Why won't my rescue closets work?
* '''Why won't my rescue closets work?'''
** Rescue closets will not function correctly if there are any nav errors present in the map.  You will want to make sure Your nav mesh is properly set-up and you don't see the "NAV ERRORS - Map is unplayable!" message in game.
** Rescue closets will not function correctly if there are any nav errors present in the map.  You will want to make sure Your nav mesh is properly set-up and you don't see the "NAV ERRORS - Map is unplayable!" message in game.


Line 143: Line 135:
=== Navigation mesh related errors ===
=== Navigation mesh related errors ===
These usually result with a message of "'''NAV ERRORS - Map is unplayable!'''" displayed in game when the map is loaded.
These usually result with a message of "'''NAV ERRORS - Map is unplayable!'''" displayed in game when the map is loaded.
* Missing [[Navigation Meshes|nav file]].
* '''Missing [[Navigation Meshes|nav file]].'''
* The nav file was built for an older compile.
* '''The nav file was built for an older compile.'''
* Missing Battlefield check found N areas
* '''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 SPAWN_RESCUE_CLOSET area in FINALE, thus cannot guarantee reachability of goal area.'''
* GetGoalArea: Cannot find end area - no checkpoint or finale located.  
* '''GetGoalArea: Cannot find end area - no checkpoint or finale located.'''
* ComputeFlowDistances: ERROR - Cannot compute flow.
* '''ComputeFlowDistances: ERROR - Cannot compute flow.'''
{{note|To remove the "NAV ERRORS - Map is unplayable!" error message make sure your map has at least an <code>info_player_start</code>, <code>info_director</code>, <code>prop_door_rotating_checkpoint</code>, <code>info_landmark</code>, and an <code>info_changelevel</code> along with a working nav mesh.}}
 


=== Others ===
=== Others ===
* WARN: CL4DBasePanel::UpdateProgressBar called outside of level loading, discarded!  
* '''WARN: CL4DBasePanel::UpdateProgressBar called outside of level loading, discarded!'''
* Engine Error: CModelLoader::FindModel: NULL name
* '''Engine Error: CModelLoader::FindModel: NULL name'''
* Assert, File: U:\dev\terror\src\tier0\memstd.cpp, Line: 1623, Assert: ***** OUT OF MEMORY! attempted allocation size: 536873088 ****
** This is caused by compiling the map using an outdated FGD which does not have the new values for the <code>env_fog</code> and <code>light_environment</code>. Therefore your 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 ****'''





Revision as of 20:49, 3 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

  • logic_choreographed_scene
  • point_viewcontrol_survivor
  • point_viewcontrol_multiplayer
  • env_fade


Spawn area

  • info_survivor_position
  • weapon_first_aid_kit_spawn
  • weapon_ammo_spawn
  • weapon_smg_spawn
  • weapon_pumpshotgun_spawn


The Director

Creating areas for the infected to spawn.

  • info_director

The director will spawn infected that are out of the line of sight. Sometimes this 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

Set spawn flags to randomize

  • 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.

  • prop_door_rotating
  • info_survivor_rescue


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

  • func_button
  • filter_activator_team
  • info_game_event_proxy


The safe house and changing levels

  • prop_door_rotating_checkpoint
  • info_landmark
  • info_changelevel
Note.pngNote:Make sure the info_landmark is named and that the landmark name is specified inside the info_changelevel settings along with a map name. 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.


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.


Notes

Doors

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. You also want to make sure no errors were 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. You will want to make sure Your nav mesh is properly set-up and you don't see the "NAV ERRORS - Map is unplayable!" message in game.


Error messages and what they mean

Navigation mesh related errors

These usually result with a message of "NAV ERRORS - Map is unplayable!" displayed in game when the map is loaded.

  • Missing nav file.
  • The nav file was built for an older compile.
  • 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 at least an info_player_start, info_director, prop_door_rotating_checkpoint, info_landmark, and an info_changelevel along with a working 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 which does not have the new values for the env_fog and light_environment. Therefore your 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