gmeat-RaftNpsBridge icon

RaftNpsBridge

Fixes ValheimRAFT 5.1.3 boats shaking, jumping or sinking after loading and portals, players thrown off the wheel and boats given to the wrong player, and stops NetworkPerformanceSystem moving boats away from the helmsman.

Last updated an hour ago
Total downloads 12
Total rating 0 
Categories Mods Tweaks Server-side Client-side Vehicles AI Generated
Dependency string gmeat-RaftNpsBridge-0.2.2
Dependants 0 other packages depend on this package

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2360 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.2360
zolantris-ValheimRAFT-5.1.3 icon
zolantris-ValheimRAFT

ValheimRAFT - supports valheim 1.0.0 Deep North. A vehicles mod for valheim. Build a ship, build a land vehicle. Explore valheim!

Preferred version: 5.1.3

README

RaftNpsBridge

Fixes for ValheimRAFT 5.1.3 boats, especially large ones on dedicated servers, and a bridge that stops NetworkPerformanceSystem from taking boats away from the player at the wheel. It patches both mods at runtime and does not replace either.

Not affiliated with ValheimRAFT by zolantris or NetworkPerformanceSystem by MidnightMods. Source and issues: https://github.com/jaannigul/RaftNpsBridge

What it fixes

  • Boats shaking for many seconds, jumping vertically or shooting off after you log in or arrive by portal.
  • Boats sinking into the ground and the player at the wheel being thrown off when they start steering.
  • The boat being handed to the wrong player when someone takes the wheel.
  • An error on dedicated servers whenever someone takes the wheel (ValheimRAFT issue #363).
  • An error when chests near a cannon load, which can leave the chest showing only part of its items.
  • NetworkPerformanceSystem moving the boat to whichever nearby player has the lowest ping while someone is steering.

The first two come from the hull ValheimRAFT stores with each boat. A hull part with more than 255 triangles cannot be saved, and a failed save keeps the previous one, so a boat that has grown keeps an old, smaller hull and loads it after portals and when someone takes the wheel.

Requirements

  • ValheimRAFT 5.1.3. Other versions may have changed the patched code: the log then says which fix is not applied.
  • BepInExPack Valheim.
  • NetworkPerformanceSystem is optional. The bridge only patches it where it is installed.

Install

Install it for every player and on the server. Any player's game can end up running a boat's physics, and the NetworkPerformanceSystem fix runs on the server.

With Thunderstore Mod Manager or r2modman: Settings → Import local mod → choose the zip. If you copied an earlier version into BepInEx/plugins/RaftNpsBridge by hand, delete that folder first so it is not loaded twice.

By hand: unpack the zip into BepInEx/plugins/RaftNpsBridge/.

Then start the game and look in BepInEx/LogOutput.log for Loading [RaftNpsBridge …] followed by one applied. line per fix. A NOT applied line means that fix's target changed in ValheimRAFT or NetworkPerformanceSystem; the other fixes still work.

To uninstall, remove it in the mod manager or delete the RaftNpsBridge folder.

Settings

The config file is BepInEx/config/local.RaftNpsBridge.cfg, created on first start. Every fix can be turned off on its own and defaults to on. Each machine reads its own copy; the server does not push it to players.

Setting What it does
VehicleOwnerUsesConnectionId Taking the wheel gives the vehicle, its pieces and its ram to the player's connection id. ValheimRAFT 5.1.3 uses the character id, which no connection matches, so the server hands the vehicle to whichever nearby player it checks first.
ServerSafeControlResponse On a dedicated server, runs the wheel handoff without the message code that throws there (ValheimRAFT issue #363).
WaitForPiecesAfterLoad Keeps a freshly loaded vehicle frozen until its pieces stop arriving (2 s quiet) and its hull has been built from all of them, at most 30 s, then recalculates its centre of mass. While it waits, the hull is built from the pieces instead of loading the one stored with the vehicle.
CenterOfMassAfterHullRebuild Recalculates the centre of mass after every hull rebuild instead of only every 30 s.
IgnoreChestCallbacksToRemovedAmmoTracker Skips chest callbacks that reach a removed ammo tracker. Without this they throw while the chest loads.
RefuseOutdatedStoredHull Builds a loading vehicle's hull from its pieces instead of loading the stored one, and afterwards refuses a stored hull that falls more than 1 m short of the hull built from the pieces, keeping the current one.
LeaveRaftVehiclesAlone (NetworkPerformanceSystem section) Makes NetworkPerformanceSystem treat ValheimRAFT vehicles and their pieces as player-controlled, so it leaves their ownership to ValheimRAFT. It only recognises vanilla ships otherwise.

What it logs

  • When a vehicle loads, how its stored hull compares with the hull built from its pieces (a warning when the stored one is out of date).
  • When it refuses or applies a stored hull.
  • When a loaded vehicle is released to physics, and its top speed in its first 5 s of physics (a warning above 3 m/s).

Known limits

  • Players without the bridge still load an out-of-date stored hull. The bridge refuses it but cannot remove it.
  • ValheimRAFT attaches loose items that touch a boat (so things on deck ride along). A boat resting on the shore can pick up branches and stones lying there; pick them up to remove them.

Building from source

Needs the .NET SDK and these DLLs, which are not in the repository:

  • ..\ValheimMods\libs: Valheim's valheim_Data\Managed DLLs, plus BepInEx.dll, 0Harmony.dll and Jotunn.dll.
  • deps\ValheimRAFT-5.1.3: ValheimVehicles.dll, Zolantris.Shared.dll, ZdoWatcher.dll, DynamicLocations.dll from the ValheimRAFT 5.1.3 release.
dotnet build -c Release

This builds bin/Release/RaftNpsBridge.dll and the Thunderstore package dist/RaftNpsBridge-<version>.zip. The version comes from <Version> in RaftNpsBridge.csproj; update CHANGELOG.md with it. NetworkPerformanceSystem is not referenced at build time: its method is looked up by name when the game starts.

License

GPL-3.0, like ValheimRAFT and NetworkPerformanceSystem, which it patches. See LICENSE.