Office Space: enemy spawns

A small subway stop under an office tower — climb the stairs into the lobby, then work up eight floors by stairwell or elevator.

Level id
office
Difficulty tier
1 — Explicit difficulty tier of the level (0 = the starting level). Metadata only: no automatic scaling of counts, damage or loot, and no enemy family is enabled by it. LEVELS.office.tier in game/src/levels/registry.ts:70 (repository access required)
Spawn profile
Office Space — SPAWN_PROFILES.office in game/src/ai/spawnTables.ts:879 (repository access required)
Spawns tried per level
26–52 (E = 39), over 4 generation contexts
Room modifiers
All 58 room keys resolve to 1× for every family (neutral); the profile sets no room modifiers

Generation contexts

A generation context is one run of the enemy placement code. Each run draws one count, uniformly from its range, and tries to place that many spawns. The contexts below are parts of the one Office Space level and are generated with it; they are not separate levels. A context that runs more than once per level (for example once per storey) draws a new count each run.

Office Space: spawns each context tries to place (count per run, uniform; per level = runs × count)
ContextStoreys one run coversRuns per levelCount per runE[count] per runPer levelE per level
Station + lobbystreetstation + tower lobby (levels 0 and 1)15–8U{5..8}6.55–86.5
Office floorfloorone office floor (each of floors 2..8)73–6U{3..6}4.521–4231.5
Roofroofthe roof deck (level 9; the hatch / ladder zone held empty)10–2U{0..2}10–21
Service annex (per annex)serviceone seeded service annex off a track tunnel of the street station (its rooms and corridors only)0–2one per zone (seeded)5–6U{5..6}5.50–12zone budget, not in the total5.5per zone
Whole levelall core contexts (zones reported separately)26–5239

Spawns the level's context runs try to place (Σ runs × count). The family roll replaces, never adds; placed totals can fall short where eligible, spaced cells run out. Not included: the zone context 'service' (a per-zone budget of 5-6 per zone, 0-12 per level), reported separately.

Service annex (per annex): A PER-ANNEX ZONE BUDGET: one run per seeded service annex (0 to TRACK_EXT.annex.max per level, a generation census quantity — see docs/enemy-spawns.md "Service annexes"), on the annex's own fork, appended after every core spawn and tagged 'service'. It is additive to the core contexts and NOT in the whole-level total above; the level's zombie types apply; its spawns draw from the annexes' OWN family pool (SERVICE_FAMILY_POOL: a configured 20 % rat/dog selection share, Blightbelly 5 %, Strainer 8 % (the only pool that enables it: STRAINER_CONTEXTS), no Siren — per-spawn probabilities, not quotas). The seeded roster pass then runs on the finished level (see the seeded roster): it fixes the level's Strainers at EXACTLY ONE on the maps whose seed rolled the Strainer present, and at none on the others, and it decides per level whether Blightbellies and rat/dogs are there at all (the slot rules of the roster-only Screacher and BB list the core contexts, not the annex). The sampled census shows the outcome with the pass applied. Killed annex enemies stay dead for the run (per-index memory).

Service annex (per annex): its own family pool (configured selection share per spawn) — zombie 67 % · blightbelly 5 % · siren 0 % · ratdog 20 % · strainer 8 % · screacher 0 % · bb 0 %. This context's OWN pool: its spawns draw their family from it (the same single roll per spawn, room modifiers and eligibility on top) instead of the level pool. The shares are CONFIGURED selection probabilities per spawn, not quotas: a 5-6-enemy annex may hold none or several; the sampled census shows the placed outcome.

These are targets: the generator can place fewer when it runs out of eligible, spaced floor (see placement rules). The game has no per-area or per-square-metre spawn rate; the count is spread over the eligible areas of the context.

Generator: generateOfficeLevel in game/src/gen/office/index.ts:81 (repository access required). ONE continuous level (station, lobby, office floors 2..8, roof) generated once per level seed: placeOfficeEnemies runs once per storey context on its own fork, then (Track 2) placeServiceSpawns runs the service context once per seeded service annex of the street station, appended last; assignEnemyArchetypes rolls every family once at the end. Changing floors never rerolls anything. Last of all the level registry runs the SEEDED ROSTER pass on the finished layout (ai/enemyRoster.ts applyEnemyRoster, roster version 4): from the level seed alone it decides which special families this map holds at all, and it only ever changes the family of ordinary ambient zombie slots — never a count, a position, an index, a horde member or an outfit zombie (see the seeded roster).

Enemy families

Every placed spawn is one enemy family. A family's conditional share = weight / Σ weights (denominator 1) is the chance that the per-spawn roll of one placed spawn draws that family. It changes the mix, not how many spawns are placed. The seeded roster then decides whether this level holds each special family at all.

Every placed spawn draws its family independently: roll = enemyRoll(level seed, spawn index) ∈ [0, 1), walked over the pool weights of the spawn's room (the level pool when the room has no modifier), in registry order (the rat/dog keeps the top band; a family at weight 0 — the roster-only Screacher / BB — has no band). A drawn family REPLACES a zombie; it never adds to the count. Then the eligibility rule of siren: a draw where the rule fails becomes the fallback family — the other families' draws are untouched. Last, the seeded roster pass (roster version 4) runs once on the finished level: a family the level's seed rolled absent has exactly none there, a present one is placed by its policy (see the seeded roster).

Office Space: family pool (per-spawn roll: shares conditional on one placed spawn; denominator 1) and the seeded roster on top
FamilyWeightConditional share (per-spawn roll)Expected per level by the per-spawn roll alone (before the roster)Seeded roster: chance the level's roll includes itPer level with the roster (sampled)
Infectedzombie0.710.71 / 1draw share; 83.9% of the placed spawns after the rule, before the roster pass sampled (takes the fallback draws of an eligibility rule)34.35 sampledalwaysthe baseline: never rolledin 20 of 20 levels · 33.1 per level sampled
Blightbellyblightbelly0.050.05 / 11.9560%of level map seeds · share top-upin 16 of 20 levels · 2.9 per level · 3.63 per level that holds it sampled
Sirensiren0.190.19 / 1draw share; 5.4% of the placed spawns after the rule, before the roster pass sampled (eligibility rule)2.2 sampled85%of level map seeds · at least one where a room qualifiesin 15 of 20 levels · 1.8 per level · 2.4 per level that holds it sampled
Tunnel scavenger (rat/dog)ratdog0.050.05 / 11.9560%of level map seeds · share top-upin 13 of 20 levels · 2.15 per level · 3.31 per level that holds it sampled
Strainerstrainer00 / 1level pool; its weight is in a context's own pool: Service annex (per annex) 8%035%of the map seeds whose map has a spawn in its contexts · exactly one, in its contextsin 1 of 20 levels · 0.05 per level · 1 per level that holds it sampled
Screacherscreacher00 / 1roster-only: no per-spawn roll draws it (placed by the seeded roster alone)040%of level map seeds · a count in place of ordinary zombiesin 5 of 20 levels · 0.45 per level · 1.8 per level that holds it sampled
BBbb00 / 1roster-only: no per-spawn roll draws it (placed by the seeded roster alone)040%of level map seeds · a count in place of ordinary zombiesin 5 of 20 levels · 0.5 per level · 2 per level that holds it sampled

Expected per level by the per-spawn roll alone = share × spawns tried per level (E = 39), with neutral room modifiers and before any placement shortfall; a family with an eligibility rule and its fallback family are measured instead (sampled placed per level, see family eligibility). That is the stage before the roster pass. The last two columns are the seeded roster: a level either holds a family or has none of it, so the per-level figure of a level that holds it is higher than the long-run mean. Defined at OFFICE_ENEMY_POOL in game/src/ai/spawnTables.ts:664 (repository access required).

Family eligibility

A family with an eligibility rule takes a placed slot only where its rule holds. Its draw share (weight / Σ weights) is exact; a draw where the rule fails becomes the fallback family, so the family's placed share is lower and is measured below. The other families' draws never change (the roll is the same; nothing is renormalised). The seeded roster runs after this rule and decides whether the level holds the family at all.

Siren · siren

office-floor rooms only, room ≥ 4 x 4 m, clear floor patch, doorways ≥ 3 m away, never seals passage, ≤ 4 per level. A draw of Siren becomes Infectedzombie unless every criterion holds:

  1. the spawn's generation context is Office floor (floor); draws in any other context fall back
  2. area kind room
  3. never in (room type or purpose): washroom, office-stair, stair-core, office-elevator, office-lobby, office-corridor, office-roof
  4. the area's shorter side ≥ 8 cells (4 m)
  5. the area ≥ 100 cells (25 m²)
  6. a clear 1.5 × 1.5 m patch: every cell within 1 cell(s) is walkable floor of the same area
  7. ≥ 3 m from the centre of every doorway of its area
  8. fair passage: a 2.5 m disc around the spawn, treated as blocked, never splits the storey's walkable floor (pockets of ≤ 8 cells ignored)
  9. at most 4 per generated level (all contexts; later draws in spawn order fall back)

Rule defined at OFFICE_SIREN_ELIGIBILITY in game/src/ai/spawnTables.ts:646 (repository access required).

sampled Observed, not a rule. SAMPLED: 20 generated levels of LEVELS.office.generate (seeds 5003..155464, 20 seeds, shipped start weapon), measured BEFORE the seeded roster pass: the per-spawn roll and the eligibility rule alone. A draw is a spawn whose roll lands on the family; it is placed only where the eligibility rule holds, otherwise it becomes the fallback family. Ambient spawns only (horde members are the separate horde pool). The roster pass then decides per level whether the family is there at all — the seeded roster census of the same levels shows what a level holds. Not exhaustive; not a runtime rule.

These tables measure the per-spawn roll and the eligibility rule alone. What the same levels hold after the roster pass is in the seeded roster census.

Office Space: placed spawns per family by the per-spawn roll and the eligibility rule, before the roster pass (sampled eligibility census: 20 layouts)
FamilyPlaced over the sampleMean per levelPlaced share
Infectedzombie68734.35
Blightbellyblightbelly412.05
Sirensiren442.2
Tunnel scavenger (rat/dog)ratdog452.25
Strainerstrainer20.1
Screacherscreacher00
BBbb00
Office Space: Siren draws vs placed, before the roster pass (sampled: 20 layouts)
Draws (roll landed on it)PlacedPlaced per level (mean)Levels with noneMost in one level
169442.22 of 204
Office Space: Siren per generated level, before the roster pass (sampled histogram)
Placed in one levelLayouts
02
16
24
32
46
Office Space: Siren draws that fell back, by the first failed criterion (sampled)
CriterionDraws
context36
size33
kind24
door20
room5
passage4
cap2
clear1

Placed by context: Office floor 44.

Seeded roster (which families this level holds at all)

The seeded roster pass (roster version 4) runs once on the finished Office Space layout, after every generation context, the per-spawn family roll, the eligibility rules and the hordes. One roll per family per level map seed; every storey of the level shares it. It never changes how many enemies the level has or where they stand — only which family an ordinary ambient zombie slot is.

Office Space: seeded roster — whether the level can hold each family, and the chance that a map's roll includes it
FamilyCan this level hold itChance the roll includes itOn this levelThe roll itself over level seeds 1 to 10000Sample levels with the roster (sampled)
Infectedzombiealways: the baseline, never rolledalwaysthe baseline: never rolledAlways: the baseline family, never rolled. The other families only ever take ordinary ambient zombie slots.not rolledin 20 of 20 levels · 33.1 per level sampled
Blightbellyblightbellyyes: every map of the level is rolled60%of level map seeds · share top-upThe roll includes it in 60 % of this level's map seeds: there the per-spawn roll's placements stay and are topped up, and such a map holds at least one. Every other map holds none.5991 of 10000 include it59.9% of those seedsin 16 of 20 levels · 2.9 per level · 3.63 per level that holds it sampled
Sirensirenyes: every map of the level is rolled85%of level map seeds · at least one where a room qualifiesThe roll includes her in 85 % of this level's map seeds: such a map holds at least one when an enemy stands in a room where she is eligible (else none: "no slot"). Every other map holds none.8506 of 10000 include it85.1% of those seedsin 15 of 20 levels · 1.8 per level · 2.4 per level that holds it sampled
Tunnel scavenger (rat/dog)ratdogyes: every map of the level is rolled60%of level map seeds · share top-upThe roll includes it in 60 % of this level's map seeds: there the per-spawn roll's placements stay and are topped up, and such a map holds at least one. Every other map holds none.6054 of 10000 include it60.5% of those seedsin 13 of 20 levels · 2.15 per level · 3.31 per level that holds it sampled
Strainerstrainerdepends on the map: only a map with a spawn in its contexts is rolled35%of the map seeds whose map has a spawn in its contexts · exactly one, in its contextsThe roll includes it in 35 % of the map seeds whose map has an ambient spawn in its context here (service): such a map holds exactly one, there. A map without such a spawn is never rolled, and every other map holds none.3553 of 10000 include it35.5% of those seedsin 1 of 20 levels · 0.05 per level · 1 per level that holds it sampled
Screacherscreacher roster-onlyyes: every map of the level is rolled40%of level map seeds · a count in place of ordinary zombiesThe roll includes it in 40 % of this level's map seeds: such a map holds its count. Every other map holds none.3932 of 10000 include it39.3% of those seedsin 5 of 20 levels · 0.45 per level · 1.8 per level that holds it sampled
BBbb roster-onlyyes: every map of the level is rolled40%of level map seeds · a count in place of ordinary zombiesThe roll includes it in 40 % of this level's map seeds: such a map holds its count. Every other map holds none.4096 of 10000 include it41% of those seedsin 5 of 20 levels · 0.5 per level · 2 per level that holds it sampled

How a family this level holds is placed

Order: Strainer, then Siren, then Screacher, then Blightbelly, then Tunnel scavenger (rat/dog), then BB — the most constrained first (BB last: added in a later roster version, it takes only slots the others left), each on the ordinary zombie slots still left.

Sampled roster census

sampled Observed, not a rule. SAMPLED: the same 20 generated levels of LEVELS.office.generate (seeds 5003..155464, 20 seeds, shipped start weapon), each followed by the seeded roster pass at roster version 4 — what a level holds. "Before" = what the per-spawn roll alone had placed; "after" = with the pass applied. The pass never changes the 40.95 ambient spawns per level of this sample, only their families. A SMALL sample: the long-run share of levels that hold a family is its roster rate, not this count. The roll depends on the level seed and the family only, so these seeds roll the same families present on every level. Ambient spawns only (horde members are the separate horde pool). Not exhaustive.

Office Space: the seeded roster pass on the sample levels (sampled: 20 layouts; 819 ambient spawns, 40.95 per level, before and after)
FamilyLevels that could hold itLevels whose roll included itLevels that hold itPlaced by the per-spawn roll alone (before the pass)Slots the pass took from itSlots the pass gave itWith the roster (after the pass)Mean per levelMean per level that holds itMost in one levelShare of the ambient enemiesPresent without a legal slotLevels by number held (number: levels)
Infectedzombie202020687563166233.133.1450—
Blightbellyblightbelly20161641825582.93.63800: 4 · 1: 3 · 2: 1 · 3: 2 · 4: 7 · 5: 1 · 6: 1 · 7: 0 · 8: 1
Sirensiren2015154491361.82.4400: 5 · 1: 6 · 2: 2 · 3: 2 · 4: 5
Tunnel scavenger (rat/dog)ratdog201313451715432.153.31600: 7 · 1: 2 · 2: 3 · 3: 3 · 4: 2 · 5: 0 · 6: 3
Strainerstrainer51122110.051100: 19 · 1: 1
Screacherscreacher205500990.451.8300: 15 · 1: 2 · 2: 2 · 3: 1
BBbb20550010100.52300: 15 · 1: 1 · 2: 3 · 3: 1

“Slots the pass took from it”: spawns the per-spawn roll made this family that are another family after the pass (an absent family's all become ordinary zombies). “Slots the pass gave it”: spawns that became this family in the pass. For the baseline family the two are the slots the other families took and gave back.

Roster version 4; the rules of the pass and every family's rule: the seeded roster. Defined at applyEnemyRoster in game/src/ai/enemyRoster.ts:285 (repository access required).

Zombie types (inside the zombie family)

Not separate enemy families. The types (coated, shambler) split the Infected family only; the family shares above do not change with them. Wardrobe outfits are a further appearance choice, also not a family.

Office Space: zombie type chance per spawn (before the at-least-one-of-each rule)
TypeChance per spawn
coated
shambler

Each spawn of a run: coated with the coated chance, else shambler; then, if the run has no coated, its first spawn becomes coated, and (count > 1) if it has no shambler, its second becomes shambler. Ratdogs keep the rolled type but ignore it.

Office Space: expected coated share of one context run (exact, including the at-least-one-of-each rule)
ContextSpawns in the run (n)Expected coated share
Station + lobby5
Station + lobby8
Office floor3
Office floor6
Roof2
Service annex (per annex)5
Service annex (per annex)6

Shambler / coated type (the profile's zombie type roll) and the wardrobe outfit chosen at spawn time from (level seed, spawn index, type) by ai/wardrobe.ts pickZombieLook — sub-distributions of the zombie family, not separate families.

Defined at ZOMBIE_TYPES in game/src/ai/spawnTables.ts:379 (repository access required).

Baseline placement rules

These are the generator's own rules for where the counted spawns go. Room modifiers at 1× leave every one of them unchanged. They are also why a generated level can hold fewer spawns than its count drew.

Station + lobby · street · count 5–8 per run × 1 run

One run covers: station + tower lobby (levels 0 and 1). Count per run uniform integer U{5..8} (rng.int, inclusive); E[count] = 6.5.

Which cells can hold a spawn

  1. a FLOOR cell of the context's storeys (not the outer border row)
  2. walking distance from the start ≥ 36 cells (18 m)
  3. every cell within 1 cell(s) walkable
  4. not a stair ramp, not in a stair-role area, the area on its own storey
  5. ≥ 5 m from every keep point of the storey
  6. the area's effective weight (area weight × room intensity) > 0
Office Space · Station + lobby: keep-away and clearance rules
RuleValueUnitIn metres
walking distance from the player start36cells18
clear walkable cells around the candidate (radius)1cells0.5
straight-line keep-off from stair / elevator landings, the roof hatch and the ladder foot5m5

Which areas are visited first

First matching rule wins (enclosed office rooms and back-of-house rooms otherwise). A relative weight in the weighted area order, multiplied by the room intensity D of its room key (1 when the room has no modifier). Weight 0 = never a candidate.

Office Space · Station + lobby: area weights (relative order preference; first matching rule wins)
Areas matchingArea weightWhy
kind platform2.2the platform of the station under the tower
type exit-stair / washroom0.5closed street exits and washrooms
type office-stair / stair-core / office-elevator0never in a stairwell, stair core or the elevator cab
type eatery / shop0.5storefront units
kind closet0.5closets
type office-open1.6open-plan office floors
public space1other public halls, lobby and corridors
any other area1.3

How many spawns one area may hold

The placement walks the area order once per pass (caps 1, 2, 3); an area takes one more spawn per visit while it is below its cap for that pass. Room modifiers never raise a cap.

Office Space · Station + lobby: spawns one area may hold (passes 1, 2, 3)
Areas matchingCapWhy
kind platformpass cap + 1platforms hold one more per pass
kind closetat most 1closets: at most one
any other areathe pass cap
Tries per area visit
14 random eligible cells
Spacing
at least 4 m between spawns (straight line, same storey)

Placement defined at OFFICE_PLACEMENT in game/src/ai/spawnTables.ts:374 (repository access required).

How a run places its count, and why it can fall short

  1. Draw count = U{5..8} (one draw per run), then the zombie types of that many spawns.
  2. Collect every eligible cell, grouped by area; order the areas by a weighted shuffle (Efraimidis–Spirakis keys u^(1/weight)).
  3. For each cap pass (1, 2, 3), walk the order: an area below its cap gets up to 14 random cell picks; the first pick ≥ 4 m from every enemy already placed on that storey takes one spawn.
  4. Stop when the count is reached. Spacing, caps and eligible floor can leave a run short of its count (placed < count); validation regenerates the attempt where the profile requires it.
  5. Each placed spawn is then a family by its own roll (see the family pool) — independent of the area unless a room modifier says otherwise.

Checks that reject a whole generation attempt

Context defined at SPAWN_PROFILES.office.contexts.street in game/src/ai/spawnTables.ts:882 (repository access required).

Office floor · floor · count 3–6 per run × 7 runs

One run covers: one office floor (each of floors 2..8). Count per run uniform integer U{3..6} (rng.int, inclusive); E[count] = 4.5.

Same cell eligibility, keep-away, area weights, caps, tries and spacing as Station + lobby (identical source values).

How a run places its count, and why it can fall short

  1. Draw count = U{3..6} (one draw per run), then the zombie types of that many spawns.
  2. Collect every eligible cell, grouped by area; order the areas by a weighted shuffle (Efraimidis–Spirakis keys u^(1/weight)).
  3. For each cap pass (1, 2, 3), walk the order: an area below its cap gets up to 14 random cell picks; the first pick ≥ 4 m from every enemy already placed on that storey takes one spawn.
  4. Stop when the count is reached. Spacing, caps and eligible floor can leave a run short of its count (placed < count); validation regenerates the attempt where the profile requires it.
  5. Each placed spawn is then a family by its own roll (see the family pool) — independent of the area unless a room modifier says otherwise.

Checks that reject a whole generation attempt

Context defined at SPAWN_PROFILES.office.contexts.floor in game/src/ai/spawnTables.ts:883 (repository access required).

Roof · roof · count 0–2 per run × 1 run

One run covers: the roof deck (level 9; the hatch / ladder zone held empty). Count per run uniform integer U{0..2} (rng.int, inclusive); E[count] = 1.

Same cell eligibility, keep-away, area weights, caps, tries and spacing as Station + lobby (identical source values).

How a run places its count, and why it can fall short

  1. Draw count = U{0..2} (one draw per run), then the zombie types of that many spawns.
  2. Collect every eligible cell, grouped by area; order the areas by a weighted shuffle (Efraimidis–Spirakis keys u^(1/weight)).
  3. For each cap pass (1, 2, 3), walk the order: an area below its cap gets up to 14 random cell picks; the first pick ≥ 4 m from every enemy already placed on that storey takes one spawn.
  4. Stop when the count is reached. Spacing, caps and eligible floor can leave a run short of its count (placed < count); validation regenerates the attempt where the profile requires it.
  5. Each placed spawn is then a family by its own roll (see the family pool) — independent of the area unless a room modifier says otherwise.

Checks that reject a whole generation attempt

Context defined at SPAWN_PROFILES.office.contexts.roof in game/src/ai/spawnTables.ts:884 (repository access required).

Service annex (per annex) · service · count 5–6 per run × one run per zone (0–2 per level)

One run covers: one seeded service annex off a track tunnel of the street station (its rooms and corridors only). Count per run uniform integer U{5..6} (rng.int, inclusive); E[count] = 5.5.

Which cells can hold a spawn

  1. a FLOOR cell of the context's storeys (not the outer border row)
  2. walking distance from the start ≥ 36 cells (18 m)
  3. every cell within 1 cell(s) walkable
  4. not a stair ramp, not in a stair-role area, the area on its own storey
  5. ≥ 6 m from every keep point of the storey
  6. the area's effective weight (area weight × room intensity) > 0
  7. an area of the zone (one service annex), ≥ 6 m from the annex's entry door (its keep point)
Office Space · Service annex (per annex): keep-away and clearance rules
RuleValueUnitIn metres
walking distance from the player start36cells18
clear walkable cells around the candidate (radius)1cells0.5
straight-line keep-off from stair / elevator landings, the roof hatch and the ladder foot6m6

Which areas are visited first

First matching rule wins (annex rooms (pump / electrical rooms, stores, workshops, custodial rooms) otherwise). A relative weight in the weighted area order, multiplied by the room intensity D of its room key (1 when the room has no modifier). Weight 0 = never a candidate.

Office Space · Service annex (per annex): area weights (relative order preference; first matching rule wins)
Areas matchingArea weightWhy
kind closet0.6annex closets (janitor / electrical / supply)
kind service1annex service corridors (1.5-2 m wide)
any other area1.4

How many spawns one area may hold

The placement walks the area order once per pass (caps 1, 2); an area takes one more spawn per visit while it is below its cap for that pass. Room modifiers never raise a cap.

Office Space · Service annex (per annex): spawns one area may hold (passes 1, 2)
Areas matchingCapWhy
kind closetat most 1closets: at most one
any other areathe pass cap
Tries per area visit
12 random eligible cells
Spacing
at least 5 m between spawns (straight line, same storey)

Placement defined at SERVICE_PLACEMENT in game/src/ai/spawnTables.ts:405 (repository access required).

How a run places its count, and why it can fall short

  1. Draw count = U{5..6} (one draw per run), then the zombie types of that many spawns.
  2. Collect every eligible cell, grouped by area; order the areas by a weighted shuffle (Efraimidis–Spirakis keys u^(1/weight)).
  3. For each cap pass (1, 2), walk the order: an area below its cap gets up to 12 random cell picks; the first pick ≥ 5 m from every enemy already placed on that storey takes one spawn.
  4. Stop when the count is reached. Spacing, caps and eligible floor can leave a run short of its count (placed < count); validation regenerates the attempt where the profile requires it.
  5. Each placed spawn is then a family by its own roll (see the family pool) — independent of the area unless a room modifier says otherwise.

Checks that reject a whole generation attempt

Context defined at SPAWN_PROFILES.office.contexts.service in game/src/ai/spawnTables.ts:887 (repository access required).

Room modifiers

All 58 room keys resolve to 1× for every family (neutral); the profile sets no room modifiers. A room key or family without an entry resolves to 1×, which leaves the baseline placement unchanged.

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). Two modifiers exist per room key and family. Density changes local intensity: how strongly the room's areas are preferred when spawns are spread. Weight changes conditional composition: which family a spawn placed in that room is. Neither changes the count range, and caps and spacing still apply. No explicit entries: every other room / family resolves to 1×. Rows list the room keys seen in the sampled census plus any explicit entry; a key not listed resolves to 1× as well.

What each room modifier changes (per room key and enemy family)
ModifierChangesHowAt 0At 2
Density (local intensity)local intensityarea 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_fD = 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)conditional compositionP(family f | spawn lands in the room) = p_f·w_f·d_f / Σ_g p_g·w_g·d_gThat 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.

The profile sets no explicit room modifier entries: every room key below resolves to the neutral 1×.

Office Space: resolved room modifiers for every room key the level can produce (1× = neutral)
Room keyKey kindSampled room typesRoom intensity D(room)Infected: densityInfected: weightBlightbelly: densityBlightbelly: weightSiren: densitySiren: weightTunnel scavenger (rat/dog): densityTunnel scavenger (rat/dog): weightStrainer: densityStrainer: weightScreacher: densityScreacher: weightBB: densityBB: weight
Station agent officeagent-officeRoom purposeStation agent office agent-office1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Coffee barcoffeeRoom purposeFood counter eatery1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
ConcourseconcourseRoom typeConcourse concourse1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Donut shopdonutRoom purposeFood counter eatery1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Electrical closetelectrical-closetRoom purposeSupply closet supply-closet1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Street exit (closed)exit-stairRoom typeStreet exit (closed) exit-stair1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Ticket hallfare-hallRoom typeTicket hall fare-hall1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Janitor closetjanitor-closetRoom purposeJanitor closet janitor-closet1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
NewsstandnewsstandRoom purposeShop shop1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Atelieroffice-atelierRoom purposeOpen-plan office office-open1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Bakery counteroffice-bakeryRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Boardroomoffice-boardroomRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Production suiteoffice-boothRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Break roomoffice-breakRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Coffee baroffice-cafeRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Copy & mail roomoffice-copyRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Corridoroffice-corridorRoom purposeCorridor office-corridor1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Dispatch flooroffice-dispatchRoom purposeOpen-plan office office-open1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Dispensaryoffice-dispensaryRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Drafting studiooffice-draftingRoom purposeOpen-plan office office-open1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Exam roomoffice-examRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Executive officeoffice-execRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Game loungeoffice-gameroomRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
IT closetoffice-itRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Test kitchenoffice-kitchenRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Kitchenetteoffice-kitchenetteRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Law libraryoffice-libraryRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Listening loungeoffice-listeningRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Lobbyoffice-lobbyRoom purposeLobby office-lobby1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Locker roomoffice-lockersRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Staff loungeoffice-loungeRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Parcel roomoffice-mailroomRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Meeting roomoffice-meetingRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Mission roomoffice-missionRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Model roomoffice-modelroomRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Nap roomoffice-naproomRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Observation roomoffice-observatoryRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Open-plan officeoffice-openRoom purposeOpen-plan office office-open1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Pet loungeoffice-petloungeRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Play-test roomoffice-playtestRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Private officeoffice-privateRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Lobbyoffice-receptionRoom purposeLobby office-lobby1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Recording studiooffice-recordingRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Roasteryoffice-roasteryRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Building security officeoffice-securityRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Server roomoffice-serverRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Showroomoffice-showroomRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Stairwelloffice-stairRoom purposeRoof office-roof1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Supply storageoffice-storageRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Broadcast studiooffice-studioRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Tasting loungeoffice-tastingRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Receptionoffice-tenant-receptionRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Utility roomoffice-utilityRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Waiting roomoffice-waitingRoom purposeOffice office-room1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Stair passagepassageRoom typeStair passage passage1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
PlatformplatformRoom typePlatform platform1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
Supply closetsupply-closetRoom purposeJanitor closet janitor-closet, Supply closet supply-closet1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×
WashroomwashroomRoom purposeWashroom washroom1×1×1×1×1×1×1×1×1×1×1×1×1×1×1×

Room intensity D(room) multiplies the room's baseline area weight (see placement rules). Defined at roomIntensity in game/src/ai/spawnTables.ts:992 (repository access required). Meaning of each field: room modifiers.

Sampled census

sampled Observed, not a rule. These figures come from running the real Office Space generator on a small fixed corpus: 4 generated layouts from seeds 11, 222, 3333, 44444, pistol start. Eligible floor is the floor the generator's own candidate filter accepted (68449 cells of 0.25 m², 17112.3 m² in total), not the map's bounding box. Densities are placed spawns per 100 m² of that eligible floor over this sample only. Families are counted with the seeded roster applied: what these levels hold. The roster changes families only, so the totals are the generator's.

SAMPLED: 4 sample levels of the registered generator (seeds 11, 222, 3333, 44444, shipped start weapon) WITH THE SEEDED ROSTER APPLIED (roster version 4: what a level holds; the roster only changes families, so counts, positions and eligible floor are the generator's). Eligible floor = cells the generator's own candidate filter accepted (walking distance, clearance, storey, stair / landing keep-off, weight > 0) x 0.25 m² — never bounding boxes. Not exhaustive; not a runtime rule.

Office Space: placed spawns per family with the seeded roster applied (sampled: 4 layouts)
FamilyPlaced over the sample (with the roster)Mean per levelSample levels that hold itPer 100 m² eligible floor (sampled)Placed by the per-spawn roll alone (before the roster pass)
Infectedzombie12130.254 of 40.707126
Blightbellyblightbelly133.254 of 40.0766
Sirensiren92.254 of 40.0539
Tunnel scavenger (rat/dog)ratdog821 of 40.04713
Strainerstrainer000 of 400
Screacherscreacher20.51 of 40.0120
BBbb10.251 of 40.0060
Office Space: placed spawns per generation context (sampled)
ContextEligible floor m²Placed over the sampleMean per levelPer 100 m² eligible floor (sampled)Placed by family (sampled outcome)
Station + lobby4787.3225.50.46zombie 21 (95.5 %) · blightbelly 1 (4.5 %)
Office floor9466.312631.51.33zombie 96 (76.2 %) · blightbelly 11 (8.7 %) · siren 9 (7.1 %) · ratdog 7 (5.6 %) · screacher 2 (1.6 %) · bb 1 (0.8 %)
Roof2858.861.50.21zombie 4 (66.7 %) · blightbelly 1 (16.7 %) · ratdog 1 (16.7 %)
Office Space: placed spawns per area kind (sampled)
Area kindEligible floor m²Infected placedBlightbelly placedSiren placedTunnel scavenger (rat/dog) placedStrainer placedScreacher placedBB placedPer 100 m² eligible floor (sampled)
closet72.7521000004.12
concourse117630000000.255
passage1974.3311020001.72
platform88830000000.338
room13001.38211960210.854
Office Space: Infected spawns by type (sampled)
TypePlaced over the sample
shambler69
coated52
Office Space: room keys in the sample (sampled; baseline area weights as the generator assigned them)
Room keyBaseline area weight(s)Layouts with itAreasEligible floor m²Infected placedBlightbelly placedSiren placedTunnel scavenger (rat/dog) placedStrainer placedScreacher placedBB placedPer 100 m² eligible floor (sampled)
Station agent officeagent-office1.34453.7510000001.86
Coffee barcoffee0.5227.500000000
Concourseconcourse144481.520000000.415
Donut shopdonut0.522500000000
Electrical closetelectrical-closet0.54728.2500000000
Street exit (closed)exit-stair0.52219.500000000
Ticket hallfare-hall144694.510000000.144
Janitor closetjanitor-closet0.54122511000008
Newsstandnewsstand0.522300000000
Atelieroffice-atelier1.61150.500000000
Bakery counteroffice-bakery1.32229.2500000000
Boardroomoffice-boardroom1.3113500000000
Production suiteoffice-booth1.32932.5400100015.38
Break roomoffice-break1.3414227.800000000
Coffee baroffice-cafe1.33362.2510000001.61
Copy & mail roomoffice-copy1.3426344.572000002.61
Corridoroffice-corridor1.34931805.3281020001.72
Dispatch flooroffice-dispatch1.644262.500010000.381
Dispensaryoffice-dispensary1.3112010000005
Drafting studiooffice-drafting1.62496.7500000000
Exam roomoffice-exam1.31942.530000007.06
Executive officeoffice-exec1.341127910100000.717
Game loungeoffice-gameroom1.33394.510000001.06
IT closetoffice-it1.3441500000000
Test kitchenoffice-kitchen1.32233.7500100002.96
Kitchenetteoffice-kitchenette1.34415.510000006.45
Law libraryoffice-library1.3111410000007.14
Listening loungeoffice-listening1.32241.2500000000
Lobbyoffice-lobby14161077.831000000.371
Locker roomoffice-lockers1.34520.2520000009.88
Staff loungeoffice-lounge1.32355.7500000000
Parcel roomoffice-mailroom1.34463.510000001.57
Meeting roomoffice-meeting1.34811457.392220001.03
Mission roomoffice-mission1.32265.500000000
Model roomoffice-modelroom1.32243.2500000000
Nap roomoffice-naproom1.32233.2510000003.01
Observation roomoffice-observatory1.32230.501000003.28
Open-plan officeoffice-open1.64632906.3132200100.619
Pet loungeoffice-petlounge1.31114.2500000000
Play-test roomoffice-playtest1.31115.2500000000
Private officeoffice-private1.31832.2511000006.2
Lobbyoffice-reception1441043.520000000.192
Recording studiooffice-recording1.32360.500000000
Roasteryoffice-roastery1.33335.7500000000
Building security officeoffice-security1.344255.820000000.782
Server roomoffice-server1.341334300000000
Showroomoffice-showroom1.3221900000000
Stairwelloffice-stair1.3442858.841010000.21
Supply storageoffice-storage1.3420333.830110101.8
Broadcast studiooffice-studio1.31134.510000002.9
Tasting loungeoffice-tasting1.31124.7500000000
Receptionoffice-tenant-reception1.342713160200006.11
Utility roomoffice-utility1.34983.2530000014.8
Waiting roomoffice-waiting1.3112200000000
Stair passagepassage144149.530000002.01
Platformplatform2.24488830000000.338
Supply closetsupply-closet0.54619.510000005.13
Washroomwashroom0.5472175101000006.29

How to read these numbers

More: How to read enemy numbers.

Where to tune it

Each value names the source file and export where it lives (the game repository is private).

Office Space: where each enemy spawn value is tuned
ValueCurrentWhere it lives
count range (street)5–8SPAWN_PROFILES.office.contexts.street.count in game/src/ai/spawnTables.ts:882 (repository access required)
count range (floor)3–6SPAWN_PROFILES.office.contexts.floor.count in game/src/ai/spawnTables.ts:883 (repository access required)
count range (roof)0–2SPAWN_PROFILES.office.contexts.roof.count in game/src/ai/spawnTables.ts:884 (repository access required)
count range (service)5–6SPAWN_PROFILES.office.contexts.service.count in game/src/ai/spawnTables.ts:946 (repository access required)
family pool weightszombie 0.71, blightbelly 0.05, siren 0.19, ratdog 0.05, strainer 0, screacher 0, bb 0OFFICE_ENEMY_POOL in game/src/ai/spawnTables.ts:664 (repository access required)
coated chance0.4ZOMBIE_TYPES in game/src/ai/spawnTables.ts:379 (repository access required)
area weights7 rules, otherwise 1.3OFFICE_AREA_WEIGHTS in game/src/ai/spawnTables.ts:347 (repository access required)
capspasses 1 / 2 / 3; 2 rulesOFFICE_CAPS in game/src/ai/spawnTables.ts:361 (repository access required)
tries per area visit14OFFICE_PLACEMENT.tries in game/src/ai/spawnTables.ts:375 (repository access required)
spacing (m)4OFFICE_PLACEMENT.spacingM in game/src/ai/spawnTables.ts:375 (repository access required)
keep-away from the start (cells)18 m walking36OFFICE_PLACEMENT.startCells in game/src/ai/spawnTables.ts:375 (repository access required)
landing keep-off (m)5OFFICE_PLACEMENT.landingKeepM in game/src/ai/spawnTables.ts:375 (repository access required)
area weights2 rules, otherwise 1.4SERVICE_AREA_WEIGHTS in game/src/ai/spawnTables.ts:387 (repository access required)
capspasses 1 / 2; 1 rulesSERVICE_CAPS in game/src/ai/spawnTables.ts:396 (repository access required)
tries per area visit12SERVICE_PLACEMENT.tries in game/src/ai/spawnTables.ts:406 (repository access required)
spacing (m)5SERVICE_PLACEMENT.spacingM in game/src/ai/spawnTables.ts:406 (repository access required)
keep-away from the start (cells)18 m walking36SERVICE_PLACEMENT.startCells in game/src/ai/spawnTables.ts:406 (repository access required)
landing keep-off (m)6SERVICE_PLACEMENT.landingKeepM in game/src/ai/spawnTables.ts:406 (repository access required)
room modifiersroom key → family (or all) → {density, weight}none (all 1×)SPAWN_PROFILES.office.rooms in game/src/ai/spawnTables.ts:889 (repository access required)
eligibility (siren)floor; fallback zombie; at most 4 per levelOFFICE_SIREN_ELIGIBILITY in game/src/ai/spawnTables.ts:646 (repository access required)
difficulty tiermetadata only (no scaling)1LEVELS.office.tier in game/src/levels/registry.ts:70 (repository access required)
seeded roster rate (blightbelly)chance a level map holds the family at all; one roll per level seed0.6FAMILY_ROSTER.blightbelly in game/src/ai/enemyRoster.ts:154 (repository access required)
seeded roster rate (siren)chance a level map holds the family at all; one roll per level seed0.85FAMILY_ROSTER.siren in game/src/ai/enemyRoster.ts:156 (repository access required)
seeded roster rate (ratdog)chance a level map holds the family at all; one roll per level seed0.6FAMILY_ROSTER.ratdog in game/src/ai/enemyRoster.ts:158 (repository access required)
seeded roster rate (strainer)chance a level map holds the family at all; one roll per level seed0.35FAMILY_ROSTER.strainer in game/src/ai/enemyRoster.ts:160 (repository access required)
seeded roster rate (screacher)chance a level map holds the family at all; one roll per level seed0.4FAMILY_ROSTER.screacher in game/src/ai/enemyRoster.ts:162 (repository access required)
seeded roster rate (bb)chance a level map holds the family at all; one roll per level seed0.4FAMILY_ROSTER.bb in game/src/ai/enemyRoster.ts:175 (repository access required)