Confirm with your password

SailTrim

Manual sail trimming for Valheim 1.0: sheet in and out, real heel, gusts, hull speed, a trim HUD on the wheel. Vanilla by default, H at the helm to opt in. Cleats to tie up, buoys to mark a channel, and a gangway to walk ashore loaded.

· Website

Stars
6
Downloads
175
Version
1.11.1
Updated
Author
Max
Virus scan
✓ Scan successful
Runs on
Client (& Server)
Required by
2 mods

Description

SailTrim for Valheim

Manual sail trimming for Valheim 1.0, plus a bronze cleat to tie boats up at the dock. Everyone on the server installs the same SailTrim.dll; the sheet angle and the mooring are synced through the ship so other players see the yard swing and the boat stay put.

Built against Valheim 1.0.12 (Unity 6000.0.75f1) with BepInEx 5.4.x.

Install (every player)

  1. Install BepInEx for Valheim if you don't have it yet. The easiest way is the BepInExPack Valheim package from Thunderstore (r2modman / Thunderstore Mod Manager), or the manual zip from https://valheim.thunderstore.io/package/denikson/BepInExPack_Valheim/ extracted into the game folder (...\steamapps\common\Valheim). Launch the game once so BepInEx\config and BepInEx\plugins exist.
  2. Drop SailTrim.dll into Valheim\BepInEx\plugins\.
  3. Start the game. BepInEx\config\com.maxst.sailtrim.cfg is created on first launch. Edit it with the game closed (or use a config manager) to change keys and physics.

Server (recommended). Put the same SailTrim.dll in the dedicated server's BepInEx\plugins too (or just have it installed if a player hosts). Ship physics always runs on a client, so the server copy does not sail anything; it does two useful things, both configurable in the server's BepInEx\config\com.maxst.sailtrim.cfg under 0. Server:

Server setting Default Meaning
Enforcement Warn Off: anyone may join. Warn: players without a matching SailTrim can join but get an on-screen warning (and the server logs it). Require: they are refused with an "incompatible version" message that names the mod.
LockConfig true The server's physics, heel, gust, pitch and hull-speed settings are pushed to every client on connect, so everyone sails by the same rules. Keys, HUD, camera tilt and the H opt-in stay personal.

Without a server copy everything still works, but nothing stops a friend from forgetting to install it. Since 1.1.1 the pilot's client takes over simulating the ship whenever they hold the rudder with manual trim on, so an unmodded passenger sees the boat move exactly as the pilot sails it; they only see the yard drawn at vanilla's angle.

Controls (while holding the rudder)

Input Action
Hold E Let out sail, any amount up to full (a tap adds a little)
Hold Q Take in sail, any amount down to furled
Hold Shift / Ctrl Row forward / astern. Only with the sail furled: with sail set, hold about a second to stow it first. RowKeysToggle makes them press-once toggles
Space Let go of the rudder (the game's Jump, exactly like vanilla). E never releases it.
Hold W Sheet in: the yard swings toward the centreline (pull the rope toward you)
Hold S Ease the sheet out: the yard swings away from the centreline
A / D Rudder, unchanged
H Switch you between vanilla sailing (the default) and manual trim; saved to your config
Hold fast on the mast (passenger) Take the sheet and trim with W/S while someone else steers

Gamepad: the left stick forward/back sheets in/eases, the gamepad Use button lets out sail and the gamepad Jump lets go of the helm. There are no default gamepad bindings for taking in sail or rowing, so use a keyboard for those or bind LowerSailKey, RowForwardKey and RowBackKey in the config.

All of these keys, and the sheet-key toggles, can also be changed in game: Settings > SailTrim tab (main menu or pause menu). Click a key to rebind it, Esc cancels, Delete clears it. Physics and server settings are not in the menu.

The vanilla ship HUD gets three additions: a sail icon on the wind circle that rotates with your sheet (belly toward the side the wind fills it; colour = trim state), a speed gauge in knots to its left (scaled to that hull's speed: gold up to hull speed, red past it), and two lines of text below: the trim hint (Trimmed, Sheet in, Ease out, LUFFING, STALLED, ABACK, BOW BURIED) and sheet angle / heel / gust. Wind direction and the no-go zone stay on the vanilla wind icon. The hint is averaged over about 1.5 s (ReadoutSmoothing) with a bit of hysteresis, so wave rocking does not make it flicker; trim for what it says on average, not for every wave. Turn the overlay off with ShowHud = false.

When you take the helm with the sail furled, a gold line under the HUD reminds you that holding E lets out sail, holding Q takes it in, Shift rows and Space lets go. It disappears once you have used the keys.

Sailing as a crew

Any passenger with the mod sees the ship HUD like the pilot does (wind circle, sail icon, speed gauge, trim state). Use the ship's Hold fast spot on the mast (E): you are held at the mast and W/S trim the sail while the pilot steers, exactly as a longship crew would, and a dedicated hand works the sheet 20% faster than a pilot doing two jobs. The pilot can still trim too; whoever pulled last wins and the other follows. Nobody else aboard can touch the sheet. Jump, or take the rudder yourself, to let go.

Opting out

Everyone starts in vanilla mode. The first time you take a rudder with the mod installed, the boat sails exactly like vanilla (W/S step the sail, tap E lets go, auto-trim, no extra heel) and the HUD says "Vanilla sailing · H for manual trim". Press H at the helm to switch to manual trim; the choice is saved per player and remembered between sessions, and H flips it back any time. While a vanilla-mode player holds the rudder the boat sails vanilla for everyone aboard; hand it to a manual-trim player and it switches back.

How to sail it

  • Sheet angle 0 = yard hauled fully in along the hull, 90 = fully eased square across the hull.
  • It is a square sail, so it likes a big angle of attack: the yard wants to sit at roughly half the apparent wind angle. Close-hauled (wind 60° off the bow) the yard goes to about 30°, on a beam reach about 45–60°, and from a broad reach onward it is simply square (90°). The HUD's Trimmed hint is computed from the actual force curve for the current wind, so trim to the hint rather than to a rule.
  • Downwind of about 110° the sail is a drag device: running with the yard square is the right trim, not a stall. Forward of that, hauling in well past the hint stalls it.
  • Sail amount: hold E to let sail out and Q to take it in, any amount from furled to full. Less sail means less drive, less heel and a drier bow; reef before the mast strains or the bow buries.
  • Rowing (Shift / Ctrl) only works with the sail furled; holding a row key with sail set stows the sail first (about a second, so a slip does nothing).
  • The yard follows the sheet even with the sail furled, so you can pre-trim before hoisting.
  • Eased too far: the sail luffs: the cloth ripples and there is almost no drive (the yard stays steady). Sheet in.
  • Hauled in hard, a drawing sail looks taut with a fair curve; eased out for a run it moves freely.
  • Tacking plays as one motion tied to the bow's swing: within about 25° of the wind the sail's tension eases and its foot streams out downwind, the yard sweeps round through square as the bow passes through the wind, and the sail is tensioned again on the new side. It is visual only; the boat tacks exactly as before.
  • Wind on the wrong face, for example in irons with the yard square: the sail is aback and pushes you astern. Square-riggers used this to back out of irons; sheet in or bear away to fill it properly.
  • Hauled too far: the sail stalls. Drive drops (never to zero, you can still crawl home), and the boat heels hard. Ease out.
  • A perfectly trimmed sail is about 50% faster than vanilla's auto-trim on a reach and much faster upwind; 10° off the ideal sheet costs about 15% of the push, a sloppy trim is roughly vanilla speed, and a stalled sail is much slower. Heel scales with the sail's side force, so it grows with wind strength and shrinks as you take in sail; a furled sail or rowing adds no heel at all.
  • The no-go zone is vanilla's: lift dies within about 37° of the true wind, exactly where the vanilla wind indicator turns red.

Realism extras (all in the 6. Realism config section, each can be zeroed)

  • Gusts and lulls. Rare by design: on average one event every 12 minutes, lasting about 40 s, up to ±40% wind strength. The readout shows GUST / lull while one is on. Between events the wind only has a tiny wobble. Everyone sees the same gusts (they are derived from world time).
  • Wind shadow. Land upwind takes wind away: a cliff or forested hill close to windward can cost you up to 40% of the breeze, then it fills in as you clear the point. Deliberately mild (WindShadowMax), so rivers between low banks stay sailable; the readout shows Lee when it bites.
  • Downwind rolling. Running within about 30° of dead downwind with the sail up, the boat rolls rhythmically, more in strong wind and at full sail. Head up a few degrees or drop to Half and it settles. Gentle by default (DownwindRolling).
  • Weather helm. A heeled boat tries to round up into the wind; hold rudder against it or ease the sheet. It grows with the square of heel, so a little heel barely tugs and a lot really rounds you up. Heel and weather helm both scale with hull beam, so the Karve is tender and the longship stiff.
  • Heel and speed. A little heel helps: about 5% faster at 8° (less hull in the water), gone by 16°. Past that, lying over costs speed: 25° is about 18% slower than flat. Ease out in a gust.
  • Leeway. A stalled sail or a hard-heeled boat slides sideways instead of tracking straight.
  • Mast strain. Heel past 35° for more than about 4 seconds and the rig is straining: the hull takes 0.5% of its health per second until you ease out or reef. A brief knockdown in a gust costs nothing.
  • Hull speed. Each hull has a speed it was built for (from its waterline length). Push past it and wave-making drag climbs and the bow digs in much harder, so a Karve driven at longship speeds buries its bow long before the longship would. The gauge turns red and reads "over".
  • Bow-down trim. Drive buries the bow, most of all running at full sail in a storm. Past about 12° the readout says BOW BURIED: you lose up to 40% of your drive and ship a little water (0.3% hull per second) until you ease out or drop to Half. Capped at 15°; the mod never pitchpoles the boat.
  • Gybes (off by default). A square yard is symmetric and has no boom, so a Viking ship wearing round was undramatic; nothing visibly swings. If you turn GybesEnabled on anyway, letting the wind cross the stern with the sail up gives a "GYBE!" roll kick and hull damage (5% of max health at full sail in strong wind with the sheet fully eased), softened by half sail, light wind, or sheeting in first.

Crew weight (1.7.0)

Bodies on deck move the boat. Stand to windward and she comes upright and sails faster; everyone to leeward and she lies over and slows. Sitting crew, anyone holding fast at the mast and the helmsman are braced, so they do not count. The effect is the boat's own physics, which means a karve answers to one person moving and a longship hardly notices. Crew on deck are told which rail to be on while she is heeling.

The gangway (1.8.0)

Craft a Gangway at the workbench: 10 fine wood and 4 iron nails, so it comes in about when the longship does. Every hull but the raft carries a pair of timber brackets on each rail, near its own boarding ladder; stand at them with a gangway in your pack and press E to fit it, one to a side. It stays with the boat.

It is three boards hinged end to end, planked in the hull's own timber and strapped with iron beams. Stowed, they fold back on one another and stand lashed against the inside of the rail. Press E again to lower it: the boards unfold, the plank swings out over the side and settles on whatever is under it, a dock, the shore, a log, or a beam halfway out, and it keeps resting there as the boat works in the swell. An inboard ramp swings down off the rail at the same time so you can walk up from the deck without jumping, and folds away inside the planking when it is not wanted. Carrying enough metal to be encumbered you cannot jump at all, which is what the whole thing is for.

While it is down the boat holds its spot the way a tied-up boat does, so nothing can shove it out from under you, though unlike a cleat it does not mend the hull. Lowering it within reach of a cleat with no boat on it ties that cleat on as well, so one press does the dock. You work it from on board. Taking the helm raises it after two seconds (GangwayRetractDelay). GangwayEnabled, GangwayLength, GangwayMaxAngle, GangwaySwingTime, GangwayTiesCleat and its costs are in the config.

Rafting up (1.9.0). If the plank comes down on another boat's deck rather than on the shore, it lands on it and the two are lashed alongside: both hold where they lie and both stop, the way a gangway onto a dock holds the one boat. Walk across, load the other hold, raft the fleet up for the night. Taking the helm of either boat raises the plank and frees them both. GangwayLashShips turns it off.

She has to be nearly still to put it down, or to take a line to a cleat: MooringMaxSpeed (3.5 knots). Both stop the boat, and a plank aimed from a boat still making way is aimed at something it will no longer be over.

Arranging the HUD (1.10.0)

Open the SailTrim settings page aboard a boat. The page goes see-through and the HUD keeps drawing behind it, so you can pick a piece from the list, move and size it with the sliders, and watch it move as you do. The first entry on the list is everything, for shifting the lot together. OK keeps it, Back puts it as it was, and Reset returns the whole HUD to stock. Meant for playing beside mods that move or enlarge the ship's own dials. HudLayoutKey can be bound if you would rather nudge things at the helm without opening the menu.

Lashing alongside (1.9.0)

Bring a boat up beside another and lower the gangway onto its deck. Nothing declares that you meant to: if the plank reaches, it lands, the same as it lands on a dock. When it lands on a deck the two boats are lashed alongside and both hold where they lie, so the plank stays put between them and you can walk across, shift cargo, or raft up for the night. Taking the helm of either boat raises the plank after the usual couple of seconds and frees them both, so nobody is ever held alongside by someone else's gangway with no way out. GangwayLashShips turns it off.

The chart (1.11.0)

Open the map and a readout appears in the corner: how she is trimmed, her speed, her sheet and heel, and then the two bearings that matter. Heading is where her bow points. Track is the course she is making good, which is not the same thing: a hard-heeled or badly trimmed hull slides to leeward, and over a long board that puts you well down from where you aimed. The difference is written out as the set and the drift, and drawn as a dotted line running from the boat the way she is really going, fading as it goes further ahead.

Put the cursor on a buoy and press C to steer for it. The panel then gives its distance, the course to steer (the bearing to it with the measured leeway taken out) and how far off it she is running. A mark dead to windward is reported as a beat, with the board she is nearest on, rather than a bearing she cannot hold. Press C away from a buoy to give the mark up. The mark is remembered per world.

The chart states; it does not coach. Nothing here tells you which way to hold the helm or how to trim, on the map or on the sailing HUD. MapHudEnabled, SetMarkKey, TrackMinutes and NoGoAngle are in the config.

Towing (1.11.0)

A boat with a tow bollard at her stern can take another in tow: a rope from her stern to the other's bow, and the boat behind keeps her way instead of being taken by vanilla's rule for an empty hull. Pull too hard and the line parts. TowLength, TowBreak and TowRange are in the config.

The cleat (1.6.0, three sizes in 1.11.0)

Build a Cleat from the hammer's Misc tab (one bronze): a bronze horn cleat that sits on top of planks or a floor. Stand at it with a boat within 10 m and press E to tie the boat up. The rope is made fast round the horn and runs to the hull, and the boat holds its spot and heading the way an empty boat does in vanilla, with or without people aboard. Creatures and waves cannot shove it away. Press E at the cleat again to untie, or just take the helm: after a second at the rudder (CastOffDelay) the boat casts off by itself. If the boat sinks, or the cleat is broken, the other side lets go too. A tied-up boat also mends itself a few percent a minute (MoorRepairPerMinute). CleatRange, CleatCost, CastOffDelay and MooringHold are in the config.

Berths (1.11.0)

Cleats come in three sizes, for a karve's berth, a longship's and a drakkar's. Take out the hammer near one and the berth it marks is drawn on the ground, so a harbour can be laid out to fit the boats that will lie in it.

The buoy (1.6.0)

Build a Buoy from the hammer's Misc tab: 6 wood and 2 resin, no workbench. It is a barrel float with a staff, a banner and a lantern. Aim at open water and place it like a boat. It floats on the waves, holds the spot it was set at, and its lantern glows at night. It stays in the world as far out as the game keeps distant objects (several zones), so a mark shows from far down a channel. Press E at a buoy to change the banner's colour: red and green for a channel, yellow for a race mark, and so on. Every buoy that is loaded shows on the map as a small disc in its colour. A boat that hits one shoves it aside for a moment and it works its way back. BuoyEnabled, BuoyLight and BuoyPins are in the config.

Buoys and cleats cannot be damaged (a ship's ram, weather, the sea floor); remove them with the hammer.

FAQ

Do I have to learn to sail to use this? No. The first time you run it you are sailing vanilla, exactly as before. Press H at the helm to take the sheet yourself, and H again to hand it back. Whichever you chose last is what you get next time. Manual trim is faster if you work at it, so it is worth trying, but nothing forces you.

Is it faster or slower than vanilla? Faster when you trim well, about the same when you do not. A good trim is roughly 50% faster than vanilla's auto-trim on a reach and much faster upwind; 10 degrees off costs about 15% of the drive; a sloppy trim is about vanilla speed. A badly stalled sail is slower, but you can always crawl home. None of the realism features is a straight penalty.

Does everyone on the server need it? Everyone who wants to sail with it, yes, and they all need the same version. The version check is exact: a server on 1.9.0 will not accept a 1.10.0 client. Move the server and the players together.

What happens to a friend who has not installed it? They can still sail. From 1.1.1 the pilot's own machine simulates the boat while they hold the rudder with manual trim on, so an unmodded passenger sees the boat move exactly as the pilot is sailing it. They just see the yard drawn at vanilla's angle rather than yours.

Does the dedicated server need it? Recommended, not required. Ship physics always runs on a client, so the server copy does not sail anything. It does two things, both in the server's config under 0. Server: Enforcement (Off / Warn / Require) decides what happens to players without a matching version, and LockConfig pushes the server's physics, heel, gust and hull-speed settings to every client on connect so everyone sails by the same rules. Keys, HUD, camera tilt and the H opt-in always stay personal.

Where are the settings? Two places. The common ones are in the game's own Settings screen, under a SailTrim tab: keys, the options, and the HUD layout. Everything else is BepInEx\config\com.maxst.sailtrim.cfg, which is created on first launch. Edit it with the game closed, or use a config manager.

The HUD sits on top of another mod's UI. Can I move it? Yes, and you can watch it move while you do. Open Settings, SailTrim tab, aboard a boat: the page turns see-through and the HUD keeps drawing behind it. Pick a piece from the list, or everything to shift the lot together, and move and size it with the sliders. OK keeps it, Back puts it as it was, Reset returns the whole HUD to stock.

How do I get a gangway, and where does it go? Craft one at the workbench: 10 fine wood and 4 iron nails, so it arrives about when the longship does. Every hull but the raft has a pair of timber brackets on each rail, near its own boarding ladder. Stand at them with a gangway in your pack and press E. It stays with the boat from then on, one to a side; press E again to lower or raise it.

Why will my gangway not go down? Two reasons. Either there is nothing within reach for it to rest on, in which case it refuses rather than dangling over the water, or the boat still has way on her. Lowering it holds the boat where she lies, so she has to be under MooringMaxSpeed (3.5 knots) first. The message tells you which.

Can I tie two boats together? Lower a gangway onto another boat's deck. It lands on it and the two are lashed alongside: both hold where they lie and both stop, so you can walk across and load the other hold. Taking the helm of either boat raises the plank and frees them both. GangwayLashShips turns it off if you would rather it never did that.

How do I tie up at a dock? Build a Cleat from the hammer's Misc tab (one bronze). Stand at it with a boat within 10 m and press E. The rope is made fast round the horn and the boat holds her spot and heading, with or without people aboard, and mends herself slowly while she is there. Press E again to untie, or just take the helm and she casts off by herself after a second. She has to be under 3.5 knots to be made fast.

My boat came untied after I logged out. Fixed in 1.10.0. Valheim hands every object a new internal id when a world loads, so the cleat and the boat each lost track of the other. Both ends now keep a marker that survives the reload, and the link is put back from it. Boats lashed alongside keep their raft the same way.

What are the buoys for? Marking water. Build one from the hammer's Misc tab (6 wood, 2 resin, no workbench) and place it on open water like a boat. It floats, holds its spot, lights up at night and shows on the map. Press E to change the banner colour: red and green for a channel, yellow for a race mark. Since 1.11.0 every buoy in the world is on the map whether it is loaded or not, the way a map pin is, and one off the corner map is held against its rim in its own colour. They stay loaded from a long way off, so a mark shows from down the length of a fjord.

Can I turn individual features off? Yes. Everything in the 6. Realism section can be set to zero on its own: gusts, wind shadow, downwind rolling, weather helm, leeway, mast strain, hull speed, bow-down trim. Gybes are off by default. The gangway, cleat and buoy each have an enable switch too.

Does it work with other mods? It should. It patches the ship, the helm and the sailing HUD and leaves the rest of the game alone. The HUD can be moved and resized for anything that rearranges the ship's dials. If you find a mod it argues with, please say which one.

Something is wrong. What is useful to send? BepInEx\LogOutput.log, what you were doing, and which ship. Issues at https://github.com/estovall/SailTrim -- the log usually says more than a screenshot can.

Config highlights (BepInEx\config\com.maxst.sailtrim.cfg)

Key Default Meaning
Enabled true Off = vanilla sailing for everyone (client-side kill switch)
ShowHud / ReadoutSmoothing true / 1.5 Overlay on/off, hint averaging
ShowControls true The sailing keys, as bound, beside the ship HUD whenever you hold the helm in manual trim
ControlHints true Raise/lower key reminder when you take the helm with the sail furled (only when ShowControls is off)
CameraTilt 1 How much the camera rolls with the heeling ship: 1 = vanilla, 0 = camera stays level
HullSpeedScale 1.6 Hull speed = 2.43·√(length m) kn × this: raft 10, Karve 12, longship 16, drakkar 18
HullSpeedDrag / OverSpeedPitchBoost 3 / 2 Extra drag and bow-burying past hull speed
ManualTrim false Your personal opt-in, saved when you press H; false = vanilla whenever you steer
ToggleKey H Flips ManualTrim in game
ReleaseHoldTime 0.5 Seconds to hold E to release the helm
LowerSailKey Q Lower sail one step
RaiseSailKey None Extra raise key (tap E always works)
MoveKeysTrimSheet true W/S (game Forward/Backward) sheet in / ease out
InvertSheetKeys false Swap so W eases and S sheets in
RowForwardKey / RowBackKey LeftShift / LeftControl Row forward / astern (sail must be furled)
RowKeysToggle false Row keys toggle instead of hold
StowHoldTime 1 Seconds a row key must be held with sail set before it stows the sail
RudderSelfCenter false Rudder drifts back to centre when not steering
SailSetRate 0.25 Sail let out / taken in per second while a key is held (server-synced)
EaseKey, SheetInKey None Extra keys for ease / sheet in
SheetRate 25 Degrees per second the yard moves while a key is held
ForceMultiplier 1.6 Overall sail power vs. the ship's vanilla factor
ApparentWindFactor 0.5 How much boat speed shifts the wind you trim to
HeelTorque 2.8 Heeling torque per unit sail force; the hull's own buoyancy balances it (0 = off)
RollDamping 0.6 Water damping on roll/pitch while the sail draws, so it settles
HeelWindPower 1.5 Heel grows faster than linearly with wind: storms lay you over
HeelDriveShare 0.3 Part of the drive counts as heel too, so a trimmed reach heels 10-15°
StallHeelBoost 1 Extra heel when stalled
MaxHeelAngle 45 Heeling torque fades out over the last 10° before this
LuffFlutter / CloseHauledTautness 1 / 1 Cloth ripple when luffing; how taut a hard-sheeted sail looks
TackAnimation / TackStartAngle / TackMaxYardRate true / 25 / 55 Tack motion on/off, where it begins (deg off the wind), fastest yard swing (deg/s)
SpillStreamAngle 55 How far the loosened sail's foot swings out downwind during a tack
GustPeriodMinutes / GustChance 6 / 0.5 One event per 6-minute slot with 50% chance (avg every 12 min)
GustDuration / GustStrength 40 / 0.4 Seconds per event, peak ±fraction of wind strength
LullFraction 0.35 Share of events that are lulls
AmbientVariation 0.04 Tiny constant wind wobble between events
WeatherHelm 0.04 Round-up yaw per degree of heel at 20° heel, quadratic in heel (0 = off)
HeelDriveLoss 1 Speed lost to heel (0 = off)
HeelSweetSpotBonus 0.05 Speed gained from a little heel, peaking at 8°
LeewayFactor 0.4 Extra sideways slip when stalled/heeled (0 = off)
PitchTorque / PitchWindPower / MaxPitchAngle 5 / 2 / 15 Bow-down torque per unit drive, its wind scaling, and where it fades out
NoseDiveLoss / NoseDiveDamagePerSecond 0.4 / 0.3 Drive lost and hull % per second with the bow buried
WindShadowMax / WindShadowOnset / WindShadowRange 0.4 / 10 / 25 Max wind lost in the lee of land, and the land angles where it starts and peaks
DownwindRolling / RollPeriod 0.6 / 4 Rolling strength when running, and the roll period for a Karve
CrewCanTrim / CrewTrimBonus true / 0.2 Crew trimming on/off and its speed bonus
PassengerHud true Ship HUD and readout for passengers
MastStrainAngle / MastStrainGrace / MastStrainDamagePerSecond 35 / 4 / 0.5 Heel that strains the rig, seconds before damage, hull % per second
GybesEnabled / GybeDamagePercent / GybeRollRate false / 5 / 30 Gybe on/off (off: a square yard has no boom to slam), hull damage %, roll kick

Everything else is documented inline in the cfg. While connected to a server with LockConfig on, the server's values replace yours for the physics sections (your file is not changed); they come back when you leave.

Building from source

Requirements: .NET SDK (8 or 9) and a Valheim install.

dotnet build SailTrim/SailTrim.csproj -c Release

The dll lands in dist\SailTrim.dll. If Valheim is somewhere else pass -p:ValheimDir="D:\Games\Valheim", and -p:DeployDir="D:\Games\Valheim\BepInEx\plugins" copies it straight into the game.

The game assemblies are publicized at build time (BepInEx.AssemblyPublicizer) so the plugin can reach private Ship fields. On load the plugin verifies every Harmony target by reflection and disables itself with an error in BepInEx\LogOutput.log if a game update changed a signature.

What it patches

  • ShipControlls.ApplyControlls — W/S become ease/sheet-in; rudder passes through.
  • ZInput.GetButtonDown("Use") — suppressed while piloting so tap-E can't release the helm; the plugin re-implements tap = raise, hold = release.
  • Ship.GetSailForce — lift/drag model from sheet angle vs. apparent wind.
  • Ship.UpdateSail — yard follows the sheet angle (one bounded angle, always through square); the cloth's own wind settings make it luff, tauten and flog.
  • Ship.CustomFixedUpdate (postfix) — heel couple on the ship owner; a second postfix holds a moored boat.
  • ZNetScene.Awake, ObjectDB.Awake / CopyOtherDB — the cleat prefab (built from primitives with the bronze material, no asset bundle) into the world's prefab list and the hammer's piece table. SailTrim_Moor RPC to the boat's owner; SailTrim_Boat in the cleat's ZDO, SailTrim_Cleat / SailTrim_MoorPos / SailTrim_MoorYaw in the boat's.
  • Ship.Start / Ship.UpdateControlls — SailTrim_Sheet / SailTrim_Mode RPCs (pilot → ship owner) plus sailtrim_sheet (float) and sailtrim_manual (bool) in the ZDO (owner → everyone), mirroring how vanilla syncs the rudder.

Changelog

1.11.1 Latest
  • Fixed: SailTrim stopped Zen's World Settings from loading its ship rules. Both mods change the same handful of instructions in the game's boat physics -- the ones that read how many players are aboard, which is what makes an unoccupied boat stop -- and SailTrim replaced them with a call of its own so that a crew that is not made of players still counts as crew. Zen's mod then went looking for instructions that were no longer there and threw, which took its whole ship section down and left an alarming stack trace with its name on it. SailTrim now adds to the game's count where it stood rather than putting something else in its place, and goes last so that every other mod reads the method before SailTrim has touched it. Two mods adding to a count can share it; two mods replacing it cannot.
1.11.0
  • The chart tells you where she is actually going. Open the map and a readout sits in its corner: how she is trimmed, her speed, and her heading against the course she is making good. A boat does not travel where her bow points, and over a long board the difference is a mile. A dotted line runs from the boat along the track she is really on, fading as it goes, so a headland either is or is not in the way.
  • Steer for a buoy. Put the cursor on one on the chart and press C. You get its distance, the course to steer with the leeway taken out of it, and how far off it she is running. A mark dead to windward is reported as a beat, with the board she is nearest, because a course worked from geometry alone will cheerfully ask for a bearing no boat can sail. The mark is remembered per world.
  • Buoys are on the map whether they are loaded or not. They behave like map pins now: the server keeps the book of every buoy in the world and each client draws the lot, in their own colours. The ones worth looking at a chart for are the ones at the far end of the passage, and those were exactly the ones that used to be missing. Buoys off the corner map are held against its rim in their colour (BuoyEdgeMarks).
  • Nothing coaches you. The chart states what she is doing; it does not tell you how to sail her. A line that read the heel and told you which way to hold the helm has been taken out again, along with anything of the sort on the sailing HUD. Advice on the screen while you steer is advice that gets followed instead of read.
  • Crew weight tells on a big hull. A body's weight is a fixed thing while a hull's resistance to rolling grows steeply with her size, so two players on a longship's rail did nothing you could see. A karve is unchanged; every bigger hull now gives some of her size back to the crew standing on her rail (CrewWeightHullPower), while still answering less, per body, than a small boat does.
  • Tow lines. A bollard at the stern of a tow-capable boat, a rope to the bow of the boat behind, and she comes with you instead of being left on a beach. The line parts if you drag her too hard.
  • Cleats in three sizes, for a karve's berth, a longship's and a drakkar's, with the berth drawn on the ground while the hammer is out so a harbour can be laid out to fit.
  • A wrecked boat gives her gangways back, and the game's own ship dials can be moved and sized with ours.
  • A surface for an AI crew (SailTrimApi), so another mod can put hands aboard: crew that count in the hull physics, steer, haul the sheet, work a gangway, take a boat in tow. It changes nothing for anyone not running such a mod.
  • Fixed: a tow record was kept in a form that does not survive a world reload, so a reloaded tug either towed nothing or, if the game had handed that id to another boat, towed a stranger.
  • Fixed: the tow bollard was a body of its own bolted inside a floating hull, which is what throws a boat on her beam ends, and it made itself known to the physics only once while a hull's own parts go on arriving for seconds after she loads.
  • Fixed: a mark was saved in the machine's own number format, so on a keyboard that writes decimals with a comma it could not be read back; and it was kept across worlds, so another save showed a mark from the last one.
  • Fixed: making sternway, rowing back or drifting out of irons, turned the course to steer into a course away from the mark. Set and drift now want a knot and a half of way forward before they are reported at all, which also stops the track swinging about on the swell.
  • Fixed: the sailing HUD was the one thing drawn each frame with nothing to catch it, so anything going wrong in it would have killed it silently; and the buoy rim markers could not come back after a world reload.
1.10.0
  • Boats carry their way off instead of stopping dead. Step off a boat under sail and vanilla takes nine tenths of her speed every physics step, which at fifty steps a second is a wall; she now loses her way evenly over EmptyCoast (2.5 seconds) and comes to rest like a boat rather than like a boat hitting one. The same when a line goes on or a gangway goes down: she settles over MooringSettle rather than stopping where she stands, and is held at the spot she was made fast at, not wherever she drifted to.
  • A gangway stays where it was set down. It used to feel for the ground again every frame and take whatever it found, so half a metre of swell had the tip reading the top of a beam one frame and the ground beside it the next, and the plank climbed in and out of the timber. It now takes the spot once, as it goes down, and keeps it in the frame of whatever it landed on: a dock stays put, another boat's rail rides with that boat, and only the angle needed to reach it changes as the hull works.
  • Tying up and lowering a gangway want her nearly still (MooringMaxSpeed, 3.5 knots). Both stop the boat, and a plank aimed from a moving boat is aimed at something it will no longer be over.
  • Moorings survive a restart. A boat tied to a cleat came back untied, while a gangway came back as it was left. A ZDOID does not survive a world load -- the game hands every object a fresh one -- so anything saved that points at another object by ZDOID points at nothing when the world returns, and the cleat and the boat each held the other's. Both ends now also keep a tag that does survive, and the link is put back from it. Boats lashed alongside keep their raft the same way.
  • The HUD can be arranged to suit whatever else is on your screen. In the SailTrim settings page: pick a piece (or "everything"), then move and size it with sliders while you watch it move behind the page, which goes see-through while you are there. OK keeps it, Back puts it as it was, and there is a Reset. For playing beside mods that move or enlarge the ship's dials.
  • Fixed: a gangway swinging out could throw another boat on its beam ends. It only spared the boat it had lashed to, which left the shove in place on the way out, on a boat it landed on without lashing, and on every boat when GangwayLashShips was off.
  • Fixed: a cleat made its rope fast to the boat's own gangway. A lowered plank reaches out towards the dock, so it was nearer the cleat than the hull was.
  • Fixed: the place to interact with a gangway was the plank itself, which moves, so it was never where the brackets are; and it was solid and invisible while nothing was fitted, which put a block on the rail to walk into. The brackets carry it now, on the layer the game's own ladders use, so you walk through it rather than into it.
  • Fixed: the gangway's ironwork was plain timber, its planks fought with themselves for every pixel, and its folded leaves stood further apart than they needed to.
  • A boat with no gangway fitted no longer builds one. Every hull but the raft carries the brackets, and they were building the walkway, the brow and all their meshes whether anyone had crafted a gangway or not.

15 older entries, full version history & downloads →

Threads

Log in to post
Manual installation instructions
1

Install BepInExPack Valheim

BepInExPack Valheim is required to run mods in Valheim.

Download BepInExPack Valheim 5.4.2351 · View mod page

Check out the mod page for detailed installation instructions.

2

Install SailTrim

This mod must be installed on the client. Installing it on the server is optional (e.g., for config syncing).

Download SailTrim 1.11.1

Extract the ZIP and place the file(s) into the BepInEx/plugins/ folder inside your Valheim game folder.