Jubaroo-SmarterHoe icon

SmarterHoe

Comprehensive hoe overhaul: Multi-step Undo/Redo, Altitude Lock, Instant Plateau, Spline Road Carver, Soften/Restore, Clear Debris, ServerSync & Dedicated Server support, 9 languages, and survival balance.

By Jubaroo

CHANGELOG

Changelog

1.1.4

Fixed

  • Soften Terrain Full Overhaul & Spatial Neighborhood Filter: Resolved an issue where using the "Soften Terrain" tool on raised ground or steep terrain flattened/lowered the ground toward the cursor altitude while leaving sharp, jagged stepped edges intact.
  • True Multi-Pass Spatial Smoothing Engine: SmarterHoe now implements an authentic heightmap relaxation algorithm (Laplacian / Gaussian spatial diffusion):
    • Iterates neighboring vertices in the grid (cardinals at weight 1.0, diagonals at weight 0.7071) across all touching chunk boundaries.
    • Relaxes sharp spikes, stepped cliff corners, creases, and jagged terraformed edges towards their local neighboring surface average.
    • Uniform elevated ground (such as raised plateaus) and level ground have equal neighbor heights and are never lowered or flattened.
    • Applies a smooth radial cosine falloff from brush center to edge, blending smoothly into untouched surrounding terrain.
    • Saves the resulting heights directly into comp.m_levelDelta (clearing comp.m_smoothDelta), allowing softening and rounding of cliffs of any height (even 10m-50m with beyond game limit enabled).
  • New Configuration Options:
    • SoftenStrength: Smoothing intensity per click or sweep pass (default: 0.5, range 0.05 to 1.0).
    • SoftenPasses: Number of filter iterations per click/sweep (default: 2, range 1 to 5).

1.1.3

Fixed

  • Dedicated Server Height Limit Protection & Terrain Desync Fix: Resolved a critical issue where players connecting with SmarterHoe as a client to a dedicated server without the mod installed experienced massive terrain corruption (ground stretching into 100m spires or plunging into bottomless abysses, causing basement carpets and structures to collapse).
  • Client-Side Dedicated Server Auto-Clamp: SmarterHoe now automatically checks whether the connected remote server is running SmarterHoe via ServerSync. If the server does not have the mod installed, AllowBeyondGameLimit is strictly disabled on the client, enforcing vanilla Valheim's ±8m limit to guarantee 100% sync and zero physics anomalies.
  • Safe Out-of-the-Box Defaults: Changed AllowBeyondGameLimit default from true to false in config. Extreme height modifications (>8m) are now opt-in for dedicated server owners and singleplayer worlds.
  • Native TerrainComp Passthrough: RaiseTerrain, LevelTerrain, and SmoothTerrain now immediately yield to vanilla Valheim methods when using circular brushes within standard game limits, ensuring full performance and zero behavior deviations.

1.1.2

Fixed

  • Build Hammer Object Rotation & Menu Isolation: Fixed an issue where structures placed with the build hammer that include terrain modifiers or terrain operations (such as campsite tents from Odin's Campsite or class altars from Almanac Classes) were erroneously detected as hoe terrain tools. This prevented rotating those structures and caused the SmarterHoe HUD menu to appear while using the hammer.
  • SmarterHoe now strictly verifies that the player is actively holding a hoe before rendering any HUD elements, intercepting mouse scroll wheel or adjustment keys, or modifying placement rotation.
  • Removed unwanted prefab rotation mutation so build hammer pieces permanently retain their proper rotational controls.

1.1.1

Fixed

  • ComfyGizmo + PerfectPlacement Compatibility: Resolved a conflict where loading both ComfyGizmo and PerfectPlacement alongside SmarterHoe would cause Harmony to fail patching Player.UpdatePlacementGhost, disabling the mod entirely. SmarterHoe now uses a resilient transpiler that handles both the vanilla and PerfectPlacement-modified IL sequences correctly.
  • Added soft BepInDependency declarations for ComfyGizmo and PerfectPlacement so load order is handled gracefully.
  • Hoe tools now correctly suppress ComfyGizmo's 3D gizmo axis rings during terrain operations.
  • Terrain tool rotations are clamped to the horizontal plane when PerfectPlacement is active.

1.1.0

Added

  • Dedicated Server Support & ServerSync Integration (ModRequired = false):

    • Integrated official ServerSync system with server-authoritative configuration enforcement.
    • Server owners can install SmarterHoe on dedicated servers and enforce balanced settings across all connected players:
      • Resource Cost Mode Enforcement: Server owners can enforce CostMode = BalancedSurvival to prevent clients from toggling freebuild creative mode ([B] key is locked on clients with on-screen notice).
      • Synced Balance & Limits: Stone costs (StonePerCubicMeter, StonePerPavedSquare), stamina and durability costs, station requirements (RequireCraftingStation), debris requirements (RequireToolsForDebris), reach distance (HoeReach), maximum brush radius (MaxBrushRadius), and maximum terrain elevation deltas (MaxTerrainDelta, AllowBeyondGameLimit).
    • Client-Optional & Vanilla Server Compatibility (ModRequired = false):
      • SmarterHoe is completely optional on both client and server!
      • Players with SmarterHoe can connect to vanilla or non-modded servers without being kicked, disconnected, or declined. Local client settings apply seamlessly.
      • Vanilla players without SmarterHoe can connect to dedicated servers running SmarterHoe without being rejected.
    • In-Game Lock Enforcement & HUD Indicators:
      • Non-admin players connecting to a locked dedicated server cannot toggle cost mode using [B] (displays HUD notice: Cost mode is locked by the server).
      • Top HUD panel clearly displays <color=#FF6666>[Locked by Server]</color> when server settings are enforced.
      • Server admins listed in adminlist.txt are automatically exempt (lockexempt = true) and can modify settings in real-time with instant synchronization to all connected clients.
    • Headless Dedicated Server Optimizations:
      • Visualizers, line renderers, crosshairs, and icon texture loaders cleanly bypass headless dedicated server environments (GraphicsDeviceType.Null).
  • Multi-Step Undo & Redo System ([Alt+Z] or [Ctrl+Z], [Alt+Y] or [Ctrl+Y]):

    • Deep chunk-level undo/redo support across all terrain actions: Leveling, Instant Plateau, Soften, Restore, Smooth Ramp auto-carving, Vanilla Raise Ground, Mud Road, Paved Stone Road, and Cultivate.
    • Continuous sweep grouping: holding left-click to drag-level or pave groups the entire sweep into a single atomic undo entry rather than cluttering history.
    • Multi-heightmap boundary handling: ramps and large brushes touching multiple terrain chunks snapshot and restore across all affected chunks cleanly.
    • Waypoint step-back integration: pressing the Undo key when ramp waypoints are active automatically steps back the most recent waypoint first before undoing terrain changes.
  • Extended Hoe Reach (20m default, configurable 5m–50m):

    • Dramatically improves terraforming ergonomics by extending hoe placement reach while the tool is equipped. Automatically restores vanilla reach upon unequipping or character death.
  • Dedicated Keyboard Rotation Hotkeys & Configurable Step Size:

    • Rotate the square brush smoothly using dedicated keyboard hotkeys or mouse scroll wheel:
      • RotateSquareLeftKey (default: LeftArrow): Rotates square counter-clockwise.
      • RotateSquareRightKey (default: RightArrow): Rotates square clockwise.
      • ResetSquareRotationKey (default: Home): Snaps square rotation back to 0° (North).
    • SquareRotationMode: Choose between ScrollWheelAndButtons (default), ButtonsOnly (keyboard only), or ScrollWheelOnly.
    • SquareRotationDegrees: Configure degrees to rotate per click/step (default: 22.5°, configurable from 5.0° to 90.0°).
  • Expanded Multi-Language Localization (9 Languages + Auto-Detection):

    • Built-in localization covering the top 9 languages played in Valheim: English, German, French, Spanish, Russian, Simplified Chinese, Portuguese (Brazilian), Polish, and Swedish.
    • Auto-Detection (Language = "Auto"): Automatically detects the active game language from Valheim's language settings with zero manual configuration needed.
    • Native Tool & Menu Translation: Patched Valheim's native Localization.Localize engine to dynamically localize custom tool names, descriptions, cart slope friendliness ratings (Cart Friendly (✓), Steep for Carts (!), Too Steep for Carts (✗)), brush shapes, cost modes, and HUD notifications.
  • Hold-to-Repeat Altitude Fine-Tuning with Initial Delay:

    • Holding down PageUp or PageDown now smoothly and continuously raises or lowers the locked altitude without requiring dozens of individual button presses.
    • Features an initial delay (AltitudeHoldDelay, default: 0.35s) before continuous movement begins to prevent accidental overshooting on single taps.
    • Smooth rapid elevation adjustment (AltitudeRepeatRate, default: 0.05s) with real-time HUD notification updates.
    • Hold Shift while tapping or holding PageUp/PageDown for a 5x elevation speed multiplier.
  • Camera-Zoom Suppression While Adjusting:

    • Eliminates jarring camera zoom in/out while adjusting brush radius or raise height with the mouse wheel. Configurable mode: WhileAdjusting (suppresses only during active adjustment), AlwaysWithHoe, or Disabled.
  • Bypass Valheim's 8m Terrain Height Limit (AllowBeyondGameLimit = true):

    • Removes the engine's hardcoded ±8m ceiling and floor clamps in TerrainComp.ApplyToHeightmap, LevelTerrain, RaiseTerrain, and custom SmarterHoe tools. Allows raising towering earthen bastions or excavating deep moats/canals up to a configurable limit (default: 50m).
  • Adjustable Raise Height & Q / E Mode Switch:

    • Press [E] to select Height adjustment mode, or [Q] to select Area adjustment mode.
    • Mouse wheel dynamically adjusts raise delta (0.05m to 8.0m per click) when Height mode is selected or when holding Alt+Shift+Scroll.
    • Vanilla raise ground now scales cleanly with the selected raise height and radius, with proportional stone consumption in Survival mode.
  • 3D Translucent Raise Cylinder Preview:

    • Live 3D volumetric cylinder preview showing the exact raise height and radius at the crosshair hit point, color-coded by reach (customizable valid and invalid colors and opacities).
  • Dedicated Console Commands:

    • resetterrain [radius]: Reverts terrain modifications within a specified radius back to natural world-gen state (undoable!).
    • remove_forestry [radius]: Clears trees, logs, stumps, and vegetation within the radius.
    • cleardebris [radius]: Clears all rocks, boulders, vegetation, and obstacles within the radius.
    • smarterhoe_undo & smarterhoe_redo: Terminal commands to step backward and forward through history.
  • Memory Safety & Clean Session Transitions:

    • History automatically clears on world exit (Game.OnDestroy) to ensure zero memory leaks across worlds and server hops.
  • HUD Undo / Redo Counter & Real-Time Feedback:

    • All 6 hoe mode HUD panels now display current undo/redo step availability in real time: [Alt+Z] Undo (N) | [Alt+Y] Redo (M).
    • Real-time rotation angle and active control bindings displayed on square brush HUD, accompanied by instant on-screen toast notification banners.
    • Active adjustment badge beside the crosshair dynamically indicates current Area / Height values when modified.
  • True Freebuild Creative Mode (Zero Resources, Zero Stations, Zero Durability, Zero Stamina):

    • Fixed an issue where Freebuild mode ([B]) still required stone in inventory, consumed stone on click, required a nearby Workbench or Stonecutter, and drained stamina and tool durability.
    • Patched Player.HaveRequirements, Player.ConsumeResources, Character.HaveStamina, Player.GetBuildStamina, and Player.GetPlaceDurability so all terrain operations in Freebuild mode require zero materials, consume zero resources, bypass crafting stations completely, and never drain stamina or tool durability.
    • The HUD requirement bar automatically hides stone requirements in Freebuild mode for a clean creative experience.
  • Dynamic Raise Ground & Paved Road Resource Scaling (Height & Area):

    • Fixed vanilla Raise Ground only requiring 2 stone regardless of how high or large the terrain being raised was.
    • Stone cost in BalancedSurvival mode now dynamically scales with physical volume: proportional to both brush Area (radius and Circle vs Square geometry) and Height (SelectedRaiseHeight relative to vanilla's 0.5m baseline).
    • Dynamic HUD requirement sync: the bottom HUD requirement bar immediately displays the exact calculated stone requirement (e.g. 24 Stone) and flashes red if inventory is insufficient.
    • Placement ghost and 3D Translucent Raise Cylinder automatically turn red when stone is insufficient.
    • Real-time stone cost display in the top-middle HUD panel and crosshair adjustment badge as radius, height, or shape is modified.
    • Server-authoritative balance: scales with StonePerCubicMeter and StonePerPavedSquare configs synced from dedicated servers.

Fixed & Improved

  • ComfyGizmo & PerfectPlacement Third-Party Mod Interoperability:
    • Fixed a critical incompatibility where loading both ComfyGizmo and PerfectPlacement alongside SmarterHoe caused a Harmony transpiler collision on Player.UpdatePlacementGhost, resulting in SmarterHoe's patch chain failing and disabling the mod.
    • Implemented ModCompatibilityManager with a universal transpiler interceptor that seamlessly chains ComfyGizmo's rotation delegate after PerfectPlacement's rotation method without throwing IL matching exceptions.
    • Added soft dependency registration ([BepInDependency]) and post-patch repair hooks to restore broken transpiler chains automatically on startup.
    • Registered all custom terrain tool prefabs (SmarterHoe_*) into ComfyGizmo's IgnoredPrefabNames and suppressed 3D rotation gizmos when holding hoe tools, preventing unwanted pitch and roll on 2D terrain brushes.
    • Added an automatic fallback in Player.UpdatePlacement ensuring placement ghost updates, altitude lock, and square visualizers remain 100% active even if third-party mods interfere with UpdatePlacementGhost.
    • Added resilient per-class try-catch blocks around Harmony patch registration to prevent any single third-party hook failure from halting mod initialization.

1.0.1

Fixed & Improved

  • Store Icon Transparency: Replaced icon with true 32-bit ARGB alpha transparency, fixing the gray checkerboard background on dark sites like Hexium and Thunderstore.
  • Hotkey-Only Altitude Lock: Eliminated unwanted auto-locking on tool selection, hover, or clicks. Altitude locking only engages when explicitly pressing [L] or Middle-Click piece snapping. Automatically turns off when unequipping the hoe.
  • Recipe Unlocking Safeguards: Added internal prefab names to known recipes list to guarantee all 6 custom hoe tools unlock properly across game restarts.
  • Zero-Allocation Performance: Added spatial caching to boundary visualizers and zero-allocation capsule queries for debris clearing.

1.0.0

Added

  • Altitude Lock ([L] or Middle-Click) — laser-flat terrain leveling locked to a fixed elevation. Activates strictly upon hotkey use (never auto-locks). Middle-click any building piece to snap the lock to its floor height.
  • Instant Plateau — dedicated hoe build-menu tool that razor-flattens the entire brush area in a single click.
  • Smooth Ramp Auto-Carver ([K] + [H]) — place waypoints and auto-carve smooth graded roads using Catmull-Rom spline interpolation. Supports curved switchbacks and multi-waypoint paths.
  • Dynamic Slope Coloring — ramp guide spine changes color in real time by slope angle: green ≤20° (cart-friendly), yellow 20–25° (steep), red >25° (too steep for carts).
  • Soften Terrain — gently blend rough terrain without hard edges.
  • Restore Terrain — reset terrain within the brush to original world-gen state.
  • Clear Debris — instantly remove trees, logs, stumps, rocks, and ore deposits within the brush radius.
  • Circle / Square Brush Toggle ([G]) — switch between circular and square brush geometry; square brush rotates with player direction.
  • Adjustable Brush Radius — Alt + Scroll or [Alt] + [ / ] resizes 0.5m–15m. Vanilla paving pieces scale to match.
  • Balanced Survival Mode — stone consumption, stamina drain, tool durability wear, crafting station proximity checks, and tool requirements for debris clearing. Press [B] to toggle between Balanced and Freebuild.