Valheim
Install with App

Details

Latest version
1.0.7
Last Updated
First Uploaded
Downloads
4.9K
Likes
3
Size
213KB
Dependants
ADDatHost Valheim hosting
€1

FastAssetBundleLoader

Game loads faster with large size mods by caching asset bundles.

It speeds up repeated mod startup by caching slow asset bundles into reusable files in a shared folder under Valheim's Unity persistent data path. The implementation is based on the same general approach as DiFFoZ's BepInExFasterLoadAssetBundles, but is adapted and trimmed for this Valheim-focused project. https://thunderstore.io/c/lethal-company/p/DiFFoZ/BepInEx_Faster_Load_AssetBundles_Patcher/

What it does

  • It checks loaded UnityFS bundles with format version 6 or newer for caching and recompresses eligible bundles into reusable LZ4 files. Eligibility is broader than LZ4HC: the header's compression flags describe the blocks-info table, not necessarily the bundle's data blocks. Recompression that produces identical bytes is recorded so it does not repeat on later loads.
  • Install FastAssetBundleLoader.dll in BepInEx/patchers. Both release archives contain the DLL under patchers/ and can be extracted into the BepInEx directory.

Cache behavior

  • Cache files are stored under <Application.persistentDataPath>/FastAssetBundleLoader/cache/v1 by default. On Windows this is normally %USERPROFILE%/AppData/LocalLow/IronGate/Valheim/FastAssetBundleLoader/cache/v1.
  • Profiles using the same storage root reuse cache entries for identical bundle contents. Changed bundles get separate entries. v1 is the cache format version, not the mod release version.
  • In BepInEx/config/sighsorry.fast_asset_bundle_loader.cfg, leave [General] CacheRootDirectory empty for the default location, or set an absolute storage root on another drive. FastAssetBundleLoader/cache/v1 is always appended. Relative paths are not accepted.
  • Old CacheDirectory settings and caches under BepInEx/cache are not used or migrated. Existing files are left untouched; the shared cache is populated as eligible bundles load.
  • Only one game process can use a given cache directory at a time. If the cache is busy or inaccessible, the other instance uses original bundle loading without caching for that run. An existing .cache.lock file is normal; the open file handle, not the file's presence, determines ownership.
  • To reset the shared cache, close all game instances and delete only the dedicated FastAssetBundleLoader/cache/v1 directory. Do not delete the Valheim save-data directory. Resetting the cache affects every profile sharing that location.
  • Cache files are created only when eligible asset bundles are actually loaded.
  • A single run may not warm every cache entry if the game is closed before the background queue finishes or if some bundles are loaded only in specific scenes. Later runs may therefore become faster.
  • For a broader warm-up, enter a world instead of stopping at the lobby and keep the game running until cache activity settles. Different gameplay paths may create additional entries, so caching every installed asset bundle is not guaranteed.
  • Cache could take up to few GB of your disk space according to the mods you are using. (More than 3GB in my case)
  • The main measured benefit is repeated loading to the lobby. Improvements from lobby to world depend on which eligible bundles are loaded and may not be noticeable in every setup.

Configuration

Settings are stored in BepInEx/config/sighsorry.fast_asset_bundle_loader.cfg. Restart the game after editing the file; the patcher reads its configuration during startup.

Section Key Default Behavior
General Enabled true Enable asset bundle caching and redirects.
General CacheRootDirectory empty Use Unity's persistent data path, or specify an absolute storage root. The dedicated FastAssetBundleLoader/cache/v1 directory is appended.
Cache MinimumFreeDiskSpaceGb 10 Skip creating cache entries below this free-space threshold.
Cache RetentionDays 0 Remove cache entries not reused for this many days. 0 disables retention cleanup.

The Valheim launch argument --ignore-space-check bypasses the free-disk-space threshold for that process. The argument is case-insensitive and does not change the saved configuration.

Building and packaging

FastAssetBundleLoader.sln builds FastAssetBundleLoader.csproj, producing bin/Release/netstandard2.1/FastAssetBundleLoader.dll. Use a .NET SDK and a Valheim installation containing BepInEx and the game's managed assemblies. Run these PowerShell commands from the repository root:

# Build without installing the DLL or creating release packages.
dotnet build .\FastAssetBundleLoader.sln -c Release

# Specify a nonstandard game installation.
dotnet build .\FastAssetBundleLoader.sln -c Release "-p:GamePath=D:\SteamLibrary\steamapps\common\Valheim"

The project derives its BepInEx and managed-assembly reference paths from the selected game installation. -p:BepInExPath=... and -p:CorlibPath=... can override those paths explicitly.

Game deployment and package creation are separate opt-in operations. Close the game before replacing an installed DLL.

# Copy the DLL and its PDB, when present, into BepInEx/patchers.
dotnet build .\FastAssetBundleLoader.sln -c Release -p:DeployToGame=true

# On Windows, update the manifest version and create both release ZIPs.
dotnet build .\FastAssetBundleLoader.sln -c Release -p:CreatePackages=true

DeployToGame and CreatePackages default to false. Package creation runs only for Windows Release builds and does not deploy to the game unless DeployToGame=true is also supplied. It updates Thunderstore/manifest.json to the assembly version and overwrites the matching ZIPs under Thunderstore and Nexus. Both archives contain patchers/FastAssetBundleLoader.dll; Thunderstore also contains the README, changelog, manifest, and icon at the archive root.

Verification

The managed tests link production bundle-header, hashing, file, and metadata code with a logger stub. They require a .NET 8 runtime and can run without Valheim or Unity:

dotnet test .\Tests\FastAssetBundleLoader.Tests.csproj -c Release

The PowerShell 7 boundary checks inspect the built loader and exercise managed paths using the installed game and BepInEx assemblies. Build the loader in the same configuration first:

dotnet build .\FastAssetBundleLoader.sln -c Release
pwsh -NoProfile -File .\Tests\Verify-RuntimeHooks.ps1 -Configuration Release
pwsh -NoProfile -File .\Tests\Verify-CacheReservation.ps1 -Configuration Release

For a nonstandard installation, pass -p:GamePath=... to the build and -GamePath ... to each verification script. These checks do not launch Valheim, install Harmony detours, or execute Unity native asset loading. Actual game verification still requires cold-cache and warm-cache launches, mod combinations, and client, host, and dedicated-server runs.

Other mods to run the game faster

  • StartupAccelerator
  • LocalizationCache

I have tested with following combination to measure loading time.

  • Modpack only = 246s
  • FastAssetBundleLoader + Modpack = 170s
  • StartupAccelerator + Modpack = 202s
  • LocalizationCache + Modpack = 218s
  • FastAssetBundleLoader + LocalizationCache + Modpack = 145s
  • FastAssetBundleLoader + StartupAccelerator + Modpack = 127s

StartupAccelerator is faster but some mods might not work properly with it.

DatHost — Valheim server hosting, first month for one euro
DatHost — Valheim server hosting, first month for one euro
DatHost — Valheim server hosting, first month for one euro
DatHost — Valheim server hosting, first month for one euro
DatHost — Valheim server hosting, first month for one euro