L4D Mapping Notes

From Valve Developer Community
Revision as of 12:20, 20 January 2009 by Brandished (talk | contribs) (Split from - Your First Left 4 Dead Map (added some of my own notes))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This page contains a rough collection of notes and incomplete articles related to L4D mapping. Most of the contents will not likely be completed until after Left 4 Dead's SDK is released, upon which they should be split off into articles of there own.



Introduction sequences

In the first chapter, to create the "zoom in effect" the game uses 4 "info_survivor_position" entities and 4 "point_viewcontrol_survivor" entities. Although leaving these 8 entities out won't create any problems, the introduction sequence 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
  • Entity: logic_relay Name: relay_intro_start
  My Output > Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger director ForceSurvivourPosition   0.00 No
Io11.png OnTrigger director ReleaseSurvivourPosition   0.01 No

Later Spawn areas

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.

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
  My Output > Target Entity Target Input Parameter Delay Only Once
Io11.png OnGameplayStart relay_intro_start Trigger   0.00 No

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
  • prop_physics
    • for the green oxygen tank: models/props_equipment/oxygentank01.mdl
    • for the red gas can: models/props_junk/gascan001a.mdl
    • for the white propane tank: models/props_junk/propanecanister001a.mdl

Panic events

Triggering the info_director and summoning the horde.

  • info_game_event_proxy
  • ambient_generic
  • logic_timer
  • Examples
    • Car alarms
    • Door alarms
    • Fire alarms
    • Smoke detectors
    • Metal detectors
    • Explosions

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. There setup is very similar to panic events, except that they cannot be skipped. An in-game example being the Waterworks part of No Mercy, the survivors must fend off a horde of infected while they wait for the lift to arrive.

  • func_button
  • filter_activator_team
  • info_game_event_proxy
  • logic_relay
  My Output > Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger director PanicEvent   1.00 No

One method for changing levels

Add a trigger_changelevel inside the safe house at the end of the level and have it come in contact with the floor space inside the room. 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 and may have to manually mark the nav squares.

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

More on building the navigation 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.

Keep in mind, while the console commands above will build a basic mesh, it will be far from perfect and thus should only be used for testing purposes. A good nav mesh should be thoroughly examined and edited before releasing a map, which can often be a good deal of work depending on the map's structure. For this reason, its recommended that you save fine tuning the mesh until after you are completely finished with the map's layout. Significant changes in a maps structure may render an older nav mesh useless requiring it to be rebuilt from scratch.

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

Nav Attribute Descriptions

  • AVOID:
  • BATTLEFIELD:
  • BATTLESTATION: Seems to be used to mark defense areas near crescendo events
  • CHECKPOINT: This is used in both the starting and ending checkpoints. (safe rooms) This is how the game knows whether the survivors have left the safe room or not, and whether they have reached the end of a level or not. (I think. There don't appear to be any triggers doing this in the ones I decompiled.)
  • CROUCH:
  • CLIFF:
  • DOOR:
  • DONT_HIDE:
  • EMPTY: this will keep zombies from spawning in certain areas of the map. Large chunks of the level are marked empty/not empty. I've had some trouble with it working correctly when EMPTY was not the only marking assigned to the nav area.
  • ESCAPE ROUTE: Path that links the beginning checkpoint to the ending checkpoint or finale.
  • FINALE: The area is used in the finale crescendo event. The nav areas marked FINALE determine where the infected spawn and swarm from after the radio is triggered twice, areas not marked FINALE will _not_ be used by the director for spawning infected once the finale sequence has been triggered. When the survivors touch a finale nav square they will announce "where almost outta here" or similar.
  • JUMP: (Probably not L4D Specific) I found one area in the maps I looked at marked as "jump" - on top of a subway car only reachable by infected who could jump. This area likely signifies a place you must jump to somehow in order to reach.
  • NOT_CLEARABLE: Not sure what this does. This doesn't appear to be used.
  • NO_MOBS: Don't allow mobs to spawn in the area. This isn't used very often - one location is in the "drainage" level of the Death Toll campaign. It is used in the long pipes. This forces more mobs to spawn in the top of the right-side pipe while you're inside.
  • NO_JUMP:
  • NO_HOSTAGES:
  • NO_MERGE:
  • OBSCURED: The players cannot see this area at all (or hardly at all). The game uses these locations to spawn the massive hordes (if possible) - otherwise it will use areas that are far out of players' potentially visible sets of visleaves. (I think)
  • OBSTACLE_TOP:
  • PLAYER_START: This attribute is used in the exact nav mesh area(s) that the players spawn in. This appears to only be used in the very first level of each campaign - likely because after the first level it cannot be guaranteed where a player will spawn into the game (since you load relative to the landmark).
  • PRECISE:
  • RESCUE_CLOSET: Marks off the location of rescue closets inside the level
  • RESCUE_VEHICLE: This nav attribute marks the inside of a rescue vehicle, this nav will be locked until the finale sequence has been completed and the trigger_finale receives a "FinaleEscapeVehicleReadyForSurvivors" input.
  • RUN:
  • STOP_SCAN: Not sure what this does. This doesn't appear to be used.
  • STOP:
  • STAND:
  • STAIRS:
  • THREAT:
  • TRANSIENT:
  • WALK:

The Nav GUI

  • Fog: Whether or not the area has fog associated with it.
  • Incoming/Outgoing: (Probably not L4D Specific) Likely used to select areas with incoming or outgoing path information.
  • Max Light / Min Light: (Not L4D Specific) Used to select areas that have certain levels of light. (.25 max / 0 min for a dark place, 1 max / .75 min for a bright place)
  • Place: (Probably not L4D Specific) "Place" is the term used in nav creation to name specific areas. This is likely a way to select named/unnamed areas only.

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.

Setting up the radio

Entity: trigger_finale
Name: FinaleRadio
Description: This single entity is responsible for starting the finale sequence after being triggered twice.
  My Output > Target Entity Target Input Parameter Delay Only Once
Io11.png FinaleEscapeStarted EscapeRelay Trigger   5.00 No
FinaleEscapeStarted - ABOUT: Basically means "when the finale is finished, fire this output". This is usually used to trigger a relay to summon the rescue vehicle.
Note.pngNote:The VALVe maps use two seperate "func_buttons" for triggering this entity. This is possibly a last minute workaround on VALVe's part when they found playtesters starting finale sequences "by accident" since the trigger_finale can recieve "use" input itself when it's world model is set.


Adding the rescue vehicle

Entity: logic_relay
Name: EscapeRelay
Description: Triggered once the finale sequence has been completed. Starts the escape vehicles animations and moves it to the RESCUE_VEHICLE nav squares. When the vehicle is in place, the func_brush entities used to reach the RESCUE_VEHICLE nav areas are enabled.
  My Output > Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger RescueBrush Open   0.10 No
Io11.png OnTrigger FinaleRadio FinaleEscapeVehicleReadyForSurvivors   3.50 No
FinaleEscapeVehicleReadyForSurvivors - This "unlocks" the "RESCUE_VEHICLE" nav squares, upon which the survivor bots will rush towards them. Its a good idea to delay this to give the rescue vehicle enough time to get in position.
Note.pngNote:The VALVe maps also have trigger_hurt and trigger_push entities used to clear a path for the rescue vehicle and simulate it running something over.


Entity: func_door, Name: RescueBrush
  My Output > Target Entity Target Input Parameter Delay Only Once
Io11.png OnOpen TriggerEscape Enable   3.10 No
Io11.png OnOpen RescueBrushRamp Enable   3.10 No
Io11.png OnOpen RescueBrushGate Close   3.20 No


Entity: func_door, Name: RescueBrushDr1
Starts Open: Yes
Parent: RescueBrush


Entity: func_door, Name: RescueBrushDr2
Starts Open: Yes
Parent: RescueBrush


Entity: func_brush, Name: RescueBrushRamp
Start Disabled: Yes
Solidity: Toggle


Entity: trigger_multiple, Name: TriggerEscape
Description: Set to be enabled after the rescue vehicle animation finishes. When activated, triggers the VehicleLeaveRelay.
  My Output > Target Entity Target Input Parameter Delay Only Once
Io11.png OnEntireTeamStartTouch VehicleLeaveRelay Trigger   0.00 No


Entity: logic_relay, Name: VehicleLeaveRelay
Description: Used for controlling the rescue vehicle exit animations and firing the OutroRelay
  My Output > Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger RescueBrushDr1 Close   0.00 No
Io11.png OnTrigger RescueBrushDr2 Close   0.00 No
Io11.png OnTrigger RescueGate Open   0.00 No
Io11.png OnTrigger RescueBrushRamp Kill   0.00 No
Io11.png OnTrigger TriggerEscape Kill   0.00 No
Io11.png OnTrigger OutroRelay Trigger   0.00 No


Note.pngNote:The survivor bots seem to have limited nav detection when finding the rescue vehicle. For this reason, I recommend the RESCUE_VEHICLE nav squares connect with the other nav squares via ramp or drop down access; stairs, ladders, and "jump up" connects have been problematic.


Rolling the credits

Entity: logic_relay, Name: OutroRelay
Description: Ends the map and starts up the credits screen.
  My Output > Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger InstructorFinale GenerateGameEvent   0.00 No
Io11.png OnTrigger FinaleRadio FinaleEscapeFinished   4.00 No
Io11.png OnTrigger FadeOutro Fade   5.00 No
Io11.png OnTrigger OutroStats RollStatsCrawl   6.00 No
Io11.png OnTrigger FinaleRadio FinaleEscapeForceSurvivorPositions   7.00 No
Io11.png OnTrigger EndCamera Enable   8.00 No
FinaleEscapeForceSurvivorPositions - This enables the "info_survivor_position" entities to remove players from the battelfield.


Entity: env_fade Name: FadeOutro
Entity: env_outtro_stats Name: OutroStats
Entity: info_game_event_proxy Name: InstructorFinale
Entity: info_survivor_position Name: survivor_pos1
Entity: info_survivor_position Name: survivor_pos2
Entity: info_survivor_position Name: survivor_pos3
Entity: info_survivor_position Name: survivor_pos4
Entity: point_viewcontrol_multiplayer Name: EndCamera

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
Note.pngNote:If the prop_door_rotating_checkpoint set in anymore then 8 units from the area outside the safehouse the infected may try to climb over it.