How to read enemy numbers
Count ranges, family shares, placement rules and room modifiers: what each number on the enemy spawn pages means, and what it does not.
Three kinds of number
- Intensity: how many spawns a context tries to place. Each generation context draws one whole number, uniformly from its count range, every time it runs. E[count] = (lo + hi) / 2 exactly. This is the only “how many” rule the game has: there is no per-area or per-square-metre spawn rate. exact
- Conditional type share: what one placed spawn is. Given that a spawn is placed, the chance it is a given enemy family is that family's weight divided by the sum of the weights (the denominator is always shown). Zombie types (coated, shambler) are a further split of the Infected family only. conditional
- Placed and observed counts: what a generated level actually holds. The generator can place fewer spawns than it drew when eligible floor, spacing, per-area caps or tries run out. Observed counts and densities on these pages come from a small labelled sample of generated levels, never from the runtime rules. sampled
On top of the per-spawn roll: the seeded roster. One roll per family per level decides whether that level holds the family at all; a family rolled absent has none there, and a roster-only family is placed by the roster alone. It changes which family an ordinary zombie slot is, never how many enemies a level has. Sampled figures say whether they were taken before or with the roster pass. seeded per level
Terms and units
| Term | Unit | Definition |
|---|---|---|
| count range | spawns per run of a context | The generator draws ONE uniform integer U{lo..hi} per run of a generation context (inclusive): the number of spawns that run tries to place. There is no per-area spawn density at runtime. |
| E[count] | spawns per run | Exact expectation of the count draw, (lo + hi) / 2. Per level: Σ runs × E[count] over the contexts. |
| area weight | relative (no unit) | Relative preference of an area in the weighted area order (Efraimidis–Spirakis keys u^(1/w)): areas with more weight tend to be visited earlier in each cap pass. Never a chance and never a count. |
| cap | spawns per area | Most spawns an area may hold after each pass (passes 1, 2, 3); platforms hold one more, closets / closed exits / storefront units at most one. |
| family weight | relative (no unit) | Weight of an enemy family in the level pool; only meaningful against the denominator Σ weights. |
| share | conditional chance per placed spawn | weight / denominator: the chance that the roll of ONE placed spawn draws that family (an independent per-spawn roll keyed on level seed + spawn index that REPLACES a zombie). For a family without an eligibility rule that is the share the per-spawn roll places; a restricted family places fewer (see eligibility). The seeded roster then decides per level whether the family is there at all (see seeded roster). Not a chance per area or per m². |
| eligibility | rule per family and level | Where a restricted family may take a placed slot (contexts, rooms, clearance, doorways, fair passage, a per-level cap). A draw that fails it becomes the fallback family (a zombie): the other families' draws never change, and the restricted family's placed count is measured by the sampled eligibility census. |
| tier | integer ≥ 0 per level | The level's explicit difficulty tier (Subway 0 = the starting level). Metadata only: nothing scales counts, damage or loot by it, and no family is enabled by it. |
| family stats | hp, m/s, m, s | Health (hp), wander / chase speed (m/s), attack range (m, centre to centre) and damage per hit (hp), swing length / impact / recovery (s), sight range and body radius (m), read from each family's exported constants. |
| placed | spawns | What the generator actually placed: below the count when the eligible, spaced cells run out (Subway attempts with fewer than the accepted minimum, and Office runs outside their count range, are regenerated). |
| sampled density | placed per 100 m² of eligible floor (sampled) | Placed spawns divided by the eligible floor area of a small labelled seed corpus. Eligible = cells the generator's own candidate filter accepted (0.25 m² each), never map bounding boxes. A census, not a runtime rule. |
| density (room modifier) | multiplier (1 = neutral) | Local intensity of a family in a room: scales the room's area weight by the room intensity D and the family's part of the room mix. Never changes the count roll or a cap. |
| weight (room modifier) | multiplier (1 = neutral) | Conditional composition in a room: scales a family's pool weight for spawns that land in that room. Changes which family a spawn there becomes, never how many spawns the room attracts. |
| family spacing | metres (straight 3D line) | A whole-level minimum distance between placed spawns of a family that has an eligibility rule (lane INTEG, ai/familySpacing.ts): in spawn order an eligible draw is placed only while fewer than the rule's cap are placed and it is at least that far from every placed one; otherwise it becomes the fallback family. Never touches horde members. |
| horde pool | groups per level × members per group | The roaming hordes: a SEPARATE pool with its own explicit families, group count and group size ranges and budgets (members in the level, members and groups starting on one storey). Placed once at generation, after the ambient family roll; its members carry their own context tag (horde), never an ambient one; no respawn or top-up; never counted in the ambient contexts. |
| ambient budget | ambient spawns per level / per storey run | Explicit caps of the ambient pool (the contexts): the whole-level total and one storey run. The horde pool has its own budget. |
| seeded roster | chance per level map seed, per family | Which special enemy families a generated level holds AT ALL. One independent roll per family per level map, a hash of the level seed (no random stream is consumed; the same seed always gives the same roster), applied once to the finished level after the per-spawn family roll. A family rolled absent has exactly none in that level: what the per-spawn roll placed becomes ordinary zombies. A family rolled present is placed by its policy (a share top-up, at least one, exactly one, or a count). Only ordinary ambient zombie slots ever change family: the enemy count, positions and indices never change, and horde members and outfit zombies are never touched. The ordinary zombie is the baseline and is never rolled; a zombie-free level gets no family. |
| roster-only family | weight 0 in every pool | A family no per-spawn roll can draw: its weight is 0 in every level, context and horde pool (validation rejects anything else), so its conditional share is 0 everywhere. It is placed only by the seeded roster: a level whose roll includes it gets its count in place of ordinary zombies, and every other level has exactly none. |
| before / after the roster pass | two stages of one sampled level | Sampled figures name their stage. "Before the roster pass" = the per-spawn roll, eligibility, cap and spacing alone (the generator's own output). "After" / "with the roster" = the same level with the seeded roster applied: what a level holds. Counts and positions are identical in both; only families differ. |
Why the placed count can differ from the count range
The count a context draws is a target. The generator then walks the eligible areas and stops when the target is reached or when nothing more fits. Each level page lists its exact rules per context; in general:
- Eligibility. Only floor cells that pass the generator's own filter can hold a spawn: walkable floor with clear neighbours, far enough (by walking distance) from where the player starts, away from stair and elevator landings where a level has them. A small or crowded map has fewer such cells.
- Area order. Areas are shuffled by their area weight, so heavier areas tend to be visited first. An area weight is a relative preference, not a chance and not a count.
- Caps per pass. The generator walks the area order in several passes, each with a higher cap: after a pass, an ordinary area may hold up to that pass's cap, and some area kinds have their own caps (each level page lists them). Caps spread spawns out instead of filling the first area.
- Tries and spacing. Each visit to an area tries a fixed number of random eligible cells and skips any that is too close to an existing spawn. If all tries fail, the area gets nothing on that visit.
- Whole-attempt checks. Some levels reject a whole generation attempt that breaks a rule (for example too few enemies) and retry with another attempt seed.
So the count range is an upper bound per run: placed ≤ drawn. Family shares and zombie types apply to the spawns that are placed.
The seeded roster: which families a level holds at all
A family's share says how often the per-spawn roll draws it. It does not say whether a given level has any. That is the seeded roster (roster version 4), which runs once on every finished level:
- One independent roll per seeded family per generated level map: the family is PRESENT when its roll is below its rate on that level. The roll is a hash of the level seed and the family (no random stream is consumed), so the layout, the loot and every spawn's position, type and per-spawn family draw are bit-identical with or without the pass, and the same seed gives the same roster on every revisit, reload, Retry and import. One map = one roll: every storey of a level shares it; it is never per floor, per spawn or per campaign.
- The pass runs once on the FINISHED layout — after every generation context, the one per-spawn family roll, the eligibility rules, cap and spacing, and the hordes — in the level registry, the same for every registered level.
- It only swaps a family with an ORDINARY AMBIENT ZOMBIE slot: a spawn's family (and, for a family with several bodies, its model variant) changes and nothing else. No spawn is added, removed, moved or reordered, so the enemy count, the positions and the per-index kill memory keep their meaning. Roaming-horde members and store / convention outfit zombies are never touched.
- A family rolled ABSENT has exactly none in that level: what its per-spawn roll placed becomes ordinary zombies. Nothing is renormalised and no other family's draw moves.
- A family rolled PRESENT is placed by its policy, the most constrained first: Strainer (context-one), Siren (eligible-min-one), Screacher (count), Blightbelly (share-topup), Tunnel scavenger (rat/dog) (share-topup) — each on the ordinary zombie slots still left. A family added in a later roster version is placed LAST, whatever its policy (BB (count)): it takes only slots the earlier families left, so their placement does not move. A constrained family whose only legal slot holds a member of a share-top-up family takes that slot, and the member is exchanged to an ordinary zombie slot elsewhere. PRESENT MEANS AT LEAST ONE for every policy: only a level with no slot at all where the family may stand holds none, and the pass reports that as "no slot".
- The ordinary zombie is the baseline: always present, never rolled. Zombie-free levels (Survivor Market) never get any family.
- From roster version 4 the level registry APPENDS the Reactor's irradiated zombies right after this pass (a separate additive step, not part of the roster censuses on these pages): on its lower storeys (layout levels 3, 4, 5: tier 3, tier 4 and the core floor) round(0.4 x R) more ordinary zombies, R = the regular zombies standing there after the pass, each with 1.5x its type's hp, glowing green skin, a local green light and a short-range radiation dose. They are appended after every existing spawn on their own hash-seeded stream: no existing spawn, family, index or loot changes, and a station recorded at an older version regenerates without them.
- Version pin (saves): a station records the roster version it was first built with (section-memory lane 'enemy.roster'). A station already visited before the roster existed regenerates with version 0 — no pass, so its enemies, kills and ids stay exact; a station never entered (a new campaign, or an unvisited node of an older one) is built with the current version 4. A station recorded at an older version regenerates with that version: a rule that applies only from a later one (BB from version 3) does not run there, so a visited station's enemies are never rerolled. A direct generator call without a roster version gets no pass.
How to read the roster figures:
- Chance per level. A family's rate is the long-run share of level map seeds whose roll includes it. A level whose roll excludes a family has none of it. A level whose roll includes it holds at least one, placed by the family's policy. The one exception is a level with no slot at all where the family may stand (the Siren, for example, needs an enemy standing in a room that qualifies): it holds none and is counted as “present without a legal slot”. The sampled roster census shows all three counts: levels whose roll included the family, levels that hold it, and levels without a slot.
- The count never changes. A level has the same number of enemies, at the same places, with or without the roster. A family that is present takes ordinary zombie slots; a family that is absent gives its slots back to ordinary zombies.
- Roster-only. Screacher, BB: weight 0 in every pool, so the share is 0 everywhere and the per-spawn tables show an empty band. The roster alone places it.
- Sampled roster figures are small samples. “In so many of the sample levels” is what those generated levels hold. The long-run share of levels is the rate. Each family's entry also shows the roll itself over 10000 level seeds.
- Before and with the roster. A sampled figure of the per-spawn roll alone is labelled “before the roster pass”. Everything described as what a level holds is measured with the roster applied.
Every family's rule and each level's chances: the seeded roster; per family: enemy families.
Room modifiers
Room key = the area's purpose id (gen/purposes.ts) when it has one, else its room type. Each field resolves: purpose entry → room-type entry → 1 (missing = neutral). The neutral value is 1×; a room or family without an entry resolves to 1×.
| Modifier | What it changes | How | At 0 | At 2 |
|---|---|---|---|---|
| Density (local intensity)density | local intensity | area weight × D, D = all.density × Σ_f p_f·w_f·d_f / Σ_f p_f·w_f (p = pool weight, w = weight modifier, d = density modifier); the room's family mix uses p_f·w_f·d_f | D = 0: the room is never a candidate (no spawns there); the count roll and the other rooms are unchanged, so its spawns go elsewhere when capacity allows. | The room is visited earlier in every cap pass, so it tends to fill its caps before the count runs out: more spawns there, fewer elsewhere, the same total. |
| Weight (conditional composition)weight | conditional composition | P(family f | spawn lands in the room) = p_f·w_f·d_f / Σ_g p_g·w_g·d_g | That family never spawns in that room (its spawns there become the other families). | Twice its relative odds in that room before normalisation; the room still attracts the same number of spawns. |
- All families. Family key 'all' carries a density for every family of the room (room-wide intensity; a family's own density multiplies with it). It has no weight.
- Caps, spacing and the count. Modifiers never change the count roll (the level / context total) or raise a cap: caps, spacing, tries and eligibility still bound every room, so a modifier can move spawns between rooms but cannot add any.
- Neutral means unchanged. A room without an entry takes the shipped code path untouched (the same area weight number, the same pool array); an explicit entry of 1 is bit-identical too (x·1 === x, Σ/Σ === 1), so the RNG draws and every seeded spawn are unchanged.
- Weight modifiers never touch an RNG stream (the family roll is a hash of level seed + spawn index).
- A density modifier changes placement draws; on the Subway the storey moves of loose floor supplies follow on the same stream as the storey moves of enemies, so those moved supplies may land on other cells (same items, counts and pools).
- Shipped profiles have NO room entries: every room resolves to exactly 1×.
Defined at roomIntensity in game/src/ai/spawnTables.ts:992 (repository access required).
What these pages never state, and why
- No spawn rate per square metre or per square foot as a game rule. The game has no such rule: it places a count per generation context. Where a page shows enemies per 100 m², it is a sampled figure: placed spawns divided by the eligible floor the generator's own filter accepted, over a named seed corpus. It is never computed from map bounding boxes.
- No chance that a particular room holds an enemy. That depends on the generated layout: how many areas exist, how much eligible floor each has, and what was placed before it.
- No automatic difficulty scaling. Each level shows its explicit difficulty tier, but nothing in the game scales counts, health, damage or loot by tier, and no enemy family is enabled by it: a level opts in to a family in its own spawn profile. Combat figures on the families page are each family's exported source values, not tier-adjusted.
- No exact placed count for a restricted family. Where an eligibility rule applies (for example a family that only lies in certain rooms), its draw share is exact but how many it actually places depends on the generated rooms: those figures are measured over a named sample and labelled sampled.
- No promise that one particular level holds a special family. The seeded roster's rate is a long-run share of level seeds. Whether one level has the family is that level seed's own roll: fixed for the seed, but not readable from a share.