
You are viewing a potentially older version of this package. View Latest Version
PieceBatcher
Client-side FPS for big bases: merges static build pieces of each 16 m cell into one mesh per material. Same picture, far fewer draw calls in every pass, point-light shadows included. No gameplay or network changes.PieceBatcher
Client-side FPS for big bases without touching your graphics settings. The game draws every build piece as its own object: one draw call in the main pass, one in each of the four sun shadow cascades and one in each of the six faces of every point light with shadows. A hall with a few torches turns four thousand pieces into tens of thousands of draw calls per frame. PieceBatcher merges the static pieces of every 16 m cell into one mesh per material, so the same geometry with the same materials is drawn in a handful of calls. The picture is the same; the engine just works less.
- Same picture. Same meshes, same materials, same shadows, same lighting; nothing is hidden, simplified or culled. Merged pieces are always drawn at full detail (the game's own LOD switch is only for far away pieces).
- Nothing changes in the game. Client-side only, no server part, nothing written to the world or sent over the network. Building, repairing, damage, wear, rain, chests, highlighting with the hammer all work as before: a piece that changes falls out of its merged mesh at once and is merged again two seconds after the cell goes quiet.
- What is merged: opaque pieces drawn with the game's
Custom/Pieceshader (walls, floors, beams, roofs, stone, furniture, chests). Doors, carts, ships, portals, item stands, signs' text, windmills, anything that moves or animates, and transparent pieces are left as they are. - Works alongside ValheimPerformanceOptimizations and ValheimCommunityPatch; they do not touch the same thing.
Console (F5)
pb— counters and frame times of the last 10 seconds (average and 1% worst), garbage collections, the mod's own time per frame.pb scene— the same plus a scan of the scene: renderers, lights with shadows, particles, creatures, smoke.pb loop— where the frame goes, by Unity subsystem: physics, scripts, animation, particles, render submission, waiting for the GPU. Averages since the previouspb loop.pb prof on→ play 10–20 s →pb prof— which of the game's own per-frame methods cost the most (creatures, smoke, network sync, zone streaming…);pb prof offremoves the measurement.pb cell— the cell you are standing in.pb off/pb on— switch merging off and on without leaving the game, to compare FPS.pb rebuild— rebuild every cell now.
Config (qua8ion.valheim.piecebatcher.cfg, ConfigurationManager friendly)
Enabled— switch (live).CellSize(16 m) — cell edge. Smaller cells cull more precisely off screen, larger cells make fewer meshes.RebuildDelay(2 s) — how long a cell waits after the last change before it is rebuilt.FrameBudgetMs(3) — milliseconds per frame spent on rebuilding.MinParts(2) — a material with fewer pieces in a cell is not merged.MaxVertices(60000) — larger merged meshes are split.Shaders— shaders allowed into a merge, comma separated.ExcludePrefabs— prefab names never to merge, comma separated.LoopProbes(on) — keep the frame-loop probes forpb loop; they cost a fraction of a microsecond per frame.