Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
GenerallyLitServerMod
Day and night length, stack size, item weight and a smoother network send rate. Independent day/night, server-authoritative, no restart to change.
By SWATsqad
| Date uploaded | 2 weeks ago |
| Version | 1.1.0 |
| Download link | SWATsqad-GenerallyLitServerMod-1.1.0.zip |
| Downloads | 65 |
| Dependency string | SWATsqad-GenerallyLitServerMod-1.1.0 |
This mod requires the following mods to function
denikson-BepInExPack_Valheim
BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.
Preferred version: 5.4.2350README
Generally Lit Server Mod
A handful of numbers. No content, no new items, no UI, no external calls.
| Setting | Default | What it does |
|---|---|---|
| Day length in seconds | 840 | How long daylight lasts |
| Night length in seconds | 360 | How long night lasts |
| Stack size multiplier | 1 | Multiplies max stack of things that already stack |
| Item weight multiplier | 1 | Multiplies the weight of every item |
| Updates sent per second | 30 | How often a player's game sends what it controls |
At 840/360, x1, x1 and 0 sends it changes nothing.
Generally Lit server runs: 7200s day, 300s night, 10x stacks, 0.8x weight, 30 sends per second.
Independent day and night
Vanilla keeps one cycle length and splits it 70/30 in EnvMan.RescaleDayFraction
(raw 0.15-0.85 of the cycle is daylight). That split is hard-coded, which is why
mods exposing only "day length" can never give a long day and a short night.
This rebuilds the same curve from your two values, so a two hour day with a five minute night works.
Smoother ships and players
Whatever a player's game controls (their character, a ship they steer, creatures near them) reaches everyone else only when that game sends it to the server. Vanilla aims for 20 sends a second on a fixed timer, and each send waits for the next frame, so in practice it is about 14. On a ship the whole deck visibly steps.
With this mod a player's game sends 30 times a second, in the same frame the timer fires. Everyone on the server sees that player, and anything they control, move more smoothly. It costs a little upload per player. Only player games are changed; the server's own sending is left alone.
Every player needs the mod for their own sends to be faster. Players without it still see everyone else's smoother movement.
Server-authoritative
The server sends its values to every client on join. Clients use them while connected, are told in the log when they differ, and get their own back on leaving. Editing your config while on a server does nothing and says so, rather than looking like a broken mod.
Stack size and weight come from the server's item database and the cycle runs off server time, so those work for clients without the mod. Installing it everywhere keeps tooltips and lighting consistent and gives everyone the faster sends.
Config changes need no restart
The config file's timestamp is checked every 2 seconds. Edit it and the values apply and are pushed to everyone connected. Nobody gets disconnected for a number change.
One warning worth reading
Lowering the stack multiplier destroys items. Anything stacked above the new maximum is cut down the next time the world loads - not when you change the setting. On a dedicated server that is the next restart, often minutes after the last player leaves, so it looks fine for hours and then is not.
The mod remembers the highest multiplier it has run with and prints a loud warning when you lower it. Back up the world first, or spread over-sized stacks out before changing it. Raising is always safe.
Install
r2modman: install from Thunderstore, or Settings -> Import local mod -> pick the zip.
Manual: drop GenerallyLitServerMod.dll into BepInEx/plugins/.
CHANGELOG
Changelog
1.1.0
- New: Updates sent per second (default 30,
[Network]). A player's game sends what it controls (character, a ship it steers, nearby creatures) to the server at this rate instead of vanilla's fixed 0.05 s timer, and in the same frame the timer fires. Vanilla's send waits for the next frame, so at 70 fps it really sends about 14 times a second; ships visibly step for everyone aboard. The server's value is sent to every player. Only player games are changed, never the server's own sending. If anything in the hook ever fails, it switches itself off and vanilla sending carries on. - Fixed: config edits on a dedicated server now apply without a restart. 1.0.x used a FileSystemWatcher, which never fires inside the Linux server container, so server edits silently needed a restart. The file's timestamp is now checked every 2 seconds.
- Compatible both ways with 1.0.x: the send rate is appended to the server's settings package without changing its wire version, so a 1.0.x client still receives the server's stacks and day length, and a 1.1.0 client on a 1.0.x server keeps its own send rate.
1.0.2
- Fixed an exception during shutdown. The plugin unpatched itself in OnDestroy, which on quit runs before Game.OnApplicationQuit and left Harmony's wrapper for ZNet.Shutdown dangling, throwing "BadImageFormatException: Method has zero rva" inside the shutdown path that saves the world. The save completed regardless, but nothing of ours belongs near it. The mod no longer unpatches on quit, and the ZNet.Shutdown hook does nothing once teardown has started.
1.0.1
- The day/night rescale runs once per frame, so it no longer recalculates the dawn and dusk boundaries on every call. They are worked out when the settings change instead. No behaviour change; the per-frame path is now two field reads and one interpolation.
- The log line for the cycle now prints the dawn and dusk boundaries next to
vanilla's, so it is obvious what the split actually is:
Cycle length set to 7500s (7200s day + 300s night). Dawn at raw 0.0200, dusk at raw 0.9800 (vanilla is 0.1500 / 0.8500).
1.0.0
First release.
- Independent day and night lengths. Vanilla splits one cycle length 70/30 in
EnvMan.RescaleDayFractionand that split is hard-coded, which is why mods exposing only "day length" cannot give a long day and a short night. This rebuilds the same curve from two values, so a two hour day with a five minute night works. At the defaults (840/360) it reproduces vanilla exactly. - Stack size multiplier and item weight multiplier. Only things that already stack are multiplied; weapons and armour never become stackable. Original values are cached, so re-applying never compounds.
- Server-authoritative. The server sends its values on every join, clients revert to their own on leaving, and a client editing its config mid-session is ignored and told so.
- Config changes apply without a restart. The file is watched and new values are pushed to everyone connected.
- A loud warning when the stack multiplier is lowered, because the items above the new cap are destroyed at the next world load rather than when the setting changes.