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

LethalQuantities

Customize enemies, items, prices, dungeon flows and traps for all moons. Works with custom content and non-intrusive. Great for modpack balancing! Now with a web UI!!

Date uploaded 3 weeks ago
Version 1.2.9
Download link BananaPuncher714-LethalQuantities-1.2.9.zip
Downloads 16078
Dependency string BananaPuncher714-LethalQuantities-1.2.9

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 flexible customization mod that works with other mods. Now comes with a WEB UI! All configs are disabled by default. Please request features or report issues here. Configs are generated after you host or join a game

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
  • Works with custom traps
  • Works with custom dungeon flows
  • Works with per-moon prices to travel to other moons
    • Make travel cheaper between certain moons to emulate star maps!
  • Should work with custom events and other mods that change enemy spawn settings
  • Comes with a web UI to make it easier to edit

Known Incompatibilities

  • Moon price changing mods
    • If you modify moon prices with LethalQuantities, other mods may not be able to change the price correctly, or at all.
    • For developers:
      • The moon prices are set in a prefix for StartOfRound.ChangeLevel with a priority of 200. You can add your own prefix(with a higher priority value) or postfix to ensure that your prices are set properly.

Pictures

Welcome screen Preset menu Editor

Configuration

Web UI

Configuration is now managed through the web UI. The old config files are deprecated and should not be used. To use the new web UI, first host or join a game, then edit the LethalQuantities/Advanced/Preset.json file in the config folder with the web UI. Once complete, download and save it to the same file(LethalQuantities/Advanced/Preset.json), and restart the game.

Legacy

However, in the case that you need to or can only use the config files, you can enable the UseLegacy option in the global config to allow the legacy configuration files to take priority over whatever is set through the web UI. 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. By default, the only file that is generated is Configuration.cfg. You must enable global config files and individual moon config files in order to modify anything.

  • Configuration.cfg - Enable/disable other configuration files here

Global/local option inheritance

This mod uses global/local config files to reduce the amount of configuration and files required. For certain options in the configs, you can use the value DEFAULT(case insensitive) to use the vanilla value that would normally be used. For certain options in the moon config files, you can use the option GLOBAL(case insensitive) to use values in the global config files. If the global config file is DEFAULT, then it will use the vanilla value. If the global config does not normally have a default value, for example, rarity(since it's moon specific), then it will use the moon's default value. So, if a moon has GLOBAL for an enemy's rarity, and the global config does not exist or has DEFAULT, then it is the same as if the moon option is DEFAULT. Moons have higher priority over global config options, so if both have a value set, the moon's value will be used instead. For options that allow GLOBAL, a blank value is the same as GLOBAL, and for options that allow DEFAULT but not GLOBAL, a blank value is the same as DEFAULT. If a global config file is disabled, then it will have no effect on moon options that are set to GLOBAL and is equivalent to DEFAULT. A value of DEFAULT should not override values set by other mods.

Complex config types:

  • AnimationCurve - Represents a curve comprised of Keyframes. Each frame represents a key, and a value at that key(generally time). For more information, and a visual representation, check out the mechanics.
    • A curve with no frames is specified with a 0.
    • A curve with one keyframe is described with a single number. This option is recommended for most users unless you know what you are doing.
    • A curve with multiple keyframes is comprised of a keyframes(key:value) separated by commas
  • Global/inheritable options - Represents an option that can be inherited from the global configuration. Generally found in the moon configs.
    • GLOBAL or no value uses the global value
    • DEFAULT uses the default local value
    • Any value that is neither will be used directly instead
  • Defaultable options - Represents an option that can be modified, or left default/empty to do nothing. Generally found in the global config. If a moon specific option(like rarity) is left default, then it will use the moon's default value
    • DEFAULT or no value uses the default value
    • Any value that is not DEFAULT or empty will be used directly
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, EnemyHp, etc).

Options

  • General
    • 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.
      • For example, a curve described by 0:-3, .6:1.5, 1:15 would mean that for the first 60% of the day, almost no enemies are going to spawn, but for the last 40%, a lot will spawn.
    • 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. Not available for outside enemy configs. This value must be greater than or equal to the amount of days at the start of the quota divided by 2, rounded up.
  • EnemyType - There is one section for each enemy. Invalid enemy types are ignored.
    • 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
    • GroupSpawnCount - How many enemies will spawn together at once. Will not spawn more than allowed by the maximum power level.
    • 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. For more information, view the Spawn Logic section below
    • StunTimeMultiplier - The multiplier for how long an enemy can be stunned.
    • DoorSpeedMultiplier - The multiplier for how long an enemy takes to open a door.
    • StunGameDifficultyMultiplier - I don't know what this option does.
    • Stunnable - Whether or not this enemy can be stunned.
    • Killable - Whether or not this enemy can die.
    • EnemyHp - The amount of health an enemy has. A shovel does 1 hit of damage by default.
    • 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. Not available for the daytime enemy configs.
    • UseSpawnFalloff - If true, then the resulting value from the SpawnFalloffCurve will be multiplied with the value from SpawnCurve. Not available for the daytime enemy configs.
  • Rarity - There is one option for each enemy type. Invalid enemy types are ignored.
    • <enemy type> - 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. The chance of this enemy spawning is the rarity of this enemy divided by the rarity of all the enemy types combined.

Exceptions:

  • The OutsideEnemies.cfg option SpawnChanceRange has a hardcoded value of 3 in-game, and cannot be changed
  • The DaytimeEnemies.cfg does not use SpawnFalloffCurve when calculating the total rarity.
Scrap

There is 1 scrap configuration file.

  • Scrap.cfg - Responsible for all scrap generation

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

Options

  • General
    • MaxScrapCount - Maximum total number of scrap items generated in a level, inclusive.
    • MinScrapCount - Minimum total number of scrap items generated in a level, exclusive.
    • 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.
    • MinValue - The minimum value of this item, inclusive. Only available for scrap items.
    • MaxValue - The maximum value of this item, exclusive. Only available for scrap items.
    • Weight - The weight of the item. The real in-game weight can be calculated with the formula: pounds = (value - 1) * 100. For example, a value of 1.18 is 18lbs. Can only be set in the global scrap config.
    • Conductive - Whether or not the item can be struck by lightning.
  • Rarity
    • <item name> - The weight of this item, relative to the total weight of all items. A higher rarity increases the chances for an item to spawn. Includes store items. The chance of this item spawning is the rarity of this item divided by the rarity of all the items combined.
Dungeon Generation

There is 1 dungeon generation configuration file.

  • DungeonGeneration.cfg - Responsible for configuring values that affect dungeon generation

These configuration values are set per moon. They should theoretically support custom dungeon flows.

Options

  • General
    • MapSizeMultiplier - A multiplier for how large the dungeon generation should be. Cannot be set per-flow
  • DungeonFlow - There is one section for each DungeonFlow
    • FactorySizeMultiplier - A multiplier for how large the dungeon generation should be for this flow.
  • Rarity
    • <dungeon flow name> - The weight of this flow, relative to the total weight of all flows. A higher rarity increases the chances for this flow to be used. May not work with custom dungeon flows since LethalLevelLoader forcefully overrides this.
Trap Spawning

There is 1 trap configuration file

  • Traps.cfg - Responsible for configuring how many traps can spawn inside

These configuration values are set per moon. They support custom traps.

Options

  • Trap - There is one section for each trap type
    • SpawnAmount - The amount of this trap to spawn. This is an AnimationCurve, where 'Y Axis is the amount to be spawned; X axis should be from 0 to 1 and is randomly picked from.'
Prices

There is 1 price configuration file

  • Prices.cfg - Responsible for configuring pricing per moon

These configuration files are set per moon. They support custom moons.

Options

  • Level - There is one section for each moon
    • TravelCost - The amount in credits that it costs to travel to this moon. Note that you cannot travel to the moon you are currently on, so it has no real effect. You can charge to go to The Company Building, but it does not display until you confirm.

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:

  • This is the vanilla behavior. This does not apply to mods that implement custom spawning algorithms.
  • 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

  • Copy and paste functionality on web UI
  • Add host config syncing
  • Preferences for the web UI
  • Moon difficulty rating and description editing
  • Default values for empty fields in the web UI
  • Statistical display of overall generated presets
  • Weather customization
  • Per dungeon flow and weather settings
  • Additional settings
  • Lights out?

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