You are viewing a potentially older version of this package. View all versions.
DragonMotion-BalrondNatureOptimizer-0.7.7 icon

BalrondNatureOptimizer

Conservative compatibility and performance fixes built specifically for Balrond Amazing Nature 1.3.8.

Date uploaded 2 weeks ago
Version 0.7.7
Download link DragonMotion-BalrondNatureOptimizer-0.7.7.zip
Downloads 126
Dependency string DragonMotion-BalrondNatureOptimizer-0.7.7

This mod requires the following mods to function

Balrond-balrond_amazing_nature-1.3.8 icon
Balrond-balrond_amazing_nature

An total overhaul adding over 700 new objects + changes to all vanilla objects

Preferred version: 1.3.8

README

Balrond Nature Optimizer

Conservative compatibility and performance fixes for Balrond Amazing Nature 1.3.8.

Version 0.7.7 is intentionally narrow. It keeps the verified fixes that still match Amazing Nature 1.3.8, restores the bounded material-state guard, adds exact handling for the two small portals and floating ocean debris, and removes the obsolete 1.3.7 branches and the unreleased 0.8 runtime GPU experiment.

Amazing Nature 1.3.8 is a hard, exact runtime contract. The Thunderstore package depends on that release, the DLL declares a versioned BepInEx dependency, and startup additionally checks the loaded plugin metadata for equality with 1.3.8. A mismatch leaves the optimizer inactive instead of applying uncertain patches.

All settings are captured once at startup. Fully restart Valheim after changing the config.

What 0.7.7 keeps

  • Allocation-free replacement for BalrondHashCompat.StableHash reflection.
  • Serving Tray master disable, pre-mutation auto-registration block, and exclusions for four audited 196k-243k triangle food displays.
  • Poison-geyser generation disable or one-time particle/light/spawner limits when geysers remain enabled.
  • Swamp clutter and vegetation controls, plus Amazing Nature clutter density and non-instanced clutter controls.
  • Opt-in, startup-only protection against Amazing Nature's overbroad force-alpha material pass.
  • Optional one-time shadow removal on five audited heavy building templates.
  • The Balrond Constructions null hit-effect compatibility repair.
  • Verified vanilla streaming patches: distant-terrain slicing, exact ZDO comparer caches, StaticPhysics recheck cadence, and terrain-triggered clutter time-slicing.
  • Session cleanup for the two current Amazing Nature caches and optimizer-owned state.

The old lava, Plains heat, biome-message width, status/stamina, Deep North, station/converter, Dverger, iced-tree, stalagmite, recipe, tutorial, tentacle, obsolete world-field, texture, mip, and heavy-tree LOD branches are not present in 0.7.7.

Monster Climbing

Disable Monster Climbing defaults to false, so Amazing Nature's climbing remains enabled unless the user deliberately turns this option on.

Amazing Nature 1.3.8 improved this feature: its Harmony postfix is still entered from every Character.CustomFixedUpdate, but expensive climbing checks are now limited by CheckInterval = 0.1 seconds. An eligible grounded monster can therefore reach two Physics.SphereCast calls about ten times per second, rather than on every 0.02-second physics step. The feature is still measurable in dense combat, while its movement benefit is also real; keeping it enabled by default is the safer gameplay choice.

When the option is enabled, the optimizer resolves only these exact 1.3.8 members:

  • Character_CustomFixedUpdate_Patch.Postfix(Character, float);
  • Character_OnDestroy_Patch.Prefix(Character);
  • MonsterClimbing.States, with the exact Dictionary<Character, ClimbState> shape.

It first proves that the exact upstream update postfix is installed, removes it, verifies removal, then clears States, and only then removes the cleanup prefix. If any prerequisite cannot be proven, the dictionary and remaining upstream behavior are left intact.

New 1.3.8 prefab tuning

The portal and debris changes run once, after Amazing Nature registers its prefabs. They require exact prefab/component signatures and make no partial change after a signature mismatch.

Prefab Audited original Default 0.7.7 change
portal_NatureSmall_bal 8 looping particle systems, 6 AlwaysSimulate, total cap 5,600, one shadowed realtime point light All 8 systems use Automatic culling, each cap is limited to 384, and only the exact portal light loses shadows.
portal_StoneSmall_bal 7 looping particle systems, 4 AlwaysSimulate, total cap 5,400, one shadowed realtime point light All 7 systems use Automatic culling, each cap is limited to 384, and only the exact portal light loses shadows.
FloatingDebris_bal One looping vfx_water_surface, cap 1,000, AlwaysSimulate Only that system uses Automatic culling and a cap of 256.

Portal networking, teleport logic, colliders, and audio are untouched. Floating debris keeps ZNetView, Floating, ZSyncTransform, Rigidbody, Container, colliders, loot, and auto-destroy behavior. Its decorative mesh shadows are changed only by the separate opt-in heavy-shadow setting.

Rendering-only prefab tuning is skipped in batch/dedicated-server mode.

Material-state guard

Amazing Nature 1.3.8 still treats nearly every tracked material with a non-null _MainTex as an alpha-cutout candidate. Its existing startup pass can enable alpha-test keywords, set queue 2450, force _Cull = 0, and alter cutoff/blend properties even for authored opaque Piece, Creature, and StaticRock materials.

The restored guard does not enumerate Unity objects or start another material pass. It wraps only Amazing Nature's exact ReplaceShader(Material, string) and ForceAlphaCutoutFix(Material) calls:

  • Conservative Material State Fix preserves authored cutoff and culling state, and blocks the second broad force pass for non-vegetation Piece/Creature and exact StaticRock materials.
  • Aggressive Opaque Material Restore implies the conservative path and, only when no authored alpha intent is detected, also restores alpha keywords, blend/ZWrite state, and render queue.

Both settings default to false. Opaque state cannot prove that a texture contains no intended alpha. The guard is save/network neutral and has no per-frame cost, but users should visually verify affected assets before enabling the aggressive option.

Suppress Duplicate Material Passes was removed completely. Every Amazing Nature material pass now runs; both the old Balrond Shaders key and the short-lived 06 - Rendering key are purged during config migration.

Configuration

Section Setting Default Scope
01 - General Enable Optimizer true Master startup switch.
02 - Amazing Nature Runtime Replace StableHash Reflection true Same stable-hash result without reflection invocation.
Disable Monster Climbing false Gameplay-changing exact unpatch and state cleanup described above.
03 - Serving Tray Enable Serving Tray Integration false Allows Amazing Nature to turn foods into build pieces.
Disable Automatic Consumable Registration true Keeps manual entries but blocks the broad food scan.
Exclude Extremely Heavy Food Displays true Blocks four audited high-poly food displays before mutation.
04 - Swamp Disable Poison Geysers true Removes their Swamp generation and keeps lightweight network roots for old records.
Optimize Poison Geysers When Enabled true Used only when geysers are not disabled.
Geyser Max Particles Per System 512 Range 32-2,000.
Geyser Spawner Max Near 4 Range 0-20.
Geyser Spawner Max Total 12 Range 0-100.
Disable Balrond Swamp Clutter true Removes only the Swamp biome bit from five clutter definitions.
Disable Balrond Swamp World Vegetation true Removes the Swamp bit from the audited extra trees/saplings.
Disable Balrond Swamp Resource Vegetation false Optional resource tradeoff for Guck rock/sacks.
05 - Balrond Clutter Balrond Clutter Density Percent 50 Scales only Amazing Nature clutter attempts; range 0-100.
Disable Non-Instanced Balrond Clutter true Disables its six separate-GameObject clutter entries.
06 - Rendering Optimize Portal Effects true Exact one-time portal particle/light tuning.
Portal Max Particles Per System 384 Range 128-1,000.
Optimize Floating Debris Effects true Exact one-time water-particle tuning.
Floating Debris Max Particles 256 Range 64-1,000.
Conservative Material State Fix false Opt-in cutoff/culling guard around the exact Amazing Nature material pass.
Aggressive Opaque Material Restore false Opt-in alpha keyword/blend/queue restore; implies the conservative guard.
Disable Shadows On Audited Heavy Prefabs false Optional visual tradeoff for five buildings and debris cast shadows.
07 - Compatibility Fixes Fix Balrond Constructions Null Hit Effects true Removes only enabled null hit-effect entries on five exact wall templates.
08 - Vanilla Streaming Smooth Distant Terrain Rebuild true Slices a verified 3x3 distant TerrainLod refresh; teleports stay vanilla.
Distant Terrain Regions Per Frame 1 Range 1-9.
Cache ZDO Sort Comparers true Caches three exact vanilla comparison delegates.
Static Physics Recheck Interval 1 Seconds; range 0-10, where 0 preserves vanilla cadence.
Time-Slice Terrain-Triggered Clutter Rebuilds true Uses Valheim's existing one-patch-per-frame clutter generator.

On first load, retained 0.7.x values are moved into the numbered sections and known removed 0.7/0.8 keys are purged. Canonical 0.7.7 defaults remain the Configuration Manager reset targets; a legacy value changes only the current value, and an already present numbered key always wins on later loads. The old inverse Enable MonsterClimbPatch value is deliberately not migrated, so an old config cannot silently enable the new gameplay-changing disable switch.

Safety and performance boundary

The optimizer adds no Unity Update, FixedUpdate, or LateUpdate method, coroutine, global object/ZDO scan, forced GC.Collect, Resources.UnloadUnusedAssets, texture/mip rewrite, or runtime LOD/GPU-copy experiment. The optional material hooks execute only inside Amazing Nature's existing startup pass and allocate no optimizer-owned per-material object. Exact IL or prefab signatures fail open. Distant-terrain smoothing checks for competing Harmony owners both at startup and once again on the first TerrainLod.OnEnable, covering plugins that load later without adding a recurring scan.

The Amazing Nature asset bundle remains the dominant unresolved cost: large textures, meshes, MeshColliders, material counts, particles, and first-render shader work cannot be honestly fixed by a small runtime patch. Those changes belong in a rebuilt source asset bundle with authored LODs, compressed/streamed textures, corrected colliders, and effect budgets.

Swamp generation settings should match on the host and clients. No optimizer option deletes general world ZDOs or rewrites save files.

CHANGELOG

Changelog

0.7.7

  • Removed Suppress Duplicate Material Passes completely after runtime testing showed that it could make transparent vegetation and other authored transparent materials render as opaque.
  • Every Amazing Nature material pass now runs. Both the legacy Balrond Shaders key and the short-lived numbered 06 - Rendering key are purged during config migration.
  • Kept the remaining exact-version 1.3.8 fixes and defaults unchanged; no new tick, global scan, save migration, world mutation, texture rewrite, or runtime LOD/GPU experiment was added.

0.7.6

  • Rebuilt the release specifically for Balrond Amazing Nature 1.3.8 with an exact Thunderstore dependency, versioned BepInEx dependency, runtime metadata equality gate, and one compact startup capability summary.
  • Removed the obsolete lava, Plains heat, biome-width, status/stamina, Deep North, station/converter, Dverger, iced-tree, stalagmite, recipe/tutorial/tentacle, old world-field, texture, mip, and heavy-tree LOD branches. The unreleased 0.8 runtime GPU experiment is not part of this release.
  • Retargeted the optional Monster Climbing disable to Character_CustomFixedUpdate_Patch.Postfix(Character,float) and Character_OnDestroy_Patch.Prefix(Character), with an exact Dictionary<Character,ClimbState> check and ordered States cleanup. The new switch defaults off, leaving Amazing Nature's improved climbing enabled.
  • Restored the bounded 0.7.5 material-state guard after confirming that Amazing Nature 1.3.8 still force-enables alpha cutout for nearly every tracked _MainTex material. Conservative cutoff/culling protection and full opaque keyword/blend/queue restoration are grouped under Rendering, migrate their old values, and both remain off by default.
  • Removed Suppress Duplicate Material Passes completely after it caused incorrect opaque vegetation in runtime testing. Every Amazing Nature material pass now runs, and both legacy and short-lived numbered config keys are purged.
  • Kept the verified StableHash, Serving Tray, geyser, swamp, clutter, optional heavy-shadow, Balrond Constructions null-effect, and vanilla streaming fixes.
  • Added exact one-time tuning for portal_NatureSmall_bal, portal_StoneSmall_bal, and FloatingDebris_bal: Automatic particle culling, conservative caps, and portal-light shadow removal without touching network, teleport, physics, loot, audio, or save behavior.
  • Reorganized all 29 settings into eight numbered sections, migrated retained values (including the two retained old Balrond Shaders keys), purged known obsolete entries, and deliberately did not invert the old MonsterClimb setting.
  • Added session-safe cleanup for the current Amazing Nature caches and optimizer-owned streaming/clutter state. No new tick, scheduler, global scan, forced GC, asset unload, or broad runtime rendering rewrite was introduced.
  • Hardened the final release audit: legacy values now migrate without replacing canonical defaults or overwriting an existing 0.7.6 key, and the migration is idempotent across repeated loads.
  • Moved the Serving Tray automatic-registration guard to TryPrepareAsServingTrayPiece(..., requireConsumable) so it blocks before prefab mutation; removed the ineffective late EnsureInPieceTable fallback, manual-entry reflection cache, and duplicate teardown cleanup.
  • Made vegetation and clutter filters exact typed 1.3.8 paths, expanded the startup contract to every retained lifecycle method and ClutterBuilder.clutterObjects, and required an upstream climb patch to be present before reporting an exact unpatch as successful.
  • Added a one-shot TerrainLod.OnEnable foreign-owner check so a later-loaded competing streamer also fails open to vanilla without a per-frame compatibility scan.

0.7.5

  • Added a restart-time compatibility fix for five actually registered Balrond Constructions core-wood wall prefabs with enabled missing WearNTear.m_hitEffect references. The fix runs once after prefab registration, preserves valid effects such as vfx_SawDust, and prevents vanilla EffectList.Create from attempting Instantiate(null) during structure hits.
  • The repair uses five exact prefab lookups and changes only their runtime hit-effect arrays. It adds no damage hook, frame callback, sector/object/ZDO scan, exception suppression, or save rewrite.

0.7.4

  • Re-audited the currently installed Amazing Nature binary and current Valheim assembly_valheim.dll, then traced the live walking/sector paths through TerrainLod, Heightmap, ClutterSystem, SlowUpdater/StaticPhysics, ZNetScene, ZDOMan, and BalrondConverter.
  • Added all-biome Amazing Nature clutter controls. The default 50% density scales only its 23 definitions, while six non-instanced entries are disabled before registration so crossing each 8 m clutter patch creates far fewer placement attempts and separate GameObjects.
  • Fixed the 0.7.3 Swamp clutter filter: Amazing Nature prefixes Clutter.m_name with balrond_; 0.7.4 resolves the actual prefab name, so the five configured entries are now correctly matched.
  • Time-sliced terrain-triggered grass resets by removing only ResetGrass's forced-all flag. Reset patches remain valid and rebuild through Valheim's existing one-patch-per-frame generator; ClearAll and graphics-quality rebuilds remain vanilla.
  • Added fail-open 3x3 distant-terrain smoothing. Nine already-ready HMBuildData results are consumed at the configured rendered-frame budget instead of all nine Heightmaps regenerating in one frame. Teleports remain immediate, captured data is restored on any partial failure, and competing foreign TerrainLod patches disable the feature.
  • Corrected vanilla StaticPhysics cadence after its original 20-second delay. Eligible ground/solid-height checks now re-arm at the configured interval instead of repeating every SlowUpdater sweep; active falling remains unchanged.
  • Cached the exact comparison delegates used by ZNetScene.CreateObjectsSorted, ZDOMan.ServerSortSendZDOS, and ClientSortSendZDOS, removing three recurring delegate allocations without changing sort or network semantics.
  • Changed the exact IcedTree_bal GlobalWind component from a 0.01-second Invoke to Valheim's staggered two-second cadence.
  • Disabled the rendered-frame MaterialVariationWorld Location search on the outdoor stalagmite_ice_bal template; its default material, geometry, collision, destructibility, and drops remain.
  • Hardened BalrondConverter sector reloads. A long delta calls the converter's own IsActive predicate once and skips up to 3,600 zero-progress iterations for empty or currently unstartable stations, while active/startable work keeps offline progress. Existing one-second callbacks are distributed by a stable ZDO-ID phase.
  • Phase-shifted wet/cold, mist, and sitting-heal full passes so their four-per-second checks no longer land in the same physics step.
  • Added no optimizer-owned Update, FixedUpdate, LateUpdate, coroutine, global scheduler, sector/object/ZDO scan, forced GC, or asset unload. Synchronous new-zone vegetation/location/dungeon generation remains deliberately untouched to preserve deterministic world and multiplayer behavior.
  • Extended the metadata verifier with every new private signature and exact IL pattern, added steady-state allocation/reflection checks, rebuilt with zero warnings, and independently decompiled/reviewed the final DLL.

0.7.3

  • Replaced the temporary BNO mark with a new 256x256 hand-painted Nordic nature/optimization icon designed for Thunderstore and Gale thumbnail readability.
  • Reduced the Thunderstore README to one technical audit table plus the optional-controls table. Both use a three-column Gale-compatible layout, with separate Gameplay and World/save blocks inside the visible result column.
  • Traced every optimizer target upward into current Valheim lifecycle roots and every replacement downward into Amazing Nature delegates. The audit now distinguishes method names from actual Update, FixedUpdate, AI, scene, world-setup, and ZDO-streaming cadence.
  • Replaced Amazing Nature's Deep North EnvMan.GetBiome and EnvMan.UpdateEnvironment reflection prefixes. The stable path previously performed five reflection operations and at least three boxed value allocations per processed fixed frame; the replacement uses cached open delegates and direct Harmony field references with no steady-state managed allocation.
  • Fixed Amazing Nature's stale m_currentBiome assignment while an environment override is active by storing the biome already computed by EnvMan.FixedUpdate.
  • Disabled the mis-targeted Patch_Player_StaminaRegenSmoothCurve by default. Its two callbacks ran for every Character but wrapped Character.CustomFixedUpdate, not the real Player.UpdateStats stamina regeneration path.
  • Replaced the Dverger betrayal AI postfix with allocation-free prefab-name normalization while preserving the dynamic Amazing Nature name whitelist and mark predicate.
  • Added an O(1) fermenter template guard on ConversionChanges.editFermenter. Streamed fermenter clones no longer repeat two conversion-list scans and tutorial work when their serialized entries match; incompatible instances run the original method.
  • Synchronized the throttled food-state pass with vanilla m_foodUpdateTimer instead of an independent timer, including forced food updates.
  • Removed the retained SE_SitHeal status when the player is no longer sitting or is already at full health.
  • Released Amazing Nature-owned runtime Recipe ScriptableObjects before ObjectDB rebuild/shutdown instead of only dropping their managed list references.
  • Removed the remaining MonsterClimbCleanupPatch from Character.OnDestroy when monster climbing is disabled and cleared the disabled lava/heat/climb collections at startup.
  • Moved world cleanup from cancellable Game.Logout to terminal Game.Shutdown(bool).
  • Fixed tentacle source resolution during Amazing Nature's pre-vanilla ZNetScene.Awake prefix. The resolver performs one startup-only exact-name pass over the serialized prefab list and never runs from chunk/ZDO streaming.
  • Added verification after every foreign Harmony unpatch. Replacement hooks roll back if the corresponding Amazing Nature hook cannot be removed, preventing double execution on future incompatible builds.
  • Removed the dormant RecipeFactory.buildRecipeStationTutorialTag patch; the method has no caller in the audited Amazing Nature build and lifecycle deduplication already protects the actual tutorial list.
  • Clarified that all Configuration Manager changes require a restart and that the two local-player status dispatchers still receive physics-step callbacks even though their full work is throttled.

0.7.2

  • Removed the optimizer's global Character.OnDestroy postfix. On sector unload it repeatedly called AccessTools.TypeByName, which enumerates types from every loaded assembly and could turn a batch of despawning characters into a long frame plus GC pressure.
  • Removed the per-frame MessageHud.UpdateBiomeFound postfix. The biome-message prefab is now widened once from MessageHud.Awake.
  • Replaced per-material shader state objects, dictionaries, arrays and lowercase/concatenated strings with fixed value-type state and allocation-free ordinal searches.
  • Retired the old broad alpha restore default. Conservative and aggressive material-state fixes use new keys and both default off; aggressive keyword/blend/queue restoration is explicitly opt-in.
  • Added alpha-blend, premultiply, transparent queue and non-opaque mode recognition so transparent Piece materials are not misclassified as opaque.
  • Replaced the full recursive scan of every ZNetScene prefab with exact-name lookups. Disabled poison geysers are collapsed from 53/66-object hierarchies to lightweight Transform + ZNetView roots, reducing the cost of loading old geyser ZDOs.
  • Removed the destructive full-ZDO scan/deletion feature entirely.
  • Filters pending Balrond clutter before its registration and no longer calls a second ClutterSystem.ClearAll, avoiding a redundant forced full clutter rebuild.
  • Reduced status replacement hooks from three to two and phase-shifted sitting-heal work from the wet/cold and mist pass.
  • Disabled Serving Tray integration by default. Auto-scan and the four heaviest food prefabs are blocked before prefab mutation when the feature is enabled with its safety options.
  • Resolves Amazing Nature types only inside the plugin assembly obtained from its BepInEx GUID and caches fields per type. AccessTools.TypeByName is no longer referenced anywhere, including startup/logout compatibility work.
  • Added an immutable startup settings snapshot, a restart warning for Configuration Manager changes, and General / Enable Optimizer for clean restart-based A/B tests.
  • Replacement hooks are now installed successfully before their original Amazing Nature hooks are removed. A future Harmony/signature incompatibility therefore leaves the original feature intact instead of silently disabling it.

0.7.1

  • Removed the exact Balrond Amazing Nature 1.3.7 runtime version gate. Any loaded version with the expected plugin GUID is now accepted.
  • Kept compatibility checks at individual-target level: missing, ambiguous, or Harmony-incompatible patch targets are skipped and logged without stopping the remaining targets in that feature group.
  • Removed the version-pinned Thunderstore package dependency because Thunderstore has no version-wildcard syntax. Amazing Nature must be installed separately; the DLL still declares a hard dependency by plugin GUID.

0.7.0

  • Re-audited and rebuilt every patch target against the installed Balrond Amazing Nature 1.3.7 DLL and current Valheim assemblies.
  • Split CustomLavaDamagePatch and the three PlainsMiniHeat hooks into independent settings; both remain disabled by default.
  • Replaced the broken Swampy* clutter match with the five actual 1.3.7 clutter prefabs and now clears only their Swamp biome bit.
  • Changed swamp world filtering to preserve registrations in other biomes. Visual vegetation and Guck resource vegetation now have separate settings; resources stay enabled by default.
  • Made poison-geyser disabling complete: Aoe, EffectArea, SpawnArea, TerrainModifier, lights, particles, audio, renderers and colliders are neutralized while network roots remain loadable.
  • Made existing-ZDO deletion opt-in, server-only, and protected by a second master safety switch. An old 0.6.6 true value cannot delete anything by itself.
  • Added a non-destructive geyser optimization mode with particle, light-shadow and spawn caps when geysers are kept enabled.
  • Added bounded food/environment/sitting-heal status passes and an exact non-allocating replacement for BalrondHashCompat.StableHash reflection.
  • Added a conservative shader snapshot/restore guard for StaticRock and non-vegetation Piece/Creature; authored _Cull is preserved independently from alpha-test intent. Duplicate material-pass suppression is available but defaults off so later shader retries are not lost.
  • Disabled Serving Tray automatic build-table registration by default and blocked new placement of the four audited extremely high-poly food displays. Prefabs are still prepared for old placed-ZDO compatibility; full feature removal is opt-in.
  • Fixed recipe and tutorial accumulation, tentacle prefab duplication, mutation of vanilla TentaRoot, and known character/world lifecycle collections.
  • Removed the old teleport polling and global runtime object scans.
  • Added exact metadata target verification and a post-build decompilation audit.

0.6.6

  • Updated the optimizer for Balrond Amazing Nature 1.3.7.
  • Disables Balrond custom lava/plains heat hooks, monster door sensors, and the monster climb/slope movement postfix by default.
  • Fixes Balrond biome discovery title width growth.
  • Disables Balrond poison geysers, poison geyser spawners, extra swamp clutter, and extra swamp world vegetation while keeping items, recipes, build pieces, cultivator entries, loot sources, and locations intact.
  • Removes SpawnArea, ParticleSystem, AudioSource, Light, and LightFlicker components from disabled poison geyser prefabs, preventing LightFlicker.Awake() null-reference spam on existing geyser ZDOs.
  • Deletes existing poison geyser world ZDOs when the poison geyser cleanup option is enabled.
  • Runs conservative cleanup after distant teleports and logout for disabled Balrond runtime components and stale lists.
  • Keeps Balrond status systems untouched.