Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
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.
By Qua8ion
| Date uploaded | a month ago |
| Version | 1.2.0 |
| Download link | Qua8ion-PieceBatcher-1.2.0.zip |
| Downloads | 27 |
| Dependency string | Qua8ion-PieceBatcher-1.2.0 |
This mod requires the following mods to function
denikson-BepInExPack_Valheim
BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.
Preferred version: 5.4.2350ValheimModding-Jotunn
Jötunn (/ˈjɔːtʊn/, 'giant'), the Valheim Library was created with the goal of making the lives of mod developers easier. It enables you to create mods for Valheim using an abstracted API so you can focus on the actual content creation.
Preferred version: 2.30.1README
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.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.
CHANGELOG
Changelog
1.2.1
- Within one network-sync step the game told the physics engine about every moved object separately
(
Physics.SyncTransformsafter each of them, ~85 times a step on a busy base). Now the moved objects are handed over once at the end of the step, before anything can ask the physics engine about them; outside that step the original call is left as it is.SyncBatchPhysicsin the config, counters inpb sync.
1.2.0
- Network sync of objects that stand still is skipped exactly: when no new data arrived from the owner, the object
is already at its target (within the game's own thresholds), its body sleeps and the sent velocity is zero, the
50 Hz sync step would change nothing, so it is not run. Anything changes (new data, the body wakes, something moves
it locally) and the sync runs as usual in the same step.
SyncSkipin the config,pb syncfor the counters. Measured on a base with ~250 synced objects: about 1.3 ms per frame went into these steps.
1.1.1
- The method timer is on from the moment you enter a world (
MethodProfilerin the config), sopb profprints a report right away;pb prof offstill removes it. The measurement window restarts when your character spawns, so loading does not skew the first report.
1.1.0
- Cells are now merged on a background thread: no more frame spikes while a base loads or after you hover pieces with the hammer. The main thread only collects the pieces and uploads the finished mesh, one cell per frame.
- Piece eligibility is cached per prefab and the collected parts per piece, so a rebuild touches far fewer objects.
pb loop: where the frame goes, by Unity subsystem (physics, scripts, animation, particles, render submission, waiting for the GPU).pb prof on/pb prof/pb prof off: timing of the game's own per-frame methods (creatures, smoke, sync, zone streaming and so on) while the measurement is on.pbalso reports garbage collections and the mod's own time per frame.
1.0.0
- Static build pieces of every 16 m cell are merged into one mesh per material: same picture, far fewer draw calls in the main pass, in the sun shadow cascades and in point-light shadow maps.
- Pieces that change (wear, damage, chest lids, hammer highlight, rain) fall out of the merge at once and are merged again after the cell goes quiet.
- Console command
pbwith frame statistics and a live on/off switch.