Please disclose if your mod was created primarily using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
SpawnCycleFixes
Fixes various bugs with the spawn cycle, making enemy spawns more consistent and fair.
| Date uploaded | a day ago |
| Version | 1.1.0 |
| Download link | ButteryStancakes-SpawnCycleFixes-1.1.0.zip |
| Downloads | 1769 |
| Dependency string | ButteryStancakes-SpawnCycleFixes-1.1.0 |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2305README
Spawn Cycle Fixes
Fixes various bugs with the spawn cycle, making enemy spawns more consistent and fair.
Now supports Vent Spawn Fix's "indoor enemies can spawn in groups of 2+" feature.
This has no relation to Lost Enemy Fix or NestFix and should work with both.
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 as 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.
- This bug also caused spawn curves to be sampled from the wrong time of day; for example, a 9 AM spawn wave would use the spawn counts from 10 AM.
- This interaction is also fixed by this mod.
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.
- Challenge moons randomly select an indoor/outdoor enemy to have boosted spawn chances. That monster has its spawn weight set to 100.
- The only exception to this weight cap is Cadavers on Adamance, which start at 200 base weight (although this value is ignored due to special spawn conditions)
- With the above in mind, a strict limit of 100 weight is enforced for almost all situations. There are options to apply this fix to all moons, or just vanilla moons (since custom moons don't necessarily follow this design principle)
- Monsters with a base weight of 101+ in the original spawn list will be ignored automatically
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 immediately be despawned (as no nest exists for it to occupy) but this still means 1 less actual enemy will spawn during that wave.
- This is actually desirable for "natural spawns" (before power level from killed enemies is taken into account), to ensure these all spawn in the same order and time-of-day based on the seed.
- However, once these deterministic spawns are complete, Old Birds will still continue wasting slots for "bonus enemies" that spawn with the refunded power level, which makes later waves inconsistent.
- This mod now blocks Old Birds from being selected in place of other enemies, only after all of the seed-determined enemies are spawned, which should provide "the best of both worlds"
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.
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
Kidnapper fox now subtracts correct power level
- When a kidnapper fox spawns, it consumes "weed power", which is exclusively used for the kidnapper fox as of v81.
- However, because it's tagged as an outside enemy, when it dies, it subtracts from outside power, allowing more dogs/giants/etc. to spawn.
- With this mod, weed enemies (currently just the kidnapper fox) now subtract from weed power on death, which fixes this issue.
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!
For Vent Spawn Fix users, indoor group spawns will "just work". You are free to disable any settings you don't want to use.
Credits
Thanks to cookiecaker for the icon
CHANGELOG
v1.1.0
- Refactored for v81's spawn system
- Incorporated Vent Spawn Fix as a built-in feature
v1.0.0
- Initial release