ValheimRAFT Rewben
Rewben ValheimRAFT fork: native portal synchronization repairs and RaftRebalance behavior.ValheimRAFT Rewben
ValheimRAFT with native ship-portal synchronization fixes and integrated RaftRebalance behavior. Based on upstream ValheimRAFT 5.1.1.
Thunderstore package and runtime fork: 5.1.108. Every player can audit and repair ship portals, with server-enforced cooldowns and one cleanup job at a time. The server also automatically cleans up duplicate ship portals every ten minutes, without an admin online. Cleanup runs in small networked batches. Manual audits and repairs remain available. Update both the server and every client to 5.1.108 before connecting.
Installation
- Close Valheim and back up your profile and world before replacing mods.
- Remove upstream ValheimRAFT and the separate RaftRebalance plugin. When moving from a local ZIP installation to Thunderstore, remove that local fork copy too.
- Install rewbensandwich-ValheimRAFT_Rewben through Gale or another compatible
mod manager. Keep Jotunn installed. Manual installations place the contents of
this ZIP's
pluginsdirectory in a dedicated BepInEx plugins subdirectory. - All players and the server must use the same runtime fork version. Keep the
existing RAFT configuration and legacy
vhrf.RaftRebalance.cfgfor migration.
The first fork startup migrates settings once, preserving unrelated settings.
Rebalance controls are under [Rebalance] and [Rebalance Recipes] in RAFT's
configuration. [Rebalance Migration] Schema = 1 records completion. Remove
RaftRebalance's DLL; keeping its old configuration file is safe after migration.
Changes
- Ship portals keep their network IDs while their position and rotation update. Registry membership and tracking are deduplicated; duplicate live instances of the same record are guarded. TargetPortal-managed portals bypass vanilla pairing.
- Native rebalance policy caps hull clearance at 1.5 meters by default, disables flight/ballast under the policy, restricts administrative commands, and allows ordinary creative editing with at most 5 meters of lift.
- Rams target creatures. Cannon harvesting restrictions preserve damage to creatures, spawners and player buildings. Hauling uses 10 stamina per meter by default and stops at exhaustion.
- Supplied recipe overrides and
vhrf_paid_v1refund markers are supported.
Automatic portal maintenance
In zolantris.ValheimRAFT.cfg on the server:
[Portal Maintenance]
CleanupIntervalMinutes = 10
The default is ten minutes; use any whole number from 1 to 1440, or 0 to disable.
This is a synchronized admin-only setting. A new world session or changed interval
waits two minutes before its first pass (one minute for a one-minute interval).
Later passes use the configured interval. The timer runs on the server's main
thread independently of world saves and includes unloaded ships. No player or
admin needs to be connected. The setting takes effect when the config is loaded
or changed through the admin configuration UI; restart after editing a file offline.
Automatic cleanup uses the same saved-record matching as manual --dedupe:
same ship, portal prefab, coordinate frame and ship-relative position within 1 mm.
One portal survives each group, preferring a named portal; missing or invalid
local coordinates are skipped. Ordinary land portals and distinct ship portals
are preserved. As with manual dedupe, intentionally colocated portals count as
duplicates even if their tags differ. Disable automation if you need those stacks.
Back up the world before installing: automatic saved-record deletion is enabled
by default and cannot be undone through a console command.
Each deletion batch revalidates both selected records and their keepers. Cleanup yields between batches, waits for network deletion acknowledgements, and cannot overlap a manual cleanup. Disabling the setting stops further automatic batches; already queued deletions can finish. Failed or interrupted passes retry with a fresh selection at the next interval. Cleanup also repairs registry membership and extra live instances, then refreshes connected clients and TargetPortal.
The exact automatic keep/remove mapping and result are saved before deletion in
BepInEx/config/PortalAudits/automatic-latest.txt; the preceding deletion report
is retained as automatic-previous.txt. Clean passes create no report files.
Server logs show scan counts and cleanup completion/failure. No resources are
refunded. Manual audit files are retained separately.
Portal auditing and manual repair
F5 console commands available to every connected player (no admin or devcommands required):
vehicle portals audit [ship-id]
vehicle portals repair <audit-id>
vehicle portals repair <audit-id> --dedupe --confirm
vehicle portals repair <audit-id> --remove <record-id>,<record-id> --confirm
An audit prints its total and at most ten saved portal records. The final line
repeats AUDIT ID: A1B2C3 with the total portal count. IDs are six characters,
accept uppercase or lowercase, and expire after five minutes. They belong to the
requesting player's current connection; reconnecting requires a new audit. A new
audit replaces that player's previous active token. Complete
reports are saved on the server under BepInEx/config/PortalAudits/<id>.txt.
The client prints only a small loaded-instance counter, not another full report.
Periodic diagnostics also print counters without formatting all record details.
Reports include saved records, live instances, positions, ship IDs and registry
anomalies, plus duplicateGroups and duplicateRecords. The full file records
every saved ID, its unrounded local position, and the ID selected to survive.
Audit is read-only. To remove its detected extra saved records, run the printed
repair <id> --dedupe --confirm command. It matches the same ship, portal prefab,
coordinate frame and local 3D position within 1 mm. Missing/invalid local positions
are skipped. It keeps one named portal where available, then chooses a stable ID.
World-position rounding and ship-center coordinates are not used for selection.
Cleanup yields between batches of at most 32 and waits for Valheim to acknowledge
deletions. Keep the requesting player connected until CLEANUP <id> COMPLETE appears. A changed
record, moved keeper, disconnected requester or world change stops further work; run a
fresh audit before continuing. These connection requirements apply to manual
jobs; automatic maintenance runs without an admin session. Basic manual repair
without deletion flags still preserves saved records. Automatic maintenance can
invalidate an older audit by removing its duplicates; request a fresh audit then.
Repairs provide no resource refunds. TargetPortal's temporary pins are cleared
after repair; close and reopen the portal map to refresh it.
The server enforces a shared five-second cooldown between audit scans and a separate five-second cooldown between repair attempts. A player can audit and immediately run the printed repair command if no previous repair is cooling down. Repair attempts with a valid owned audit reserve the cooldown even if later validation fails. Saved-record cleanup holds a shared job lock until deletion acknowledgements and final refresh finish, then waits another five seconds before another repair. Automatic maintenance uses the same lock and repair cooldown.
Requests during an active cleanup return its ID/progress; cooldown replies give
the remaining wait. No request is queued or replayed later. Retry after completion
or the stated cooldown; a blocked request does not consume its audit token.
If cleanup changed its records, run a new audit. The server executes requests
serially on its main thread, so simultaneous players cannot start competing jobs.
The --remove form remains available to all players too: it selects specific
ship-portal records from their own audit, not only position duplicates, and still
requires --confirm. Automatic interval settings remain admin-only.
Status and source
Runtime 5.1.102 previously completed dedicated-server startup and configuration migration. Runtime 5.1.104 completed dedicated-server startup. Runtime 5.1.108 passes headless regression checks, including a 16,248-record confirmed cleanup, automatic scheduling, public audit/repair access, overlapping player/automatic requests, cooldowns, cancellation and report rotation. Built against local Valheim 1.0.21. Dedicated-server startup and multiplayer validation of 5.1.108 remain pending. Tests use inspected game contracts and do not simulate Unity networking or establish that all reported disconnects are resolved.
Source, maintenance, full snapshot rollback and upstream update instructions: Rewben/ValheimMods.
Licensing and attribution
ValheimRAFT/ValheimMods is by zolantris and contributors, retaining earlier
ValheimRAFT contributions by Sarcen and others. This fork retains GPL-3.0 licensing
and attribution. See LICENSE. RaftRebalance 1.2.0 (vhrf) contributed the balance
policy, recipes, migration keys and paid-cost compatibility requirements.
ServerSync v1.20 is bundled under its included license; only its unsigned PE debug
filename has been sanitized. See ServerSync.PROVENANCE.md.
The archive contains runtime mod assemblies, mod assets and public documentation. It does not include player saves, profile backups, server configs, logs, private deployment scripts, credentials, game reference assemblies or debug-symbol files.
