Valheim
Install with App

Details

Latest version
0.1.10
Last Updated
First Uploaded
Downloads
48
Likes
0
Size
78KB
Dependants
ADDatHost Valheim hosting
30% off

WorldCache

Keeps Valheim's generated world on your disk, the way Minecraft keeps its region files: a place you have been to (or prepared ahead) is read from the disk on the next visit instead of being generated again. You trade some disk space for faster loading. Plus a Prepare the world button that does it ahead in the background.

  • Works in the plain game and with other mods. Needs nothing but BepInEx.
  • Never touches your world save. The cache can be deleted at any time; places are simply generated again.
  • Multiplayer: each player's cache is their own and stays local, nothing is sent over the network. The mod is optional on the server and for every other player. Terrain edits come from the server as usual and are laid over the cached ground.

What is cached

Stage What When it helps
game.heightmap Zone and distant-terrain heights and biome masks (HeightmapBuilder.Build) Entering a world, portals, coming back to a base: a zone does not wait for the game's builder thread (one zone at a time, 10 ms apart)
game.minimap The world map for a client of someone else's server The game keeps the map only for worlds saved on your machine; a server's client builds it again on every join
mod stages Through the open API (WORLDCACHE_API.md) Mods with heavy generation (spherical worlds, rivers and lakes)

Honest numbers: measured with a spherical-world mod that uses the API, entering the world took 18.0 s without the cache and 16.3 s with it (about 9% faster; 723 terrain pieces read from the disk, none generated again). In the plain game the gain is smaller (a fraction of a second per load), plus the world map on a server's client, which the game otherwise rebuilds on every join. Objects of the world (trees, rocks, buildings) are not cached: the game keeps them in the save.

Never stale

  • The key: seed, world id, game version, mods and their versions, Harmony patches on the generation (WorldGenerator, HeightmapBuilder, Heightmap.Generate, ZoneSystem zone creation and placement; network calls and global keys do not count) and a hash of those mods' settings, including the ones a server sends. A change clears the cache and the BepInEx log says exactly what changed.
  • On entering a world a few cached pieces are generated again and compared. A mismatch clears that stage and the log names the mods patching the generation.

Settings

Settings → Graphics, section "World cache - WorldCache": on/off, disk limit, used space, Clear (this world / all worlds), preparation mode and volume, Prepare / Stop, progress. Every row has a "!" tooltip. Russian and English.

AdminMenu (F7) → "World cache" tab, if AdminMenu is installed.

Console (F5): worldcache, worldcache prepare [smart|around|world] [MB], worldcache stop, worldcache clear [all], worldcache invite.

Config: BepInEx/config/chistix.worldcache.cfg (limit LimitMB, default 2048).

First entry and preparing the world

Entering a world with no cache yet shows a note on the loading screen and then asks:

  • Wait: prepare the nearest places now (around you, bases and portals, what the map shows explored, found places) on all cores, with a progress window whose Play button lets you in while it goes on in the background.
  • Play: play at once; the cache fills as you explore and from the preparation in the background.

Prepare the world (volume 500 MB / 1 / 2 / 5 GB / custom): Smart (around you → bases and portals → explored on the map → altars and found places → the rest by distance), Around me, Whole world. It runs in the background in small portions, pauses on low FPS, in combat and while loading, shows a bar at the top of the screen, and carries on next time you enter the world. Only generation data is made, no objects of the world.

The host (or an admin, through a server running WorldCache) can invite the players who have the mod to prepare the bases and portals; each player decides. Players without the mod see nothing.

Install

  1. Install BepInExPack for Valheim.
  2. Put WorldCache.dll into Valheim/BepInEx/plugins/.

Uninstall: delete the DLL. To free the space, delete %USERPROFILE%\AppData\LocalLow\IronGate\Valheim\worldcache\ (one folder per world).

Troubleshooting: Valheim/BepInEx/LogOutput.log, lines starting with [... :WorldCache].

For mod authors

Chistix.WorldCacheApi (soft link by reflection, no reference to this DLL): register a generation stage with a version, a settings hash, dependencies, keysNear and generate; then Load / Save pieces by key and revision. See WORLDCACHE_API.md in the source.

Compatibility

Valheim 1.0.20 (network version 41), BepInEx 5.4.23 (BepInExPack Valheim 5.4.2350). Mods that replace the terrain generation are detected by their Harmony patches and become part of the key.

Early version (0.1.x). It has been run in a heavily modded world; report problems with your LogOutput.log.

Credits

  • BepInEx and Harmony.
  • Made by Chistix: idea, design, direction and testing. Code written with Claude Code (Anthropic) as an AI coding assistant, under Chistix's direction. No generated art or audio: the icon is drawn by a script.

License

All rights reserved (see LICENSE). Valheim belongs to Iron Gate AB; this mod contains none of its files.

Links

Support me on Patreon

Chistix on Patreon

My dev channel on YouTube

YouTube

My mods on Nexus Mods

Nexus Mods

Add me on Steam

Steam

Watch me on Twitch

Twitch

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.