EnemySpawningData

EnemySpawningData (filled)

Defines sleeper spawns.

Fields

GroupType - eEnemyGroupType (enum)

Type of enemy group to match in EnemyGroupDataBlock.

Hunter is made for blood doors.

Patrol is broken.

Rest of valid values result in hibernate, and invalid values result in no spawns.

Difficulty - eEnemyRoleDifficulty (enum)

Difficulty of enemy group (and further along - role) to match in EnemyGroupDataBlock and EnemyPopulationDataBlock.

Distribution - eEnemyZoneDistribution (enum)

Distribution mode.

Force_One will always spawn exactly one group.

Rel_Value will use score system.

DistributionValue - Single

When Distribution is set to Rel_Value, the score multiplier for the value set in ExpeditionBalance.

How to pick enemy spawns

Enemy spawning system

Enemy spawns in this system are quite roundabout. The system for picking what enemy to spawn can be visualized like this:

There are several layers of randomization present here. The process for each EnemySpawningData entry is as follows:

  1. Select an EnemyGroup entry matching GroupType and Difficulty settings randomly (using weights);

  2. Deduct MaxScore from remaining distribution for this EnemySpawningData entry (if not forced);

  3. For each role, match an EnemyPopulation entry using Difficulty and Role settings randomly (using weights);

  4. Spawn selected population entry's Enemy matching EnemyDataBlock PersistentID. Number of enemies spawned is MaxScore * RoleDistribution / Cost (e.g. using settings seen in picture - 12 * 1 / 1 = 12. Function used for rounding is RoundToInt;

  5. Repeat the process until remaining population score is equal to or below 3.

In practice, MaxScore has a hardcoded random multiplier of 1-1.2. In the above example, you might end up with up to 14 strikers (score deducted from remaining distribution is also adjusted). If you want exact counts of enemies, you'll have to use Force_One settings.

EnemyGroup Type "Hunter" is special - always spawns aggressive enemies. Use it only for blood doors.

EnemyPopulation Role "Scout" is special - it spawns enemies in scout mode. Use it only for scouts.

EnemyPopulation Role "Patroller" is special but broken - don't use it.

Simplifying the process

The enemy selections are randomized by both enemy group and enemy population. This can be considered overkill, and some modders simplify selection by sticking to specific rules they set for themselves.

For example, you can set rules for EnemyGroup Type:

  1. Use "Hunter" type for blood doors (naturally, since this is required for blood doors);

  2. Always use type 0 when randomizing spawns, only relying on difficulty to filter;

  3. Use type 1 and difficulty matching enemy persistentID when forcing specific enemies to spawn.

The reason we don't just use type and difficulty both matching enemy persistentID is because the game is hardcoded to check for specific types and not spawn anything if it doesn't match. Difficulty has no checks to it.

Last updated