Spawn Cycle Fixes
Fixes various bugs with the spawn cycle, making enemy spawns more consistent and fair.
This has no relation to Lost Enemy Fix or NestFix and should work with both. This also does not presently include VentSpawnFix, though this could change in the future.
List of Changes
All changes can be toggled on/off, though most are enabled by default.
Fixed double spawns occurring at the start of new days
- In vanilla, the day starts at about 7:39 AM, and the monster spawning cycle begins immediately by assigning enemies to vents.
- However, the second spawn wave, the first which actually includes outside/daytime enemies, does not occur until after all the vents are empty.
- When the first spawn wave assigns nothing to the vents, the second spawn wave occurs immediately on the next frame (at 7:40 AM)
- Otherwise (such during infestations, or just plain bad RNG), outside/daytime enemies get delayed until all enemies spawn from the vents - this can occur as late as 8:00 AM, and causes a noticeable delay in eclipse surface spawns.
- This mod standardizes the first spawn wave to follow the format of other spawn waves; all 3 classes of monster spawn, and the next wave occurs after 2 in-game hours.
Fixed time-of-day inconsistencies for spawn waves
- Spawn waves ("batches" internally) are intended to occur once every 2 hours
- The first occurs at 7:39 AM. Then there's another at 9:00 AM, 11:00 AM, 1:00 PM, etc. until 11:00 PM, when spawns are "complete".
- However, spawn waves are unable to occur when there are still enemies inside of vents waiting to pop out.
- Zeekerss wrote some code to limit vent timers to occur before the next spawn wave.
- For example, a spawn wave at 9:00 AM should only assign indoor spawn times between 9:10 AM and 10:59 AM, ensuring the vents will be empty by 11:00 AM.
- However, due to a logic error, the spawn timers are off by one hour.
- In the example given above, a 9:00 AM wave actually assigns vent times between 10:10 AM and 11:59 AM.
- When monsters are still in the vents past 11:00 AM, the 11:00 AM spawn wave gets postponed until the last monster exits the vents.
- The next spawn wave will still be attemped at 1:00 PM, but since the 11:00 AM wave can set timers as late as 1:59 PM, that wave can get delayed too.
- The odds of waves getting delayed is actually worse than a coin flip - effectively, there are 50 results that would be "on time" and 59 that are "late"
- This mod just corrects this off-by-one error, meaning spawn waves always occur exactly on-the-dot each day.
Fixed enemies exceeding maximum weight and becoming excessively common
- Some enemy types change their spawn chance based on how many of them have already spawned in that day.
- ex. When hoarding bugs and bees exist on the map, they reduce the chance of future ones spawning.
- Baboon hawks, nutcrackers, and "masked" are the opposite. As more spawn, they increase the chances of future ones spawning
- On certain moons, those monsters have their default weight set at or very close to 100.
- ex: Nutcrackers are 100 on Rend, baboon hawks are 85 on March and 52 on Adamance
- However, with their spawn curves, they are allowed to increase past 100, which causes them to spawn more predominantly than they normally should.
- In almost all other situations, a strict maximum of 100 is enforced:
- Challenge moons randomly select an indoor/outdoor enemy to have boosted spawn chances. That monster has its spawn weight set to 100.
- Interestingly, for Rend challenge moons that select nutcrackers as their "increased" enemy, it actually decreases their overall spawn chance in vanilla by locking their weight at 100, since the curve stops applying.
- Maneaters have their spawn weight multiplied by 1.7x when a mineshaft generates. That weight gets capped at 100 afterwards.
- No vanilla moons have a base weight high enough to encounter this case, but the design intent is there.
- Infestations set the subject monster (either hoarding bugs or nutcrackers) to 100 weight, and sets all other monsters to 1 weight.
- This mod enforces a strict limit of 100 for monster weight in all situations. There are options to apply this fix to custom moons, or just vanilla moons (since custom moons don't necessarily follow this design principle)
Old Birds no longer spawn once all dormant ones have awoken
- There is an unused flag in the game that seems intended to prevent Old Birds from spawning in future waves once all the ones present on the map have woken up.
- However that flag isn't actually used, allowing Old Birds to continue spawning at random for the entire day.
- When such an Old Bird spawns, it will "pop in" out of nowhere in a random spot on the map, with no proper spawn animation... which is quite ugly.
- This mod enables this setting for Old Birds, and also fixes a bug where it created spawn conflicts with other monsters, as Zeekerss likely would've done the same if he decided to use this flag.
Old Birds spawned from apparatus now impact maximum spawns
- Currently, when the apparatus is unplugged, all Old Birds on the map immediately wake up.
- However, none of those Old Birds add to the "current number of Old Birds spawned" counter, or add to outdoor power level.
- This allows monster spawns to overflow past their normal limits.
- Under absolute worst conditions, this means you can have up to 40 Old Birds at once on Embrion!
- This mod makes Old Birds add their normal spawn values when they are woken up by the apparatus.
- Overflow still can occur, but only if the action of unplugging the apparatus itself directly causes overflow - and then no future spawns will occur until the power level drops back to normal levels.
Mask hornets can now occupy power level
- Due to mask hornets having special spawn circumstances, their power level is currently ignored completely - butlers dying spawn the hornets themselves, and also clear out space for more enemies to spawn.
- While disabled by default, this mod will let you force mask hornets to apply their power level upon spawning.
- In vanilla, mask hornets are 2 power level, just like butlers. So killing butlers will effectively not free up any power level.
- This should be consistent with mods that change enemy power levels if you are interested in making adjustments to the exact values.
Several fixes to the outside spawn predictor
- Vanilla tries to predict all outside enemy spawns that will occur over the course of the day, for the sake of spawning baboon nests and dormant Old Birds.
- While it likely will never be 100% perfect, I have fixed several issues that the default predictor has trouble with:
- Spawn waves are now predicted for the correct times. (Vanilla's predictor is one hour too early on every spawn wave, and does not factor in "vent delay" like I've mentioned fixing above)
- Enemies that spawn in groups (like baboon hawks) will now be tracked in groups, which makes nests spawn more consistently and also ensures they track the correct amount of power.
- The 100 weight limit now applies to the predictor if you have the setting enabled for it.
- The predictor had code to factor in eclipses, but eclipses get set up after the predictor runs, so that never worked in vanilla. I've settled that now
Challenge moons no longer have different spawns after several attempts
- Vanilla spawns extra monsters per wave, if all players survive for 5 days in a row while collecting a certain amount of money for each of those days.
- Due to an oversight this "streak" mechanic still exists during challenge moon gameplay, which changes the amount of monsters that spawn when you are in the middle of a streak.
- Additional spawns means greater potential for nutcrackers, butlers, etc. which increase the amount of loot available per day.
- Effectively you have to waste 5 "sub-optimal" attempts just to get favorable loot spawns going forward, and you'd have to repeat this process any time a player dies.
- This also means you are punished for killing players (for the additional $15 in bodies) at the end of an attempt.
- This mod changes so much about spawns that it practically invalidates challenge moons anyway, but fixing this felt "right" anyway, so there you go
Compatibility
Consistent Spawn Times applies the bulk of new changes I implemented into this mod. If you only want the settings from Buttery Fixes back, then you can disable that one setting and everything else will work as it did before.
For Buttery Fixes users, the Limit Spawn Chance and Mask Hornets Power settings work here exactly the same as they did when they were in that mod, so copy over your config for those.
I renamed UnlimitedOldBirds to Limit Old Birds, so if you previously had that setting enabled, you will want to disable the corresponding setting from this mod.
⚠ IMPORTANT ⚠ reminder: If you are still using Lethal Quantities, enabling Limit Old Birds will completely block Old Birds from spawning, due to a bug with that mod!
Credits
Thanks to cookiecaker for the monochrome, sketchy, transgender icon