balrond better build

版本 v0.1.1·更新於 2026-09-09

Reworked Building Integrity System

模組介紹 作者原文

🏗️ Balrond Better Build

Balrond Better Build is an experimental performance and scalability mod for Valheim's structural integrity system.

Valheim normally recalculates structural support by repeatedly scanning nearby physics colliders for individual WearNTear objects. Balrond Better Build builds a cached, event-driven structural graph and updates only the parts of a construction affected by placement, destruction, terrain changes, streaming, teleportation, or ownership changes.

The mod is intended to reduce the CPU cost of large buildings and heavily populated generated locations while keeping Valheim-compatible support behavior.

Important: Structural replacement is a low-level gameplay change. Back up important worlds before testing a new version. Start with VanillaCompatible, keep the safety options enabled, and test large constructions on a copied world first.

Features

  • Event-driven cached structural graph
  • Supports player buildings, vanilla generated locations, and modded WearNTear prefabs
  • Budgeted work spread across frames
  • Active-area lifecycle management for travel and teleportation
  • Safe fallback to Valheim while a node is not ready
  • Session circuit breaker on replacement errors
  • Server-synchronized gameplay configuration
  • Optional Observe mode for comparing the graph against Valheim
  • Optional profiling of WearNTear.UpdateSupport and WearNTearUpdater.Update
  • Bounded list pools to reduce GC without permanently retaining unlimited memory
  • Anchor input-link compression for terrain- and world-supported pieces
  • Separate budgeted ownership and ZDO maintenance outside the replacement hot path
  • Optional delayed vanilla support-cache release with cooldown and per-frame limits
  • Information logging and runtime diagnostics can be completely disabled

How It Works

Each managed WearNTear object becomes a graph node.

The graph stores:

  • Structural colliders
  • Cached bounds
  • Direct support contacts
  • Reverse dependent links
  • Terrain or static-world anchor state
  • Material support properties
  • Last committed graph support

A normal replacement lookup is intentionally small:

  • Find the node by Unity instance ID
  • Verify that its cached result is ready and valid
  • Return the committed support value

Physics scans, topology rebuilding, ownership checks, ZDO writes, cache release, and island solving are performed by separate budgeted queues. They are not performed on every successful UpdateSupport lookup.

Anchored nodes

A piece directly supported by terrain or eligible static world geometry always resolves to its material's maximum support. Version 0.3.7 stops scanning the remaining colliders after a valid anchor is found and removes unnecessary inbound support links from that anchored node. The piece still keeps its outgoing dependent relationships, so it can support the rest of the structure normally.

Active areas

On a client or local host, nodes outside Valheim's active area are removed from the active graph. Returning to the location registers and rebuilds them again. This prevents previously visited bases and ruins from remaining in the local structural graph indefinitely.

Dedicated servers do not prune the world using one player's reference position. They rely primarily on runtime object lifecycle events and low-frequency safety reconciliation.

Installation

Compiled release

  • Install BepInEx for Valheim.
  • Place the compiled BalrondBetterBuild.dll in:

BepInEx/plugins/BalrondBetterBuild/

  • Start the game once to generate the configuration file.
  • Edit:

BepInEx/config/balrond.astafaraios.BalrondBetterBuild.cfg

Building the included source project

  • Open BalrondBetterBuild.sln in Visual Studio.
  • Add or copy the required references into Libs.
  • Select:

Release | Any CPU

  • Rebuild the solution.
  • Copy the resulting DLL to the BepInEx plugins folder.

ServerSync.d is included as a project. Config file is provided

Integrity Modes

| Mode | Behavior | Recommended use |

|---|---|---|

| Vanil

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。

檔案與校驗

檔案名稱
balrond_better_build-0.1.1.zip
檔案大小
181.6 KiB