NativeBackup

v0.1.1·Updated 2026-04-16

A simple backup valheim mod

About this mod Author’s original text

NativeBackup beta 0.1.1

NativeBackup beta 0.1.1 is a Valheim backup plugin that adds fast in-game backup triggers on top of Valheim's native backup system.

Ground Truth (Current Build)

NativeBackup currently provides:

  • Esc-menu Backup button integrated under Save.
  • Console commands: sb.backup, sb.backup world, sb.backup char, sb.list.
  • Automatic timed backups (optional) via config.
  • Native backup creation through Valheim save APIs.
  • Save-before-backup synchronization through current-version ZNet save flow.
  • Single-flight execution with cooldown guard.
  • Minimalist UX messaging with duration in completion/failure toasts.
  • Flashing top-right backup indicator while backup is running.

Backup Pipeline

Every trigger path (button, command, timer) follows the same pipeline:

  • Resolve requested target intent.
  • Enter coordinator gate (no overlap, 5-second cooldown).
  • Trigger native save sync via ZNet.Save(false, true, false) on main thread.
  • Wait for ZNet.SaveDoneTime to advance.
  • Create native backup(s) for selected target(s).
  • Emit concise completion/failure toast with elapsed time.

Important behavior details:

  • Explicit target commands are strict.
  • sb.backup world will not silently fall back to character.
  • sb.backup char will not silently fall back to world.
  • Backup sync is current-version only and does not use legacy trigger discovery fallbacks.
  • If save completion cannot be confirmed within timeout, backup is canceled to avoid stale snapshots.

User Experience

Design goals are minimal and informative:

  • No center-screen backup spam.
  • Flashing top-right backup badge while backup is running.
  • Backup button is grayed out while backup is running or cooldown is active.
  • Concise top-left toast on completion/failure/cancel with timing.

Examples:

  • Backup complete (1.8s): world 'MyWorld' and character 'test'.
  • Backup failed (1.2s): requested target unavailable.
  • Backup canceled (2.0s): could not confirm current save state.
  • Backup on cooldown.
  • Backup already running.

Target Rules

  • Hosted local world:
  • sb.backup world backs up world.
  • sb.backup char backs up character.
  • Esc button and sb.backup attempt both.
  • Non-host/client session:
  • sb.backup world is blocked.
  • Character backup paths remain available when character save is resolvable.

Commands

  • sb.backup - backup current available targets.
  • sb.backup world - world only (host required).
  • sb.backup char - character only.
  • sb.list - lists legacy archive index entries.

Cooldown behavior:

  • Backup actions use a 5-second cooldown window.
  • During cooldown, the Esc-menu Backup button remains disabled (grayed out).

Configuration

Config file: com.aloncifer.nativebackup.cfg

  • BackupIntervalMinutes: timed backup interval. 0 disables scheduler.
  • MaxBackupsPerSave: maximum number of native backups kept per save target.

Retention behavior:

  • Native backups are pruned after each successful backup so only the newest MaxBackupsPerSave entries remain per save.
  • Setting the value to 0 disables pruning.

Build and Install

  • Build target:.NET Framework 4.6.2.
  • Build command: dotnet build NativeBackup.sln -c Release.
  • Output: src/bin/Release/net462/NativeBackup.dll.
  • Install DLL to BepInEx plugins folder.

Notes

  • The backup badge uses IMGUI; icon glyph rendering can vary by system font.
  • Native restore/list rendering is still Valheim-owned UI behavior.
  • This build targets current Valheim save APIs and intentionally removes legacy trigger compatibility paths.

Install & use Install: BepInEx plugin

  1. The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
  2. 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.
  3. Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
  4. 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.

Dependencies

Install these first, or the mod will not work:

denikson-BepInExPack_Valheim

File & checksum

Filename
NativeBackup-0.1.1.zip
File size
65.9 KiB