Ainzworth-BetterMapCleanup icon

BetterMapCleanup

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

Last updated 2 days ago
Total downloads 368
Total rating 2 
Categories Mods Server-side Client-side Utility Deep North Update
Dependency string Ainzworth-BetterMapCleanup-0.7.3
Dependants 0 other packages depend on this package

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.