Left 4 Dead Infected Populations

From Valve Developer Community
Revision as of 06:56, 14 February 2010 by NykO18 (talk | contribs) (Results of experimentation...)
Jump to navigation Jump to search

The Basic Idea

Infected populations control which kinds of common infected can be spawned in the different sections of your map.

For example, infected populations can cause:

  • patients, nurses, and surgeons to spawn in a hospital
  • military personnel to spawn in a military base
  • rural citizens to spawn on a farm
  • police officers to spawn on a street filled with police cars

Each defined population has a name and a list of model names with associated percentages. The percentages within each population add up to 100% and define how frequently each type of infected should be spawned within the area.

For example, the "hospital" population is defined as:

hospital
	{
		common_male01		15
		common_patient_male01 	40
		common_worker_male01	15
		common_female_nurse01	15
		common_surgeon_male01	10
	}

This means that any areas with the name "hospital" would spawn approximately:

  • 15% common_male01
  • 40% common_patient_male01
  • 15% common_worker_male01
  • 15% common_female_nurse01
  • 10% common_surgeon_male01

Additionally, the populations may also allow certain special infected to spawn. This is typically used in conjunction with Info_zombie_spawn. Currently only hunters, boomers, and smokers can be spawned through infected populations.

To specify populations within your map, your nav mesh areas must be given place names corresponding to those defined in population.txt, located within the "scripts" directory of your Left 4 Dead installation.

How To Use Them In a Map

  1. Load your map in Left 4 Dead.
  2. Enable cheats by typing "sv_cheats 1" into the console.
  3. Type "nav_edit 1" in the console to see the nav mesh.
  4. Type "nav_toggle_place_mode" into the console and hit enter (or use "nav_set_place_mode"). You should hear a beep signaling it was turned on. There is a different sound when you disable this.
  5. Type "nav_use_place <place name>" in the console. This is like picking the color of a paintbrush in an image editing program. It decides what place name will be used for all of the place commands. This place name will be referred to as your chosen place name.
  6. Paint your nav areas.
    1. Type "nav_place_floodfill" in the console to flood fill, using the chosen place name, all areas that can be reached from the nav area at which your cursor is pointed (as well as the area at which your cursor is pointed). You should use this first to set your map's default spawn type. For instance, if you're making a Hospital map but want to fine-tune a few areas, you want to set the entire map to use "hospital" so that there are no remaining nav areas using "default".
    2. You can paint areas individually using "nav_place_set".
    3. You can also turn on a special painting mode with "nav_toggle_place_painting". This command will paint every nav area you look at with the chosen place name.
    4. You can use "nav_place_pick" as a sort of eyedropper for your chosen place name. It will pick the place name from the area you are looking at at and use it as your new chosen place name.
  7. Type "nav_toggle_place_mode" into the console and hit enter (or use "nav_set_place_mode") to turn place mode off. You'll hear a different sound signifying that it has been turned off.
  8. Save the navigation mesh by typing "nav_save" into the console.
  9. Use "nav_edit 0" to turn off the nav grid display.

List of Useful Commands

nav_set_place_mode <0/1>
Sets the editor into or out of place mode. Place mode allows labeling of area with place names.
nav_toggle_place_mode
Toggle the editor into and out of place mode. Place mode allows labeling of area with place names.
nav_toggle_place_painting
Toggles place painting mode. When place painting, pointing at an area will 'paint' it with the chosen place name.
nav_place_list
Lists all place names used in the map.
nav_mark_unnamed
Marks all areas with no place name. Useful for finding stray areas missed while place painting.
nav_use_place <optional: place name>
If used without arguments, all available place names will be listed. If a place name argument is given, it becomes the chosen place name.
nav_place_floodfill
Sets the place name of the area at which your cursor is pointed to the chosen place name, and 'flood-fills' the chosen place name to all areas that can be reached from the area at which your cursor is pointed.
nav_place_pick
Changes the chosen place name to the place of the area under the cursor.
nav_place_replace
Replaces all instances of the first place name with the second place name.
nav_place_set
Sets the place name of all selected areas to the chosen place name.

List of Official Population Names

Urban

defaulturban
  • 30% common_male01
  • 25% common_female01
  • 15% common_male_suit
  • 10% common_police_male01
  • 10% common_military_male01
  • 10% common_worker_male01
police
  • 50% common_police_male01
  • 20% common_male01
  • 20% common_female01
  • 10% common_military_male01
maintenance
  • 35% common_worker_male01
  • 25% common_male01
  • 20% common_female01
  • 20% common_military_male01
hospitalgrounds
  • 20% common_male01
  • 20% common_female01
  • 15% common_police_male01
  • 15% common_military_male01
  • 15% common_worker_male01
  • 15% common_male_suit
hospital
  • 40% common_patient_male01
  • 15% common_male01
  • 15% common_worker_male01
  • 15% common_female_nurse01
  • 10% common_surgeon_male01
hospitalconstruction
  • 30% common_worker_male01
  • 20% common_patient_male01
  • 20% common_female_nurse01
  • 20% common_male01
  • 10% common_surgeon_male01
airport
  • 20% common_female01
  • 20% common_male_suit
  • 15% common_worker_male01
  • 15% common_male_baggagehandler_01
  • 15% common_tsaagent_male01
  • 15% common_male_pilot
airportfinale
  • 30% common_male_baggagehandler_01
  • 20% common_tsaagent_male01
  • 20% common_male_pilot
  • 10% common_female01
  • 10% common_male_suit
  • 10% common_worker_male01

Rural

defaultrural
  • 50% common_male_rural01
  • 20% common_female_rural01
  • 10% common_police_male01
  • 10% common_military_male01
  • 10% common_worker_male01

Special

church
Note.pngNote:This is used with the Info_zombie_spawn located inside of the safe room in the church of Death Toll 3 to spawn a random special infected once the crescendo event is finished.
  • 50% boomer
  • 25% hunter
  • 25% smoker

Default and Others

default
  • 30% common_male01
  • 25% common_female01
  • 15% common_police_male01
  • 10% common_military_male01
  • 10% common_worker_male01
  • 10% common_male_suit
test_common_male_suit
  • 100% common_male_suit
zoo
  • 20% common_male01
  • 10% common_female01
  • 10% common_male_rural01
  • 10% common_male_suit
  • 5% common_female_rural01
  • 5% common_female_nurse01
  • 5% common_male_baggagehandler_01
  • 5% common_male_pilot
  • 5% common_military_male01
  • 5% common_patient_male01
  • 5% common_police_male01
  • 5% common_surgeon_male01
  • 5% common_TSAAgent_male01
  • 5% common_worker_male01

List of Population-Supported Infected Types

Common Infected

  • common_female01
  • common_female_nurse01
  • common_female_rural01
  • common_male01
  • common_male_baggagehandler_01
  • common_male_pilot
  • common_male_rural01
  • common_male_suit
  • common_military_male01
  • common_patient_male01
  • common_police_male01
  • common_surgeon_male01
  • common_tsaagent_male01
  • common_worker_male01
Todo: Add small pictures for each of the common infected types for a quick reference.

Special Infected

  • boomer
  • hunter
  • smoker
Warning.pngWarning:Attempting to use "witch" or "tank" in a population will result in a common infected with the witch or tank model and animations.

Creating a User-Defined Population

Todo: Figure out how to create and use a custom Population and include it with an add-on.

For the moment, creating a custom infected population does not seem to be supported by the game. If you try to create your own population.txt file and embed it in your VPK, the game will just crash when you try to load your campaign and the linux server will segfault.

Warning.pngWarning:You should never try to create a custom population for your map by editing the game's official left 4 dead/left4dead/scripts/population.txt file.

You should never overwrite another user's official population.txt file by including one in an archive with your map or by telling them to modify it themselves. However, embedding one in an add-on VPK is fine as it will not overwrite the official one.

Altering the official population.txt file could break it and cause problems with your game installation. It is also possible that this file would be overwritten in an update or by one packaged in a poorly-informed map author's archive, undoing any previous population definitions.
Warning.pngWarning:Specifying a default Left 4 Dead infected population for any area in a campaign makes your campaign unable to be played correctly under the Left 4 Dead 2 Add-on Support compatibility mode. When doing so, Left 4 Dead 2 will attempt to load the infected populations from the first game and while this will work, most of the zombies will glow fluorescent in the dark and none of them will support the damage localization of the second game. As a matter of fact, the holes and wounds created by the weapons on the infected will appear but there won't be any real damage done to the infected skin, making the whole result look awkward and ugly.

See also