ValPerfPatcher
Runtime fixes for performance hot spots in popular mods and the base game (less garbage, faster startup and world loading), found with ValPerfMonitor.
模組介紹 作者原文
ValPerfPatcher
Runtime fixes for performance hot spots found with ValPerfMonitor. It patches other mods in memory at startup. It never edits their files, and each mod keeps working the same way, minus the wasted work.
Fixes
| Fix | Target mod | Problem | Change |
|---|---|---|---|
| Skip idle zone sorting | HearthBelow 0.6.2 | Every frame it sorts all terrain zones with a new closure, even when no zone has work (~1 KB of garbage per frame) | On frames with no queued zone work, run only the distant-terrain and visibility updates. Frames with work run the original unchanged. |
| Cache backpack check | AzuExtendedPlayerInventory 2.6.1 | Its Adventure Backpacks compatibility asks "is this a backpack?" several times per frame, and each answer allocates (~2.5 KB per frame) | Remember the answer per item type, only once in a world |
| Backpack check without garbage | Adventure Backpacks 2.2.9 | Its patches on the game's ownership check and network calls read every object's name (gameObject.name, a new string each time) to spot its hidden backpack object: about 56 bytes on each of hundreds of checks per frame | The name is read once per object and the answer remembered |
| Minimap level text a few times per second | Creature Level & Loot Control 5.0.6 | Rebuilds the minimap's area level text every frame (a new dictionary, text replace, number text and a copy of the level thresholds, about 0.6 KB per frame) | Rebuilt at most every 0.25 s (setting Minimap level refresh seconds); the first update after the minimap opens runs at once. The shown level can lag by up to that long. |
| Reuse creature spawn entries | Mods bundling CreatureManager (Bestiary 1.2.1, Air Animals, Land Animals) | Every time an area loads, the mod takes its creatures out of the shared spawn list and builds them again from its config, with reflection per creature (about 0.35 ms per area with Bestiary) | Built once, then reused while they are still in the list and none of that mod's settings has changed. A setting change (also one synced from a server) rebuilds them at the next area, as before. |
| No stacked copies in new areas | Mod vegetation (RtD Ocean 2.2.51) | Some mod vegetation asks for groups of plants with no spread, so the extra plants of a group land exactly on the first: invisible copies that cost as much as real ones and stay in the world. RtD Ocean's seaweed, sponges, coral stones and crops do this (about a third of its seaweed near the coast) | In newly generated areas, one plant per group. The game's own vegetation and areas already generated are not changed. |
| Reuse gamepad button names | Jotunn 2.30.2 | "Joy!" + name builds a new string on about 80 input checks per frame (~2.4 KB per frame) | One cached string per button |
| Reuse dig preview fit | HearthBelow 0.6.2 | While a digging tool is held, the dig preview fits its rings to the ground every frame: up to 240 raycasts (about 0.2 ms per frame) | While the aim stays put (within 1 cm), reuse the last fit for up to 0.2 s. The preview and its settings are unchanged. |
| Reuse permission section name | Server Devcommands 1.115 | Every permission check (several per frame) lowercases the same section name into a new string | Lowercase it once and reuse it |
| Start building the world early | Riverheim 1.2.1 | Riverheim builds its whole world map (about 7 s on 32 threads) only after the game's 1.5 s start pause and the scene load | The same build starts in the background the moment a world is started from the menu; Riverheim takes its results when it gets there. Only when hosting your own world. |
| Biome map on all CPU cores | Valheim itself, with Riverheim 1.2.1 | Every world load the game looks up the biome and height of 4 million map points one at a time (about 5 s with Riverheim) | The same lookups split across CPU cores; each point is still filled once, so the map is the same. Only on Riverheim worlds, and only while no other mod hooks those lookups. |
| Save its settings once | Comfort Tweaks
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。
下面這些內容需要先安裝,否則該模組不會生效: