You are viewing a potentially older version of this package. View all versions.
Ainzworth-BetterMapCleanup-0.7.3 icon

BetterMapCleanup

Companion cleanup and lifecycle mod for xtavim's BetterMap, with client event reporting, server relay and configuration sync.

Date uploaded 3 days ago
Version 0.7.3
Download link Ainzworth-BetterMapCleanup-0.7.3.zip
Downloads 155
Dependency string Ainzworth-BetterMapCleanup-0.7.3

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2350 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.2350
xtavim-BetterMap-1.1.0 icon
xtavim-BetterMap

Puts creatures, boats, carts and resources on your map. Pins what you find as you find it, keeps and clears your death markers, and names the traders. Everything can be turned on and off, biome by biome, and syncs with ServerSync.

Preferred version: 1.1.0

README

BetterMapCleanup 0.7.3

Companion for BetterMap 1.1.0. Removes disabled-category pins, maintains resource depletion/respawn state and merged counts, and relays lifecycle events between connected users.

Event sync

A client observes an actual resource change, applies its configured CrossOff/Remove behavior and reports the state to the server. The server distributes the state to registered BetterMapCleanup clients. Receiver application does not send the same event back. Server-side resource observation remains as an additional event source. Resource state snapshots/persistence remain available on reconnect.

The relay accepts only registered ready peers, known resource/portal prefabs and finite positions within 256 m of the reporter, with a burst limit. It relays client observations; these are not independent proof of a successful harvest. Server-synchronized settings determine resource actions on receivers.

Portal handling

BetterMap owns portal deletion. BetterMapCleanup no longer patches WearNTear.Destroy or runs its own orphan-portal deletion. The two previous portal-cleanup config options are retired and ignored if still present in an old config file.

The native BetterMap PortalPins.Destroyed result is observed and relayed client -> server -> connected Cleanup users. Receivers call that same native BetterMap function with a read-only description of the removed portal, even when its original ZDO is absent locally. No world object is spawned. Replay cannot produce a new report.

The server persists accepted portal removals per world and replays them when players reconnect or request bmc sync. Catch-up survives server restarts and is processed in batches. The server checks its portal registry for replacements within BetterMap's deletion radius before replay; receivers also protect locally known replacements. Pending incoming events wait for map readiness. Pin selection/removal follows BetterMap's own rules; Cleanup does not maintain a second portal remover.

Installation

Update BetterMapCleanup on the server and every participating client to 0.7.3. Protocol 5 intentionally does not exchange state with older Cleanup builds. Clients need BetterMap 1.1.0 or a compatible PortalPins.Destroyed API. A dedicated server can run Cleanup without BetterMap because it only relays data.

From the source repository, run:

.\build.ps1 -Install

Use -ValheimPath for a nonstandard install. The script installs locally; copy the resulting DLL to the dedicated server's BepInEx/plugins/BetterMapCleanup folder separately and restart it.

Configuration and diagnostics

Existing Resources settings still select CrossOff/Remove, the depletion threshold and respawn restoration. Smoke Puff uses Depleted Pin Action. bmc status shows protocol 5 and clientReports=enabled. bmc sync requests current resource states and recorded portal removals. bmc reconcile is an explicit local resource repair command. No automatic world scan was added.

Validation

See TESTING.md. Build and stand-in logic tests pass; live multi-client behavior still needs a game test.

Portal history starts with 0.7.0; removals never reported to the server cannot be reconstructed. Keep the server configuration directory (including world-specific .portals files) across updates. History does not expire automatically. Resource snapshots contain the latest known depletion/respawn state rather than replaying obsolete harvest events.

Native Soft Tissue support (0.7.3)

Soft Tissue and Giant Remains discovery/settings now belong entirely to BetterMap. BetterMapCleanup no longer injects or overrides these rules. Obsolete Pins/Soft Tissue and Pins/Keep Giant Remains entries are ignored; configure the native BetterMap options instead. Resource depletion actions and synchronization continue to use BetterMap's native rules. Update the companion on both clients and servers and restart to discard any rule overrides from the previous process.

CHANGELOG

0.7.3

  • Remove the obsolete Soft Tissue rule injection and the Giant Remains enable-setting override. BetterMap owns both discovery rules and their configuration.
  • Remove the companion Pins/Soft Tissue and Pins/Keep Giant Remains settings from config binding and server sync. Old config entries are ignored.
  • Keep normal resource depletion cleanup and synchronization for native BetterMap Soft Tissue pins.

0.7.2

  • Match historical prefab-derived and PlantEverything pin labels to exact rules, including Pickable Smoke Puff.
  • Resolve unambiguous named rules before shifted numeric categories during disabled-pin cleanup.
  • Preserve manually placed BetterMap pins marked by BetterMapSeneaLCompat 0.3.0.
  • Cache expected rule labels per settings snapshot.

0.7.1

  • Publish the completed offline recovery changes under a new release version because 0.7.0 is already registered.
  • Includes persisted portal catch-up, replacement protection and retry handling for sync requests and native replay.
  • Protocol 5; update server and participating clients to this build.

0.7.0

  • Retry unanswered sync requests and temporarily failed native portal replay.

  • Persist accepted portal removals per world and replay them on reconnect or bmc sync, including server restarts.

  • Reuse BetterMap native deletion and protect replacements using the server portal registry.

  • Apply catch-up in batches and wait for map readiness. Resource reconnect snapshots remain in use.

  • Protocol 5 requires matching server/client versions. History begins with this update.

0.6.0

  • Enable client resource reports and server relay (protocol 4), including host map updates and echo suppression.
  • Remove our WearNTear portal deletion and orphan-portal cleanup.
  • Relay BetterMap 1.1.0 native portal deletion to connected Cleanup users; replay through BetterMap, with no independent remover.
  • Resource snapshots remain persisted. Portal events are live-only, not replayed to offline users.
  • See TESTING.md for validation and limitations.

0.5.3 - Smoke Puff lifecycle

  • Track Pickable_SmokePuff via the actual Pickable.SetPicked state and initial Awake state.
  • Include its Forage rule in lifecycle matching, BetterMap observation and merged-label maintenance.
  • Route harvest/respawn through the existing resource-state and pin-action pipeline. Multiplayer clients with an active BMC server wait for its deltas; hosts/singleplayer and local fallback use the same state application.
  • Uses Resources / Depleted Pin Action (CrossOff by default). No periodic world scan added.
  • Update both server and clients. Run bmc reconcile locally for already harvested objects currently loaded, or reload their area after updating the server. Previously unloaded areas are learned when loaded.

Validation: warning-free net48 build against workspace copies of game/BepInEx assemblies. 13 production-hook checks passed with stand-in game/network/map APIs. Real game harvest, merged-pin counts, respawn and multiplayer delivery still require an in-game test.

Changelog

0.5.2

Testing status

  • Feature-complete for the current scope and released for broader gameplay testing.

  • Still needs wider validation of merge labels/counts (especially Tin), full Remove/CrossOff lifecycle behavior, deliberate PinRecord repair cases, depletion/respawn restoration, multi-client dedicated-server longevity, and reconnect/world-reload sync timing.

  • Added server-authoritative BetterMapCleanup config synchronization, modeled after BetterMap's ServerSync behavior.

  • Added [1 - ServerSync] Enable Server Config Sync (default true) and Lock Configuration (default true).

  • Joining BetterMapCleanup clients receive the server's synchronized cleanup/resource policy through a compact dedicated RPC snapshot.

  • Server values are applied in memory only; client config files are not rewritten and the previous local values are restored after disconnect.

  • With config locking enabled, client edits to synchronized settings are immediately reverted to the server value.

  • Runtime server-side setting changes are broadcast to connected BetterMapCleanup clients.

  • Config synchronization is independent from resource-state synchronization, so policy can still be server-controlled when resource-state sync is disabled.

  • bmc status now reports config-sync state, protocol, peer count and lock state.

  • Local-only diagnostics/maintenance settings remain unsynchronized.

0.5.1

  • Fixed build failure in BetterMapCleanupEventSync.cs by importing the BepInEx namespace required for PluginInfo.
  • Removed the obsolete _nextResourceReconcileAt field left behind after the 0.5.0 event-driven rewrite, eliminating the compiler warning.
  • No runtime behavior changes from 0.5.0.

0.5.0

Event-driven/server-authoritative resource architecture

  • Removed automatic periodic resource reconciliation from normal gameplay.
  • BetterMapCleanup now observes BetterMap's own AutoPins.Place candidates and AutoPins.Sweep completion rather than launching a second client world scan.
  • Added server-authoritative resource mutation hooks for tracked Destructible, MineRock5 and MineRock resources.
  • Resource Sync protocol bumped to 3.
  • Clients no longer submit authoritative depletion reports; the server derives state from the world itself.
  • Remote clients with confirmed server support stop their old local damage/ZDO recheck coroutines and consume compact server deltas instead.
  • Same DLL continues to support BetterMap-free dedicated servers (BetterMap remains a soft dependency).
  • Persisted server state canonicalizes legacy fracture/source prefab names on load.
  • Respawn is event-driven: a previously depleted server record is revived only when the tracked object is actually observed active again.
  • Join snapshots are applied in bounded batches (8 records/frame).
  • Registry file writes are deferred while a snapshot is being applied and performed once when the queue drains, avoiding per-record file-I/O stutter.
  • Server snapshot records for disabled/unavailable BetterMap rules are discarded from the per-frame pending queue instead of being retried forever; bmc sync can request them again after a config change.
  • bmc reconcile remains as an explicit manual repair command only.
  • bmc status now reports automaticReconcile=disabled(event-driven), BetterMap observation state, protocol 3, clientReports=disabled, and whether local lifecycle is using server-deltas or local-fallback.

Architecture note

  • Reviewed OdinEye/OdinEyeClient's public server/client split as a design reference: server-authoritative information remains server-side, while client-only data/UI stays client-side. BetterMapCleanup keeps Valheim-native ZRoutedRpc rather than adopting OdinEye's REST/WebSocket transport.

0.4.8

  • Added runtime-mode detection and suspended periodic reconciliation in true singleplayer / solo-host cases.

0.4.7

  • Fixed 0.4.6 scope errors in the reconciliation label-update optimization.

0.4.6

  • Replaced periodic global Unity FindObjectsByType scans with an event-driven loaded-resource cache.

0.4.5

  • Added respawn recovery, console commands/status diagnostics and resource sync protocol 2.

0.4.4

  • Added assembly_utils.dll reference and Valheim 1.0.15 server-peer API compatibility.

0.4.3

  • Added resource member registry, loaded-zone reconciliation and optional server resource sync.

0.4.2

  • Added conservative PinRecord repair/resync.

0.4.1

  • Added conservative orphan portal cleanup.

0.4.0

  • Added same-resource merge labels/counting and lifecycle count decrement support.