Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
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.
| Date uploaded | 2 hours ago |
| Version | 0.2.2 |
| Download link | gmeat-RaftNpsBridge-0.2.2.zip |
| Downloads | 16 |
| Dependency string | gmeat-RaftNpsBridge-0.2.2 |
This mod requires the following mods to function
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.2360zolantris-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.3README
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'svalheim_Data\ManagedDLLs, plusBepInEx.dll,0Harmony.dllandJotunn.dll.deps\ValheimRAFT-5.1.3:ValheimVehicles.dll,Zolantris.Shared.dll,ZdoWatcher.dll,DynamicLocations.dllfrom 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.
CHANGELOG
Changelog
0.2.2
- A loading vehicle stays frozen until a hull has been built from all of its pieces, not only until the pieces stop arriving. The first hull is often built from part of them; the bridge requests a rebuild when the last hull predates the last piece.
- The top-speed log line starts counting when the vehicle is first simulated, not when the bridge releases it.
0.2.1
- A loading vehicle builds its hull from its pieces instead of loading the hull stored with it. ValheimRAFT treated the stored hull's revision number as a hull that already exists, so a game that did not own the vehicle yet (normal after a portal) started physics on the stored hull, which can be far out of date.
0.2.0
- New:
RefuseOutdatedStoredHull. ValheimRAFT cannot save a hull part with more than 255 triangles and keeps the previous hull stored when saving fails; it loads that hull when someone takes the wheel. The bridge refuses a stored hull that falls more than 1 m short of the hull built from the pieces. Fixes vehicles sinking into the ground and players being thrown off the wheel when they steer. - Logs how the stored hull compares with the vehicle, when a stored hull is refused or applied, when a vehicle is released after loading and its top speed in the following seconds.
0.1.0
- First version: owner fix when taking the wheel, dedicated-server fix for ValheimRAFT issue #363, waiting for pieces after load, centre of mass after hull rebuilds, removed ammo tracker callbacks, and the NetworkPerformanceSystem ownership patch.