HighDeadlineSpawningFix
Fixes entities not spawning when deadline is too high
模組介紹 作者原文
High Deadline Spawning Fix
A simple Lethal Company mod intended to fix entities not spawning when the amount of days before deadline is above a certain number. Meant to be used with mods that increase the quota deadline, such as ProgressiveDeadline.
This mod should not have any effect if you are not the server host, but may or may not cause desyncs if not all players have the mod (untested).
About Vanilla Entity Spawning
Various formulas) related to the minimum number of spawned outdoor and indoor entities depend on the amount of days before deadline. In particular, the calculated minimum spawn count for both outdoor and indoor spawns follow the given form:
adjustedSpawnCurve + abs(daysUntilDeadline-3) / 1.6 - deviation
while the maximum spawn count follows the given form:
adjustedSpawnCurve + deviation
During normal, vanilla gameplay, this results in entities being more likely to spawn closer to the deadline, as daysUntilDeadline is typically a value between 0 and 3. However, when daysUntilDeadline exceeds 3 (either via save file editing or by deadline-altering mods), the spawn count formula starts to behave in unexpected ways (For the sake of simplicity, days until deadline will be referred to as 'days'):
- At days 4 to 14, entities start spawning more frequently the further the deadline is, completely opposite of the behavior between days 0 to 3.
- At day 15 and above, entities cease to spawn.
This is due to the spawning algorithm attempting to choose a number of entities to spawn between the integer value (floor) of the minimum spawn count and the maximum spawn count, using System.Random. However, starting day 15, (int) minimumSpawnCount becomes larger than (int) maximumSpawnCount, causing an ArgumentOutOfRangeException.
High Deadline Spawning Fix fixes that by modifying the daysUntilDeadline values used in the entity spawning formulas, without actually modifying the days until deadline. The way the mod achieves this is via either clamping the daysUntilDeadline value used in the calculation to a maximum value (default 3), or by using the modulo (mod 4) of the daysUntilDeadline value, configurable in the plugin's config file.
Config
The plugin has two configuration options:
- Clamp Type - Sets the clamp type.
- None: Vanilla behaviour
- Clamp: Clamps daysUntilDeadline to the maximum value specified by Clamp Value
- Modulo: gets the mod 4 of the daysUntilDeadline used in calculations (Default).
For a better understanding of how Modulo works, it treats higher deadline days as looping cycles of values between 0 and 3 days:
| Actual Days Before Deadline | Entities Spawn As If Days Before Deadline Was... |
| -------- | -------- |
| 0 | 0 |
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 0 |
| 5 | 1 |
| 6 | 2 |
| 7 | 3 |
| 8 | 0 |
|... |... |
- Clamp Value (Clamp) - Only used when Clamp Type is set to Clamp. Sets the maximum amount of days left before deadline. (Default is 3)
About
This mod was made for v81 and is originally intended for use in a personal duos modpack, and will likely not be maintained in the future. Please do not contact me, as I am a very busy person.
This mod may not be compatible with other mods that modify the game's entity spawning logic.
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: