ButteryStancakes-VentSpawnFix icon

VentSpawnFix

(Still works, but it's highly recommended to use LethalFixes by Dev1A3 instead, which includes this bugfix and many more) Fixes a bug with the spawn wave logic for indoor enemies.

Last updated a day ago
Total downloads 244
Total rating 2 
Categories Misc BepInEx Server-side Monsters
Dependency string ButteryStancakes-VentSpawnFix-1.1.1
Dependants 0 other packages depend on this package

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

Vent Spawn Fix

It is highly recommended you instead use LethalFixes by 1A3, which includes many additional gameplay fixes including this one.

Original Description

Fixes bugs with the "spawn wave" logic for indoor enemies. Only the host needs to install this mod

TL;DR: Fixes current indoor "power level" increasing without threats actually spawning under certain circumstances. Also fixes "forced spawn waves" (such as during eclipses or after pulling the apparatus) sometimes spawning fewer enemies than intended.

THIS WILL GENERALLY MAKE THE GAME HARDER. However, it will also make the difficulty more consistent, and accurate to the intended design - and it NEVER causes the difficulty to exceed the intended maximum difficulty values.

As of v1.1, this mod now also adds support for vent enemies to spawn in groups larger than 1. (Primarily for v55's Barber.)

Full explanation of the original bug (Looong)
  • Every 2 hours, the game performs "spawn waves" where it generates new enemies inside and outside the building.
  • Rather than outdoor enemies, which spawn instantly, indoor enemies always spawn from vents after a period of delay. When an enemy is assigned to a vent, that vent is marked as "occupied" until the enemy inside of it spawns.
  • Additionally, when an enemy gets assigned to the vent, its "power level" (used to rank how disruptive a monster is; hoarding bugs have a power level of 1, thumpers are 3) is added to the moon's current indoor power level. Every moon has a "power level cap" that limits the total amount of threats that can spawn. (Experimentation is as low as 4, while Titan is 18)
  • The only time a moon's power level is decreased if an enemy gets killed after it spawns. (So shoveling a thumper would reduce power level by 3, thus allowing 3 more power-level-1 enemies to spawn, or another power-level-3, power-level-2 and power-level-1, etc.)
  • At the beginning of each indoor spawn wave, the game generates a list of all unoccupied vents on the map. Then, after calculating how many enemies (and of what type) to spawn, it assigns each one to a random vent in the list.
  • The issue occurs because after an enemy is assigned to the vent and it becomes occupied, it DOES NOT get removed from the generated list of empty vents.
  • As such, any enemies spawning on the same wave are able to randomly select that same vent, and also get assigned to it.
  • Any time a monster is assigned to an occupied vent, the previously-assigned monster effectively gets "deleted", as vents can only spawn one monster at a time. However, its power level never gets removed from the moon's power level, because the game is still erroneously anticipating it will spawn in the future.
  • Since it never spawns, it can't be killed, and it effectively wastes some of the moon's power level permanently until the ship leaves and all spawn variables get reset.

Trivia: This bug is most likely to occur on Embrion during Eclipsed weather, which is configured to spawn 4+ enemies every 2 hours, and has an interior size of 1.1x, causing very few vents to generate on the map.

The solution
  • Whenever a monster is being assigned to a vent, it will first check to make sure the vent is unoccupied before occupying the vent.
  • If the vent is already occupied, then it will generate a new list of unoccupied vents, and will try to reassign the enemy to a different empty vent if there is one available.
  • In the event that all vents are occupied, then the remainder of the current spawn wave is canceled. (Vanilla limits the number of enemies per spawn wave to the number of vents on the map, anyways)