Enemy Spawn Director¶
Enemy Spawn Director (ESD) monitors what is happening during the playthrough and controls how enemies spawn (when, where and in what numbers) to create the best possible player experience.
Spawn points generation¶
For ESD to work properly, each level must be marked up with potential enemy spawn points. Having many spawn points to consider, the ESD decides which of them to be used and when.
Spawn out-of-view¶
Spawn points visible to players are locked in order to prevent enemies from spawning in sight. For visibility check, the system treats each spawn point as having the "volume", so a point is considered invisible only if it can spawn several enemies, all of which would not be seen at that moment.

Spawn distance¶
ESD spawns enemies at a distance that suits their type and the gameplay they reinforce. Enemies with ranged attacks spawn farther from players, but close to points offering line of fire (LOF) and the desired engagement distance. Melee-oriented enemies spawn closer to reach players faster.

Cleared spawn points¶
Spawn points that have been recently seen up close are temporarily locked. This approach prevents enemies from appearing in locations the player considers cleared after passing through them recently. The lock is temporary to avoid situations where the system cannot spawn any enemies at all under certain circumstances.

Wave direction¶
ESD prioritizes spawn points to create a consistent "wave direction" rather than surrounding the player randomly. Thus, enemies attack the player from a general direction: either shooting from a distance or advancing for melee. This feature creates a more controllable combat experience:
- Players can manage the battlefield without being constant outflanked.
- Playing with a controller is more comfortable, as the player does not have to turn around too often.
Special enemies ignore this rule, so they can produce unexpected, intense, but short-timed threats.

Special enemies spawn spots¶
Different enemy types are allowed to use specific spawn points, which allows you to customize spawn conditions per enemy type. For example, an ambush-focused special enemy can spawn in special positions, such as clinging to walls or ceilings, while other enemies cannot use those spawn points.
The level of threat generated by ESD fluctuates in a cycle of waves and breathers:

- Tension — time when players have to be ready for a new combat scene. During tension, they can encounter idle enemies (when progressing through the level), lesser waves of common enemies, and occasional special enemies.
- Wave — time when players have to actively fight against a wave of incoming enemies. Along with a wave of common enemies, players can encounter special enemies and mini-bosses.
- Breather — time for players to relax after a wave, to heal themselves and search for pickups. During a breather, players encounter almost no idle enemies (when progressing through the level), no waves, and no special enemies (excluding those who are trying to ambush players) or mini-bosses.
Swarm wave¶
Sometimes the Wave stage could arrive in a much more challenging form. Enemies attack in higher numbers and with higher pressure. This event’s appearance is limited by several conditions:
- High cooldown.
- Team stress is not too high (see below).
- Team is actively progressing through the level (see below).
Maintaining pressure¶
Common enemies are spawned in an organized manner in order to maintain the desired pressure. Each enemy has a specific challenge rating, and ESD constantly tries to maintain the required challenge by controlling the amount of different enemies that are actively fighting players at any given moment.
Enemies spawn and attack in groups. This approach provides players with a constant flow of enemies, rather than a routine of killing enemies one by one.
ESD spawns the next group when the count of actively attacking enemies drops below the required pressure, bringing the pressure back up to that level. As a result, during a wave the enemy count remains balanced — neither too many nor too few.
Overrides and manual spawn¶
Level designers can override the most important ESD parameters (such as wave time, breather time, and pressure) to implement custom gameplay scenarios and events (e.g., infinite waves).
Warhammer 40,000: Space Marine 2 © Games Workshop Limited 2024. Space Marine, the Space Marine logo, GW, Games Workshop, 40K, Warhammer, Warhammer 40,000, 40,000, the 'Aquila' Double-headed Eagle logo, and all associated logos, illustrations, images, names, creatures, races, vehicles, locations, weapons, characters, and the distinctive likeness thereof, are either ® or TM, and/or © Games Workshop Limited, variably registered around the world, and used under licence. Focus Entertainment and its logos are trademarks, registered or not, of Focus Entertainment. Saber Interactive and its logos are trademarks, registered or not, of Saber Interactive. Powered by Wwise © 2006 – 2024 Audiokinetic Inc. Havok software is © 2024 Microsoft. Uses Bink Video. Copyright © 1997-2024 by Epic Games Tools LLC. All rights reserved to their respective owners.