You are viewing a potentially older version of this package. View all versions.
Onononoki-GapCloser-1.3.2 icon

GapCloser

Fixes and speed-ups for Valheim, AzuCraftyBoxes, ValheimPlus and ExtraSlots: faster hammer menu and inventory near chests, occlusion culling, merged distant buildings, fast portals, rock support view, smoke off by default. Version-checked.

Date uploaded 3 weeks ago
Version 1.3.2
Download link Onononoki-GapCloser-1.3.2.zip
Downloads 110
Dependency string Onononoki-GapCloser-1.3.2

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2351 icon
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.2351

README

GapCloser

Fixes and speed-ups for Valheim and the mods I play with: a faster hammer menu and inventory near many chests, occlusion culling and merged buildings for big bases, fast portals, a rock support view for ore deposits, smoke off for more FPS, other mods' errors guarded.

Each fix turns on only for the game and mod versions it was checked against (game 1.0.20). Otherwise it stays off and the log says why, unless you turn on ForceOnUntestedVersions. Made for my own modpack, more fixes may come.

Smoke is off by default for more FPS. For the game's smoke, set Smoke = Normal in the 2 - Options section of the config.

All fixes

The game

  • Fast portals. A 0.25 s fade, and you arrive as soon as the destination is loaded (the game waits at least 8 s). 0.5 s between trips instead of 2.
  • Occlusion culling. Building pieces the walls fully hide are not drawn, their shadows stay. On by default on DirectX 11.
  • Hidden lights. Fires, torches and lamps of buildings whose light the walls fully hide go dark until they can be seen.
  • Merged distant buildings. Pieces farther than 48 m are drawn as a few merged meshes per area, far fewer draw calls.
  • Smoother loading near big bases. Objects near you are made within 4 ms a frame, nearest first, instead of up to 100 in one frame.
  • Unchanged chests are not rebuilt when their open flag changes or the ship under them moves.
  • Building effects pause off screen. Fires, ovens and portals no camera sees stop simulating and catch up when seen.
  • Light flicker pauses for lights whose light reaches nothing in view.
  • Rock support view. Each part of a mine rock you look at is tinted by what breaking it does. Blue holds others, green drops, red is held from outside, and yellow is held by other parts. Shift+O toggles the tint, and the tooltip shows your configured key. Range, linger time, and refresh interval are configurable.
  • Smoke off by default. No smoke from fires, kilns and smelters: much less physics near many fires, and no Smoked debuff. Fires, kilns and smelters work as before. Smoke = Normal brings the game's smoke back.
  • Recipe learning check once a frame instead of on every inventory change.
  • No warning spam from stakes and other damage areas.
  • Sun shadow culling (optional, off by default): pieces hidden from the sun stop casting sun shadows.

Other mods (each only for the version named)

  • AzuCraftyBoxes 1.8.19: faster hammer menu near many chests (each material is counted once, not again for every piece), faster inventory and crafting (chest counts kept until a chest changes, chest names kept), the Forge of Potential no longer teaches every recipe, gapcloser_fixrecipes removes the recipes it taught, its fermenter error guarded.
  • ValheimPlus 0.10.3.0: chest counts for crafting from chests without garbage, its breeding and tame hover errors guarded.
  • ExtraSlots 1.2.21: slot lookups without garbage, its Bows Before Hoes count skipped while that mod is not installed.
  • ValheimCommunityPatch 0.36.1 and 0.37.0: the smoother loading also works inside its spawn queue.

Measured at my castle (about 6,000 pieces)

  • All parts together (final test, no diagnostics): looking at the castle from outside 70 to 83 fps (+19 %, 2.3 ms a frame), inside 84 to 87 fps (+3 %, 0.3 ms). Smoke off adds about 5 % (0.7 ms).
  • Hammer menu with AzuCraftyBoxes: the slowest frame from 230 to 101 ms, the chest counting in it from 182 to about 5 ms.
  • Garbage with the inventory open: from 12.2 to 3.9 MB a second.
  • Portals: 0.25 s between floors, 2 to 6 s to bases that were not loaded.
  • Rock support: 95 of 95 hits dropped exactly the predicted parts.
  • Self-checks against the game and AzuCraftyBoxes found no difference in 580 skipped chest rebuilds and 1,566 hammer checks.

Commands

  • gapcloser_fixrecipes lists the recipes a character could not have learned, gapcloser_fixrecipes apply backs up the character and removes them. Runs by itself on entering a world when AzuCraftyBoxes is installed. In chat, type it with a slash.
  • gapcloser_rocksupport switches the rock support view.

Config

BepInEx/config/onononoki.GapCloser.cfg. Every fix can be switched off on its own. Sections: 1 - General, 2 - Options (Smoke, Off by default), 3 - Fixes, 4 - Rock Support (colors, key, range, linger time, refresh interval), 9 - Debug (logs, self-checks, and the benchmark keys: Home switches occlusion culling to compare, Shift+End measures every part and writes BepInEx/GapCloser_benchmarks.txt). Settings from older versions move to the new sections by themselves.

Rock support settings

These settings are in 4 - Rock Support.

Setting Default Effect
MaxDistance 25 Maximum distance in meters from your character to the aimed rock surface.
ShowSeconds 5 How long the tint stays after looking away. Set 0 for immediate hiding, or use a longer value such as 10 or 30.
RefreshSeconds 1 Seconds between normal support calculations. Set 0.5 for faster updates.
ToggleKey O + LeftShift Shows or hides the tint. The tooltip displays your binding and the current action.

The range still applies while the tint lingers. Targeting reuses the game's hover ray, which reaches 50 meters from the camera. Support colors refresh at the configured interval, and normal support calculations pause while the tint is hidden. The optional hit diagnostics can calculate outside that interval when RockSupportLogChecks is enabled in 9 - Debug.

Compatibility

  • Client side. Nothing to install on the server, other players do not need it.
  • AzuCraftyBoxes, ValheimPlus, ExtraSlots and ValheimCommunityPatch are optional. Made to run next to ValheimCommunityPatch.
  • Occlusion culling, hidden lights and sun shadow culling need DirectX 11 for now.
  • Occlusion culling and hidden lights leave out pieces that are not buildings, such as PlantEverything plants, saplings and debris, so they never flicker.
  • After a game update the game fixes stay off until a new GapCloser checks them, or until you turn on ForceOnUntestedVersions.

The following combination was tested in game with GapCloser 1.3.0 on Valheim 1.0.20. These are the tested versions, not a claim about every future release.

Mod Tested version How it runs alongside GapCloser
ValheimCommunityPatch 0.37.0 GapCloser's nearby object budget also runs inside its spawn queue.
ValheimOptimized 1.1.1 Works alongside GapCloser. Its own loop handles distant spawning, so GapCloser's distant object budget does not run there. The nearby budget still runs through ValheimCommunityPatch's queue when present.
Balrond Core Optimizer 0.2.5 Works alongside GapCloser with its default Conservative Mode. It covers different parts of the game and delegates overlapping work to ValheimCommunityPatch.

ValheimOptimized and Balrond Core Optimizer are not made obsolete by GapCloser. With ValheimOptimized loaded, ValheimCommunityPatch steps aside for four overlapping fixes, including hotbar keys and terrain work. Its hotbar stand-down warning is expected in that tested combination. The logs showed no exceptions or errors. Compatibility test details.

Dedicated teleport timing mods

GapCloser automatically skips only its FastTeleport patches when OdinPlus QuickTeleport or Muindor QuickTeleport is loaded. The other mod takes priority for teleport timing. Other GapCloser features remain active, and ValheimCommunityPatch alone does not disable FastTeleport.

Detection runs once after plugin creation and matches plugin IDs, not every mod that touches a teleport method. The FastTeleportOtherModIDs setting in 3 - Fixes defaults to elg.QuickTeleport,muindor.QuickTeleport. Add a comma-separated plugin ID for another dedicated teleport timing mod. Clear the list to disable automatic detection, or set FastTeleport = false to disable GapCloser's teleport changes manually. Restart after changing the list or installed mods.

The saved FastTeleport value is left unchanged. Removing the other timing mod lets GapCloser's version run again on the next start if that setting is true. QuickTeleport detection was checked offline. Teleporting with QuickTeleport installed has not been tested in game.

Credits

  • The rock support view's idea is from Ore Support by JereKuusela. The code follows the game's own support rule.
  • Hidden lights and building merging were inspired by ValheimBuildOptimization by RockBreaker (Dracoalias). No code was copied.

Feedback

Found a bug, or a gap in another mod that GapCloser could close? Open an issue on GitHub.

CHANGELOG

Changelog

1.3.7

  • Fixed walls and other building pieces not being drawn with ValheimCommunityPatch 0.46.0 and its new Building Render Batching.
  • Occlusion culling keeps working next to it and also hides its merged meshes. GapCloser's own merged distant buildings (PieceBatching) stand down while that setting is on.

1.3.6

  • New Wishbone forge warning. With the Wishbone equipped, it warns you when a Forge of Potential upgrade would destroy the item. WishboneForgeWarning in 2 - Options turns it off.
  • It stays off when the game's upgrade code changed (even with ForceOnUntestedVersions), leaves other crafting stations alone, and catches its own errors.

1.3.5

  • Works with Valheim 1.0.21. The game fixes no longer turn off with a new game version: each checks the game code it relies on at startup, like the fixes for other mods, and stays on while that code is unchanged. A changed method keeps its fix off, and the log names it.
  • Works with ValheimCommunityPatch 0.40.0 and ValheimPlus 10.4.0. The ValheimPlus breeding guard is not needed with ValheimPlus 10.4.0, which checks for the creature itself, and the log says so.

1.3.4

  • Fixes for other mods no longer turn off with every new version of that mod. Each checks the code it relies on at startup and stays on while that code is unchanged. A changed method keeps its fix off, and the log names it. ForceOnUntestedVersions still turns them on.
  • Works with ValheimCommunityPatch 0.39.0 (the smoother loading inside its spawn queue).
  • New startup log lines (ConflictScan) name other mods that patch the same methods as GapCloser, at the main menu and after spawning. They only inform.

1.3.3

  • Works with ValheimPlus 10.4.0 and ValheimCommunityPatch 0.38.0. The ValheimPlus chest counts and tame hover guard, and the smoother loading inside ValheimCommunityPatch's spawn queue, were checked against the new versions and turn on again. ValheimPlus 10.4.0 fixed its breeding error itself, so that guard stays for 0.10.3.0.
  • Fixed ValheimPlus' workbench spawn protection range not reaching the workbench, forge and artisan table. They kept 20 m while the stonecutter got the configured range, because ValheimPlus only resizes round areas and these stations use a capsule. New ValheimPlusSpawnArea setting in 3 - Fixes, on by default.

1.3.2

  • Fixed small trees, stones, branches and other plants flickering or disappearing (occlusion culling now leaves out pieces that are not buildings, for example PlantEverything plants).

1.3.1

  • Added the tested ValheimOptimized, Balrond Core Optimizer, and ValheimCommunityPatch versions and overlap details to the compatibility section.

  • FastTeleport automatically steps aside for OdinPlus or Muindor QuickTeleport. FastTeleportOtherModIDs can list other dedicated teleport timing mods. The saved FastTeleport value is preserved, and ValheimCommunityPatch alone does not disable it.

  • Rock support view now uses the game's existing hover ray. No additional camera raycast, and interaction reach stays the same.

  • Configurable rock view range and linger time. Defaults are 25 meters and 5 seconds after looking away. Set ShowSeconds = 0 for immediate hiding.

  • The rock tooltip shows the configured toggle key and whether it will show or hide the tint. The default remains Shift+O.

  • Normal support calculations refresh once a second by default. Set RefreshSeconds = 0.5 for faster updates. Hidden tint skips normal support calculations, and destroyed parts stop being drawn immediately.

  • Per-hit outcome diagnostics now run only with RockSupportLogChecks enabled.

  • Benchmark reports include the worst frame alongside the median and p95.

1.3.0

  • Faster hammer menu near many chests with AzuCraftyBoxes 1.8.19. At my castle the chest counting dropped from 182 to about 5 ms.
  • Big bases: distant buildings are merged into fewer meshes, lights hidden behind walls go dark, loading near big bases is smoother, unchanged chests are not rebuilt, light flicker pauses out of view. Together up to 19 % more FPS at my castle (70 to 83 fps outside, 84 to 87 inside).
  • New Smoke option, Off by default: no smoke from fires, about 5 % more FPS at my castle, no Smoked debuff. Smoke = Normal brings the game's smoke back.
  • Portals: 0.5 s between trips instead of 2.
  • Optional sun shadow culling, off by default.
  • Tidier config: numbered sections, logs, test settings and benchmark keys in 9 - Debug. Your old settings move over.
  • New benchmark key Shift+End: measures every part against all off, results in BepInEx/GapCloser_benchmarks.txt.
  • Hidden lights and building merging were inspired by ValheimBuildOptimization by RockBreaker (Dracoalias).

1.2.0

  • New: rock support view. Every part of the mine rock you look at or hit is tinted by what breaking it does (blue holds others, green drops, red held by the ground, yellow held by other parts), worked out from the game's own support rule. In my tests 95 of 95 hits dropped exactly the predicted parts. Shift+O hides the tint, gapcloser_rocksupport switches it. The idea is from Ore Support by JereKuusela.
  • New, still being tested: occlusion culling. Building pieces fully hidden behind walls are not drawn (shadows stay), on by default on DirectX 11. At my heavy castle 0.7 to 1.4 ms faster a frame. Home switches it, Shift+Home measures it. Can be switched off in the config.
  • Less garbage near chests with ValheimPlus 0.10.3.0 (crafting from chests), ExtraSlots 1.2.21 and AzuCraftyBoxes 1.8.19. With the inventory open at my castle garbage went from 12.2 to 3.9 MB a second.

1.1.0

  • Faster inventory and crafting stations near many chests with AzuCraftyBoxes 1.8.19. Chest counts are kept until a chest changes, its pull rules for a few seconds, and a debug text is built only with its debug log on. At my castle the stutters with the inventory open halved.
  • Fire, smoke and portal effects of building pieces pause while no camera sees them and catch up when seen again. The castle's particle work dropped by about a third.
  • The teleport log (Debug.LogTeleports) also writes how the 5 s after arrival went.

1.0.0

  • First release.
  • Fast portals and teleports (a 0.25 s fade, back as soon as the destination is loaded).
  • The Forge of Potential no longer teaches every recipe with AzuCraftyBoxes 1.8.19.
  • Recipe cleanup on entering a world (with AzuCraftyBoxes installed) and the gapcloser_fixrecipes console command, with a backup of the character first.
  • Guards for the ValheimPlus 0.10.3.0 breeding and tame hover errors and the AzuCraftyBoxes 1.8.19 fermenter error.
  • No more trigger damage warning spam from stakes, and the recipe discovery check once a frame.
  • ForceOnUntestedVersions turns the fixes on also for game and mod versions they were not checked against.