UnifiedAutoSaveInterval
Configurable combat-aware Valheim autosave interval for hosted worlds and local characters.
About this mod Author’s original text
Unified Auto Save Interval
A tiny BepInEx plugin that changes Valheim's own built-in autosave interval and
can postpone autosaves briefly while players are in combat.
Default normal interval: 600 seconds / 10 minutes.
Default maximum combat delay: 120 seconds / 2 minutes.
The mod does not implement a separate save system and does not create custom
save files. It only adjusts Valheim's existing Game.m_saveInterval.
Why
Valheim officially exposes -saveinterval for the dedicated server executable,
but not as an in-game setting for normal clients or worlds hosted through
Valheim's Start Server option.
Frequent autosaves reduce progress loss after crashes, but an autosave can also
cause a noticeable hitch. The combat protection therefore allows the normal
autosave to wait briefly when somebody is actively fighting.
Behaviour
In-game host / Start Server
The host process owns the world, so the normal interval applies to:
- the hosted world;
- the host's local character.
With ProtectAllPlayersWhenHosting = true, the host checks all connected
players. If a creature is targeting any of them when the autosave becomes due,
the save may be postponed.
Joining client
A joining client does not own the server world. The configured interval applies
to that client's local character save.
Combat protection only watches that local player on a joining client.
Maximum delay
Combat never disables saving indefinitely.
Example with the defaults:
- normal autosave: 600 seconds;
- maximum combat delay: 120 seconds;
- hard maximum interval while combat remains active: 720 seconds.
If combat ends earlier, the normal 600-second threshold is restored. If the
normal save is already overdue, Valheim's own autosave runs immediately after
the short combat-clear window.
Combat detection
Combat is considered active when a creature's Valheim BaseAI currently
targets a protected player.
A short clear window keeps combat active for a few seconds after the last target
disappears so retargeting does not rapidly toggle the save threshold.
The default clear window is 5 seconds.
Configuration
After first launch:
BepInEx/config/daishi11.valheim.unifiedautosaveinterval.cfg
Defaults:
[General]
SaveIntervalSeconds = 600
[Combat]
AvoidSavingDuringCombat = true
MaxCombatDelaySeconds = 120
CombatClearSeconds = 5
ProtectAllPlayersWhenHosting = true
Useful normal intervals:
- 600 = 10 minutes
- 480 = 8 minutes
- 300 = 5 minutes
- 60 = 1 minute for short testing
Allowed normal interval: 60 to 3600 seconds.
Allowed maximum combat delay: 0 to 600 seconds.
The settings can also be changed through compatible BepInEx configuration UIs.
Compatibility
- No Harmony patches.
- No custom save format.
- No custom backup system.
- No Jotunn dependency.
- Uses Valheim's existing autosave timer and save routines.
Tested for the Valheim 1.0.x modpack using BepInExPack Valheim 5.4.2350.
Recommended setup
For normal play:
SaveIntervalSeconds = 600
AvoidSavingDuringCombat = true
MaxCombatDelaySeconds = 120
CombatClearSeconds = 5
ProtectAllPlayersWhenHosting = true
For a quick combat test:
SaveIntervalSeconds = 60
MaxCombatDelaySeconds = 30
Stay in combat across the one-minute save point. The log should report combat
protection and the save should either run shortly after combat clears or at the
90-second hard maximum.
License
MIT.
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file. In multiplayer, the host and every client need the same mods installed.
Install these first, or the mod will not work: