FloodedLevelsFixed
Fixes a bug that breaks Flooded weather after the first day of a new session.
Date uploaded | 7 months ago |
Version | 1.1.0 |
Download link | ButteryStancakes-FloodedLevelsFixed-1.1.0.zip |
Downloads | 7164 |
Dependency string | ButteryStancakes-FloodedLevelsFixed-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.2100README
Flooded Levels Fixed
If all you want to know is what this plugin does, it addresses a basegame issue with time syncing that usually causes floods to "freeze" and never adjust water level throughout the day. This plugin fixes that bug, making water level adjustments work properly and consistently each time you land on a flooded moon. Only the host should need this mod, but it will still work fine if everyone installs it together.
If you want a more technical explanation as to what is going on:
- Time syncing across the network occurs every 10 in-game minutes. (~7 realtime seconds) At this moment, the server sends the time of day to all the clients connected to the game, and they will update their time of day to match.
- Flooded weather's target water level only updates when this time sync action occurs - after the sync, it calculates where the flood's water level should be based on the current time of day, and then sets the target water level to that value.
- However, due to an oversight in the vanilla code, time syncing only occurs properly on the very first day of a freshly hosted session.
- Time syncs only occur when the server's time exceeds the stored timestamp of the previous time sync.
- The issue occurs because the variable that keeps track of the last timestamp a time sync occurred never gets decreased or reset in between days.
- For example, when a time sync occurs at 5:00 PM, the next time sync will occur at 5:10 PM.
- If you then leave the moon and land again, the server's time will reset back to 8:00 AM.
- The last synced timestamp does not get reset, and thus, time sync will not occur again until the server reaches 5:10 PM - 9 entire in-game hours where the flood won't move at all.
- The flood will appear frozen for most of the day, but once the time sync finally occurs, it will suddenly activate and move at a greatly increased rate until it "catches up" to the intended water level.
This plugin fixes the time sync behavior by resetting the last sync timestamp if the server's global time is more than 20 seconds behind it. Afterwards, time syncing will occur as normal for the rest of the day, and floods will always work exactly as intended, no matter when you left the previous moon.