You are viewing a potentially older version of this package. View all versions.
BananaPuncher714-LethalQuantities-1.0.13 icon

LethalQuantities

Customizable enemy and item spawning per moon. Works with custom enemies and items!

Date uploaded 5 months ago
Version 1.0.13
Download link BananaPuncher714-LethalQuantities-1.0.13.zip
Downloads 3629
Dependency string BananaPuncher714-LethalQuantities-1.0.13

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100

README

Lethal Quantities

A per-moon enemy and item spawning customization mod. All configs are disabled by default. Please request features or report issues here. Configs are generated after you host or join a game, and can be confirmed if this mod prints out debug information in the console about every moon and enemy type.

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
  • Change scrap min and max values, and rarity per moon
  • Change scrap amount and value multipliers per moon
  • Works with custom levels
  • Works with custom items
  • 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 with a key ranging 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 the SpawnAmountCurve.
  • EnemyType - There is one section for each enemy. Invalid enemy types are ignored.
    • Rarity - The weight given to this enemy vs other enemies. If you do not want the enemy to spawn, set the rarity to 0. A higher rarity increases the chances for an enemy to spawn.
    • MaxEnemyCount - The total amount of enemies of the given type that can spawn
    • PowerLevel - How much power an enemy of the given type counts for
    • SpawnCurve - An AnimationCurve from 0 to 1. The key represents the percentage of time progressed, much like SpawnChanceCurve. The value normally ranges from 0 to 1, and is multiplied by Rarity to find the weight.
    • SpawnFalloffCurve - An AnimationCurve describing the multiplier to use when determining the value of SpawnChanceCurve, dependent on the number of existing enemies with the same type divided by 10.
    • UseSpawnFalloff - If true, then the resulting value from the SpawnFalloffCurve will be multiplied with the value from SpawnCurve

Exceptions:

  • The OutsideEnemies.cfg option SpawnChanceRange has a hardcoded value of 3 in-game, and cannot be changed
Scrap

There is 1 scrap configuration file.

  • Scrap.cfg - responsible for all scrap generation

These configuration values are set per moon. Store items and items share the same spawning pool and are not separate.

Options

  • General
    • Enabled - Allow/Disallow this config to modify scrap spawning. You must enable this option to change scrap spawning behavior.
    • MaxScrapCount - Maximum total number of scrap items generated in a level.
    • MinScrapCount - Minimum total number of scrap items generated in a level.
    • ScrapValueMultiplier - Multiplies the value of a scrap item by this multiplier.
    • ScrapAmountMultiplier - Multiplies the total number of scrap on a level by this multiplier.
  • ItemType - There is one section for each item.
    • Rarity - The weight of this item, relative to the total weight of all items. A higher rarity increases the chances for an item to spawn.
    • MinValue - The minimum value of this item.
    • MaxValue - The maximum value of this item.
  • StoreItemType - There is one section for each store item.
    • Rarity - The weight of this item, relative to the total weight of all items. A higher rarity increases the chances for an item to spawn.

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 . If UseSpawnFalloff is enabled(like baboon hawks), then it is rarity * spawn chance at the current time * spawn falloff multiplier at the current time. Spawn falloff multiplier has a curve with a key that is the total amount of that mob / 10.

Roadmap

  • Additional settings
  • Customizable spawning formulas
  • YAML/JSON config files for more complex options
  • Random events, maybe

CHANGELOG

Changelog

1.2.9

  • Updated to Lethal Company v50
  • Fixed item weights from being host only
  • Fixed priorities being incorrect(low to high)
  • Added an option to change the moon's risk level and description
  • Added group spawn count option

1.2.8

  • Fixed map desync when changing the map size multiplier
  • Fixed enemies and outside enemies not displaying their spawn falloff curve option
  • Fixed web UI memory leak bug
  • Added live update option to allow on-fly configuration without needing to restart the game
  • Made web UI level list use planet names instead of ids

1.2.7

  • Fixed errors with RouteRandom
  • Removed errors complaining about legacy configs
  • Fixed bug where max enemy count wasn't being applied properly
  • Fixed moons with a price of -1 not updating with the correct information(may not always be correct)

1.2.6

  • Fixed incompatability with LLL
  • Removed lingering legacy code
  • Added more fallbacks in case of errors
  • Changed exported results to use level names instead of guid

1.2.5

  • Fixed global values not applying to moons without local configs
  • Made autogenerated global presets inherit from the exported global preset if available
  • Fixed scrap value multiplier from having the same title and tooltip as scrap amount multiplier

1.2.4

  • Fixed floats not being parsed properly when converting from json
  • Fixed scrap always being cleared but not set

1.2.3

  • Fixed incompatibility with translation mods that change the route and confirm words

1.2.2

  • Added a legacy option under Advanced in the global configuration to allow only using the legacy configuration files
  • Added a default global preset in the web UI
  • Fixed legacy export not being a correct representation of the configs

1.2.1

  • Updated README

1.2.0 - ONLY UPDATE IF YOU ARE READY TO DO SOME RECONFIGURING

  • Added new WEB UI
  • Removed old code using the outdated configuration system

1.1.17

  • Fixed error with March and other moons that may have more than 1 fire exit

1.1.16

  • Fixed incompatibility with LethalExpansion moons
  • Fixed loading/creating a save twice in one session breaking the game

1.1.15

  • Fixed configurations for moons with changed names not being found
  • Fixed potential dungeon flow duplicate entry in RoundManager's dungeon flows

1.1.14

  • Added compatibility with LethalLevelLoader so the dungeon generation config should work properly
  • Fixed dungeon flow desync as long as all players have the same dungeon generation config
  • Added a price update in a RoundManager start postfix to properly set moon prices

1.1.13

  • Added check for a spawn amount range value being too low
  • Added dungeon flow size modification for all players instead of host to prevent potential desync
  • Fixed prices sometimes not being set properly when going to certain moons
  • Identify valid and invalid items by checking with the NetworkManager

1.1.12

  • Fixed daytime enemies using outside enemies spawning pool
  • Added more null checks when searching for moon prices
  • Fixed certain moon default enemy and item rarities showing as 0

1.1.11

  • Fixed outside enemies not working as expected
  • Fixed level not loading if certain scrap rarity values were set above 0
  • Fixed some moon prices showing as -1 by default

1.1.10

  • Added compatibilty with LethalExpansion moons
  • Added in filters to check for moons and other objects with strange names
  • Added in a check for terminal nodes with a null word, again.

1.1.9

  • Fixed invalid enemies not spawning where they should(outside, inside, daytime)

1.1.8

  • Fixed error with certain mods that add terminal commands with a null word

1.1.7

  • Fixed moon prices being set no matter what

1.1.6

  • Fixed scrap always defaulting to the maximum value
  • Added custom travel cost per moon, for all moons

1.1.5

  • Fixed invalid global dungeon generation config preventing the level from loading

1.1.4

  • Fixed invalid global scrap config
  • Fixed incompatibilty with LethalLevelLoader configs by only adding dungeon flows if set in the dungeon generation config
  • Added trap config for interior map objects(turrets, landmines, etc)
  • Changed enemy and moon config names to be more user friendly(like Eyeless dogs instead of MouthDog, 220 Assurance instead of AssuranceLevel)

1.1.3

  • Fixed stuck screen when loading into certain moons
  • Fixed unknown scrap amount default value
  • Fixed improperly named enemy types for compatibility with Skinwalkers
  • Fixed EGypt and any other LethalLevelLoader moon incompatabilities
  • Formatted the config options to be slightly more readable

1.1.2

  • Added factory size multipler per dungeon flow
  • Sort some entries alphabetically to make them easier to locate, such as rarities

1.1.1

  • Fixed invalid scrap config not loading
  • Added configurable dungeon flows per moon

1.1.0 - IF UPDATING TO THIS VERSION THEN BACKUP ALL YOUR CONFIG FILES!

  • Create global config files to reduce clutter instead of individual files per every moon
  • Added optional per-moon configs for user selected moons
  • Added GLOBAL and DEFAULT options for certain options to fallback to the global config or default moon values
  • Added item weight and conductivity to the scrap config
  • Added enemy stun multiplier, door speed multiplier, stun game difficulty multiplier, stunnable, killable, and enemy hp to the enemy configs

1.0.14

  • Fixed numbers from being saved with commas instead of periods

1.0.13

  • Fixed enemies being hidden from other mods(SpectateEnemies)
  • Added store items to spawnable items

1.0.12

  • Fixed re-loading saves causing errors with custom moons

1.0.11

  • Fixed non interactive floating spider and other random enemies that may have appeared in strange locations
  • Changed config saving to load into the level a little faster
  • Updated configs with a QOL description including the user friendly name of the item/enemy

1.0.10

  • Updated config key naming convention to upper camel case

1.0.9

  • Removed MaxTotalValue and MinTotalValue scrap config options, as they did nothing
  • Added per item MaxValue and MinValue scrap config options
  • Added scrap config options for changing ScrapAmountMultiplier and ScrapValueMultiplier

1.0.8

  • Don't add enemies with a max enemy count of 0, even if the rarity is not 0
  • Changed enemy hideflags on spawn to work with other mods

1.0.7

  • Fixed configs not getting saved/loaded

1.0.6

  • Fixed randomly floating enemies in the middle of nowhere
  • Fixed compatibility with other mods like ScanForEnemies

1.0.5

  • Changed all enemy configs to use enemy name, instead of only outside enemies

v1.0.4

You should delete your configs if updating, since the config table names are different

  • Use GameObject name instead of item/enemy name

v1.0.3

  • Added configurable per level scrap options

v1.0.2

  • Fixed an issue where multiple levels may share the same scene name

v1.0.1

  • Change RoundManager patch to execute before LoadNewLevel with high priority to prevent overwriting other mods' events
  • Changed moon name to use the name rather than scene name
  • Fixed enemy types with a rarity of 0 from being added to the level as a potential spawn

v1.0.0

  • Initial release