BalrondNatureOptimizer
Conservative compatibility and performance fixes built specifically for Balrond Amazing Nature 1.3.8.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.StableHashreflection. - 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 exactDictionary<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 Fixpreserves authored cutoff and culling state, and blocks the second broad force pass for non-vegetation Piece/Creature and exact StaticRock materials.Aggressive Opaque Material Restoreimplies 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.
