Maps
Gamemode Guide: Zombie Survival

Introduction

A Zombie Survival map is a normal Source map, built in Hammer, with a handful of extra entities that tell the gamemode where survivors start, where zombies come from, and what players can buy. If you have made a Counter-Strike or Garry's Mod map before, you already know most of what you need.

To build one you need:

  • Hammer++, which comes bundled with the Lambda Content Authoring Tools.
  • The Zombie Survival FGD, lambda_zombie_survival.fgd, installed exclusively through the Content Authoring Tools. Once installed, every entity in this guide appears in the entity list.
  • A map name starting with lz_. The gamemode only picks up maps with this prefix, for example lz_office.

This guide covers how a map plays, every entity you can place, how to make the opening titles and game over sequence look good, and the checks to run before you release.

How a map plays

Four survivors start in one part of your map and fight through 30 waves, buying their way into the rest of it as they go. Your job is to give them a starting area, more areas to unlock, places to restock, and somewhere for the zombies to come from.

A run goes like this:

  1. Opening titles. The run opens with a story on a black screen, then a camera fly-through of your map with its name, location and authors.
  2. Prepare. A short countdown before each wave. Survivors can move, shop and open new areas.
  3. Wave. Zombies spawn out of sight around the survivors and hunt them down. Every fifth wave adds a boss.
  4. Wave cleared. The map is cleaned up and the next wave is prepared. Survivors who fell come back.
  5. Game over. Clearing wave 30 wins, and losing the whole squad ends the run. Either way, the game over sequence films your map again while each survivor's stats count up.

Areas are the heart of a map. Your starting area is always open. Every other area sits behind a barrier that the team buys open with shared money. Supplies and zombie spawns belong to an area, and only appear once it is open.

The map resets every wave. Between waves the gamemode cleans up the map, which puts doors, breakables and your map logic back as they started. Opened areas stay open: their barriers fire OnAreaOpened again after the cleanup, so anything wired to that output opens again too.

Getting started

The bare minimum is a navigation mesh and one regular info_zs_zombie_spawn. Without either, the first wave never starts and the server says why. Everything else makes the map better, and the rest of this guide covers it.

A typical workflow:

  1. Plan your areas. Sketch the starting area, the areas that open off it, and the doorways where barriers will go. Most layout problems are cheaper to fix on paper.
  2. Build the map in Hammer as you normally would.
  3. Place the gameplay entities: survivor and zombie spawns, barriers, supplies and drone spawns.
  4. Add the presentation: map details, a story, intro and outro cameras, and any transmissions.
  5. Compile, then build the navigation mesh, in game or with the Nav Mesh Generator, and tidy it by hand.
  6. Make a radar overview so the radar and the tablet's map can show your level.
  7. Test it with the checklist at the end of this guide.

When you release, ship the .nav file with the .bsp, along with your radar overview. Rebuild the navigation mesh whenever you recompile the map, or it will no longer match the level.

Areas and barriers

An area is just a name. The zs_area_barrier that seals it off uses the name as its Name (targetname), and everything inside the area uses the same name in its Associated Area key. Anything with a blank Associated Area belongs to the starting area, which is always open.

Area Barrier Diagram

The barrier's name is the area's name: everything inside points at it, and its OnAreaOpened output clears the nav blocker in its doorway.

Survivors press Use on a barrier to buy it with the team's money. It rises out of the way and is removed, and the area's supplies appear straight away.

Key Default What it does
Name The area's name. Required: a barrier without a name can't be bought.
Price 500 Team money needed to open it.
Open Height 128 How far it rises as it opens, in units, before it is removed.
Open Duration 1.5 Seconds it takes to rise. 0 removes it at once.
  • Open input: opens the area without charging the team, for scripted events or a free first door.
  • OnAreaOpened output: fires when the area opens, and again after every wave's cleanup.

One area, several barriers. Barriers that share a name open together for one payment. Use this for an area with more than one entrance, or to cover a doorway wider than one barrier. Give them all the same price, because the team pays whatever the barrier they used asks.

Block the navigation mesh at every barrier. Zombies, survivor bots and delivery drones find their way along the navigation mesh, so it must not lead through a locked doorway. Put a func_nav_blocker across each barrier's doorway, set to block when the map starts, and wire the barrier's OnAreaOpened to the blocker's UnblockNav input. The cleanup between waves brings the blocker back, and the barrier's OnAreaOpened clears it again. Skip this and nothing can find its way into an area from the wave after it was bought.

Spawns

Survivor spawns

Place info_zs_human_spawns in your starting area. Survivors start a run here, and anyone who fell comes back here at the start of the next wave.

The Character key picks who uses the spawn: 1 for Sir Bloody Darryl, 2 for 'The Doctor' Romanov, 3 for Special Agent Ava and 4 for the B Squadron Officer. 0 (listed as Random in Hammer) is a shared spawn any survivor can use. Each survivor tries their own spawns first, then the shared ones, skipping any that are blocked. A map with none falls back to info_player_start.

One spawn per survivor plus a few shared ones is plenty.

Zombie spawns

Place info_zs_zombie_spawns through every area, out of the way of where players stand.

Key What it does
Spawn Type Regular spawns are for normal zombies. Boss spawns are only used for bosses.
Associated Area The spawn is only used once this area is open. Blank means the starting area.
Zombie Class Forces every zombie from this regular spawn to be one type: Shambler, Runner, Soldier, Bloater, Crawler or Headcrab. Leave it blank to use the wave's own mix.

The gamemode picks spawns for you each time a zombie appears:

  1. Free spawns that no survivor can see, between 384 and 2,500 units from the nearest survivor.
  2. If there are none, free spawns no one can see that are further away.
  3. If there are still none, any free spawn.

A spawn counts as hidden when no survivor can see a point 48 units above it. A zombie that gets stuck is also moved to a hidden spawn near the survivors, so spawns in every area keep the action close.

Bosses use boss spawns in open areas when there are any, and regular spawns otherwise. Bosses are big, so put boss spawns in large rooms with plenty of headroom.

Supplies

Boxes

Each box spawn puts its box at the spawn's position and angles once its area is open. All three have an Associated Area key, and fire OnBoxSpawn when a box appears there.

Entity What appears Notes
info_zs_ammo_box_spawn An ammo box Every spawn in an open area gets one. Survivors pay to top up their spare ammo.
info_zs_weapon_box_spawn A weapon box offering one gun Weapon Type picks the category: Pistol, SMG, Mid-Tier (which includes SMGs), Rifle (which includes snipers), Grenades, Healthshot or All. The offer changes every wave.
info_zs_mystery_box_spawn The Mystery Box Only one is on the map at a time, at a random open spawn each wave. When it rolls the bear, it moves to a different open spawn.

The Mystery Box needs at least two open spawns before it can roll the bear and move, so give the starting area two, and add more in later areas.

Drone spawns

Delivery drones fly crates to survivors who order from their tablet. An info_zs_drone_spawn is where they enter and leave the map: a vent, a window, a roof hatch. The drone launches from the spawn, follows the buyer, drops the crate, flies back the way it came and is removed at the spawn.

  • Placement: keep each spawn within 1,024 units of the navigation mesh, with a clear flight down to it. Drones fly along the mesh about 96 units up, dropping under low ceilings and flying straight up and down ladder shafts. The spawn's yaw is the drone's starting heading.
  • Which spawn launches: the nearest enabled spawn in an open area that has a route to the buyer. Only the closest three are tried, so put spawns in every area. If none can reach the buyer, their tablet says so and they aren't charged.
  • Associated Area: as for the boxes.
  • Start Disabled, Enable and Disable: switch a spawn on and off. A disabled spawn launches nothing, but drones already out still return to it. A named spawn keeps whatever its inputs last set for the rest of the run, even through each wave's cleanup.
  • OnDroneLaunch and OnDroneReturned: fire as a drone leaves and when it flies back in, with the drone as the activator. Use them to open a hatch and close it again.

Presentation

These entities don't change how the map plays, but they decide how it looks in the opening titles, the game over sequence and the tablet.

Map details

Place one info_zs_map_details. Its keys fill the map card in the opening titles, and any you leave blank are hidden.

Key Example Shown as
Display Name Office The map's name. Blank uses the map's normal display name.
Location London, England A line under the name.
Country gb A flag. Use the two-letter country code.
Authors Your name The credits.

Story

Place one info_zs_story to tell your map's own story on the black screen at the start, in place of the default one. It has up to three parts, each with a Title (a short tag such as "The Job") and a Text.

  • Parts without text are skipped, and a part without a title has no tag.
  • Words between asterisks are highlighted, for example *Phoenix Connexion*.
  • The parts share 20.5 seconds by word count, so keep them about the same length. Around twenty words each reads comfortably.

Intro cameras

After the story, the view flies through your map along a chain of info_zs_intro_cameras, timed to the intro music. The fly-through gets about 27 seconds.

  • Link them up. Give each camera a name and point its Next Camera at the one after it. Tick First Camera on the first and Last Camera on the last.
  • Hold Time (2 seconds when placed) is how long the view rests on a camera before moving on. Set it to 0 to make a waypoint the view curves through without slowing. The last camera holds until the titles end.
  • Speed is automatic. The moves share the time left after the holds by how far they travel, and turning counts as distance too (each degree as 5 units). Long holds leave less time to move. If they would leave less than half a second per move, the holds shrink to fit.
  • Aim every camera. The view uses each camera's own angles, including waypoints, and its path never overshoots a camera.
  • OnCameraActive fires as the view reaches each camera.

A map without intro cameras goes straight from the story to the logo, so the titles end early.

Outro cameras

The game over sequence films about 36 seconds of your map behind the survivors' stats. Place info_zs_outro_cameras and it cuts between still shots from them in a random order, about every 6 seconds, dipping to black between shots.

  • Every camera shows once before any repeats, and none shows twice in a row, so six cameras fill the sequence without a repeat.
  • A single outro camera holds for the whole sequence.
  • OnCameraActive fires as each shot comes up.

Without any outro cameras, the intro fly-through plays again instead.

Transmissions

The tablet's Transmissions app is an inbox of story messages, decrypted as the squad clears waves. Each info_zs_transmission adds one of your own, listed by wave among the built-in ones. Players keep what they decrypt for good.

Key What it does
Unlock Wave Decrypted when the squad clears this wave on your map.
Sender Who it is from, for example LAMBDA SECURITY DIRECTIVE // COMMAND.
Subject Its subject line in the inbox.
Message Its text. Write \n to start a new paragraph.

A map can have up to 31, and one without a message is ignored. Finish them before you release. Players' progress is saved by the transmissions' order (wave, then subject), so adding, removing or reordering them later can change which ones players have decrypted.

Zombies, survivor bots and delivery drones all find their way using the navigation mesh, so it is worth getting right.

  1. Place an info_player_start in the starting area. Generation starts from player spawns, and survivors use it if your map has no survivor spawns.
  2. Load the map, turn on sv_cheats 1 and run nav_generate. It saves maps/{map}.nav when it finishes.
  3. If an area is missing, stand in it, run nav_mark_walkable, then nav_generate again.
  4. Tidy it by hand with nav_edit 1.

You can also generate the mesh out of game with the Nav Mesh Generator in the Content Authoring Tools. Still load the map to view the result in game and tidy it up. Any mesh generated out of game also needs nav_analyze run on it.

What each part of the mesh does:

  • Ladders: zombies climb nav ladders up and down, and drones fly straight up and down the shaft.
  • Jump and climb connections: zombies follow them, so a ledge they should be able to climb needs one.
  • Crouch areas: zombies shrink to fit through them.
  • Blocked areas: a func_nav_blocker keeps everything out until its barrier is bought (see Areas and barriers).

Radar overview

The HUD radar and the tablet's Map app both draw the same overview as Lambda's Counter-Strike maps, materials/lambda/radar/{map}_json.vmt, including its minimap volumes and altitude layers. On top of it, the tablet marks locked areas with their prices, supply boxes, teammates and pings.

Cartographer, part of the Content Authoring Tools, generates the radar for you automatically. See Generating radars for how to set your map up for it.

Without an overview the radar falls back to its default image, and the tablet's Map app shows "NO MAP DATA".

Best practices

Layout

  • Stock the starting area for the first few waves. An ammo box, a weapon box or two, two Mystery Box spawns, a drone spawn, and zombie spawns all round it.
  • Build loops, not dead ends. Survivors stay alive by moving. Rooms with two ways out and corridors that join back up let them lead a horde around. Keep one-door rooms as a deliberate risk.
  • Open the map in steps. A few areas off the starting area give the team a choice, and areas that open off those give a sense of progress.
  • Give every area a reason to buy it: an ammo box, a better weapon box, a Mystery Box spot, or a shortcut.

Barriers

  • Price by distance and reward. Start near the default $500 for the first doors, and charge more for areas deeper in or with better supplies.
  • Use the Open input for set pieces, such as a door that opens when the power comes back on.
  • Make barriers easy to spot. Survivors need to see what they can buy, so light barrier doorways well.

Zombie spawns

  • Hide them. Behind corners, in side rooms, vents and windows. A spawn survivors can see is only used when nothing better is free, and then zombies appear in plain view.
  • Spread them. Zombies prefer spawns 384 to 2,500 units from the nearest survivor, so cover every area well enough that there is always a hidden spawn in that range.
  • Mind player clip. Zombies can spawn behind player clip: bots shoot the ones they can see and chase them once they come out.
  • Give bosses room. Boss spawns belong in large, high rooms. The Behemoth throws physics props, so a few loose props make for a better fight.

Drones

  • Keep trips short. A drone spawn in every area means a quick delivery wherever the squad is.
  • Make them look good. A hatch or shutter opened by OnDroneLaunch and closed by OnDroneReturned sells the moment.

Presentation

  • Show off the map in the fly-through, and end it near the starting area so the cut back to the survivors feels natural.
  • Pick six outro shots of your most memorable spots, so the game over sequence never repeats one.

Performance

Up to 24 zombies can be alive at once, alongside four survivors, drones and sentries. Optimise visibility as you would for a Counter-Strike map, with areaportals and hint brushes, and avoid huge open sightlines across the whole level.

Testing checklist

Run through these before you release. Survivor bots fill the empty spots, so you can test most of it on your own.

  • The map's name starts with lz_, and the .nav comes from the latest compile.
  • Each survivor starts at their own spawn, and nobody spawns stuck.
  • Zombies appear out of sight in every area and reach the survivors, using your ladders, jumps and crouch spots.
  • Every barrier opens for its price, its supplies appear straight away, and barriers sharing a name open together.
  • In the next wave, opened areas are still open, and zombies, bots and drones still find their way into them.
  • The Mystery Box rolls the bear and moves to another spawn.
  • Each weapon box offers a gun from its category.
  • A drone can reach you in every area, and any hatches open and close.
  • Each boss fits where it spawns and can reach the survivors.
  • The opening titles show your story, map card and flag, and the fly-through runs smoothly from the first camera to the last.
  • The game over sequence shows your outro cameras.
  • Your transmissions decrypt on their waves and read well on the tablet.
  • The radar and the tablet's Map app show your overview.
  • A long run holds up late on, when the map is fully open and the waves are big.