A per-moon enemy spawning customization mod. Please request features or report issues here
Features
- Provides optional(disabled by default) settings to enhance your Lethal Company experience
- Some more control over how many enemies spawn, and on what moons
- Works with custom levels
- Works with custom enemies
- Should work with custom events and other mods that change enemy spawn settings
Bugs
- May or may not play nicely with other mods that forcefully change spawning behavior
Configuration
You must host or join a game at least once to generate the configuration files. Any missing or deleted files will be generated with the default options.Complex config types:
AnimationCurve
- Represents a curve comprised of Keyframes. Each frame represents a key, and a value at that key(generally time).- A curve with no frames is left blank
- A curve with one keyframe is described with a single number
- A curve with multiple keyframes is comprised of a keyframes(
key:value
) separated by commas
Enemies
There are 3 different enemy configuration files:
Enemies.cfg
- Responsible for all enemies that spawn inside.DaytimeEnemies.cfg
- Responsible for enemies that can spawn outside, but normally passive ones.OutsideEnemies.cfg
- Responsible for all enemies that can spawn outside, but normally hostile ones.
These configuration files do not interfere with each other, meaning enemies spawned based on one config will not count towards settings from another config(such as MaxEnemyCount).
Options
- General
Enabled
- Allow/Disallow this config to modify enemy spawning. You must enable this option to change enemy spawning behavior.MaxPowerCount
- Maximum total power allowed for this category of enemies. Different enemy types have different power levels. The total power of a level is the sum of the power levels of all existing enemies.SpawnAmountCurve
- An AnimationCurve from 0 to 1. The key represents the percentage of time progressed in the current level. The value is the amount of enemies to spawn at the given time.SpawnAmountRange
- The range of enemies that can spawn. A value of 3 means that 3 more or 3 less enemies can spawn, based on the value returned by theSpawnAmountCurve
.
- EnemyType - There is one section for each enemy. Invalid enemy types are ignored.
Rarity
- The weight given to this enemy vs other enemiesMaxEnemyCount
- The total amount of enemies of the given type that can spawnPowerLevel
- How much power an enemy of the given type counts forSpawnCurve
- An AnimationCurve from 0 to 1. The key represents the percentage of time progressed, much likeSpawnChanceCurve
. The value normally ranges from 0 to 1, and is multiplied byRarity
to find the weight.SpawnFalloffCurve
- An AnimationCurve describing how many enemies already exist, and the multiplier to use when determining the value ofSpawnChanceCurve
UseSpawnFalloff
- If true, then the resulting value from theSpawnFalloffCurve
will be multiplied with the value fromSpawnCurve
Exceptions:
- The
OutsideEnemies.cfg
optionSpawnChanceRange
has a hardcoded value of3
in-game, and cannot be changed
Spawn Logic
The enemy spawn logic in Lethal Company is a bit complex, and there are many additional variables that I did not make configurable. It would require a fairly large recode, and it would be more likely to cause problems with other mods. That said, here are some basic things to keep in mind when configuring enemy spawning:
- The number of vents does not limit how many enemies can spawn indoors
- The AnimationCurves dependent on time are always from 0 to 1. This includes if the total amount of hours is changed by another mod, or if the day progresses slower/faster.
- The AnimationCurves are not a linear progression from one frame to another. It is modelled by Unity's AnimationCurve, and therefore probably a smooth line
- The total enemy power level will not exceed but can equal the maximum power count
- There is a minimum amount of enemies that will spawn if certain conditions are met, such as an eclipse
- No more than 20 enemies can spawn at once
- The total amount of enemies that can spawn is calculated first; the enemy types to spawn are determined afterwards
- The chance of an enemy spawning is
weight of enemy type / total weight
, where the total weight is the sum of the weights of all enemy types - The weight of an enemy type is
rarity * spawn chance at the current time
. IfUseSpawnFalloff
is enabled(like baboon hawks), then it israrity * spawn chance at the current time * spawn falloff multiplier at the current time
.
Roadmap
- Additional settings
- Customizable spawning formulas
- YAML/JSON config files for more complex options
- Random events, maybe