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. - Standing objects are not re-synced for nothing. Every creature, fish and item on the ground that another peer owns is pulled towards its network target 50 times a second. When nothing has changed — no new data, the object already at its target, its body asleep, zero velocity — that step is skipped; the moment anything changes it runs again. No movement is delayed or altered.
- 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— which of the game's own per-frame methods cost the most since the previous report (creatures, smoke, network sync, zone streaming…). The timer is on by default (MethodProfiler);pb prof offremoves it,pb prof onputs it back.pb sync— how many sync steps of standing objects were skipped since the previous report.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).SyncSkip(on) — skip the sync step of standing objects.SyncBatchPhysics(on) — hand moved objects over to the physics engine once per sync step instead of one by one.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.MethodProfiler(on) — start the method timer forpb profwhen entering a world.
