You are viewing a potentially older version of this package. View all versions.
SmeagsMods-PairedDrawbridges-0.1.2 icon

PairedDrawbridges

Paired opposing vanilla drawbridges with a centerline Free end snap. Matching client/server installs required; multiplayer untested. Feedback/support: https://discord.gg/bfbb4yY6pt

Date uploaded a day ago
Version 0.1.2
Download link SmeagsMods-PairedDrawbridges-0.1.2.zip
Downloads 13
Dependency string SmeagsMods-PairedDrawbridges-0.1.2

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2351 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.2351

README

Paired Drawbridges 0.1.2

Operate an opposing pair of Valheim drawbridges from either bank. When their free ends meet in the lowered position, using either bridge requests the same raised or lowered position for both.

This is a standalone SmeagsMods mod. It does not require Tunnelheim Companion.

Pairing

  • Supports the vanilla large drawbridge (piece_drawbridge) and log drawbridge (piece_drawbridge_log). Pair two of the same type.
  • The bridges must face one another, with both ends and their edges aligned: up to 25 cm horizontal and 15 cm vertical tolerance, within 3 degrees of directly opposing and 2 degrees of upright. These limits are conservative; they are not a general nearby-door link.
  • Pairing uses fixed lowered-pose geometry, so raising the leaves does not break the pair.
  • Each bridge must have exactly one matching partner, and that partner must also have exactly one match. Ambiguous groups are not linked. There are no chains.
  • Parallel, stacked, offset, differently sized, scaled, and unrelated pieces remain independent. Unpaired/ambiguous bridges retain native interaction behavior.
  • Existing bridges are recognized automatically. Removing a bridge removes the relationship; a correctly placed replacement is recognized on the next interaction. No rebuilding or saved pair assignments are required.

If the two leaves start in different positions, using one asks both to adopt the position opposite the leaf you used. Wait for movement to finish before interacting again. There is a three-second shared command lock.

Both bridge supports must allow you access under the normal ward rules. A ward protecting the other bank does not become remotely operable through an accessible bridge.

Build with the Free end snap point

Both vanilla drawbridge types now have one extra centerline snap point named Free end, alongside their six unchanged support points. Use Valheim's normal snap-point controls to choose it, rotate the other bridge to face the opposite bank, and connect the two free ends. Rotation remains under your control. With Free end selected, aim at the existing bridge to target its fixed free end. Both the surface you aim at and the connector must be within normal build reach; move closer if needed.

The new point stays at the lowered deck's free edge even while the leaf is raised. A drawbridge-only fallback makes that point discoverable when the raised leaf's colliders fall outside the native snap search. Native snapping takes priority, and selecting a support point manually is respected. Normal overlap, ward, resource and placement checks remain in effect.

The point is added to placement ghosts and existing bridges automatically; rebuilding is unnecessary. Mixed large/log bridges can align their snap centers but remain independently operated because their widths differ. Pair recognition still uses the geometry rules above, rather than a saved snap connection.

Requirements and installation

  • Valheim 1.0.20 is the inspected target version.
  • BepInEx 5; dependency: denikson-BepInExPack_Valheim-5.4.2351.
  • Install the same mod version on every participating client and the server/host. This is a networked interaction mod. A client-only or server-only installation is unsupported.

With Valheim closed, import the release ZIP through your mod manager, or copy BepInEx/plugins/PairedDrawbridges/PairedDrawbridges.dll into that location in the selected profile. Keep only one copy. The testing harness, game assets and evidence are not release files.

Multiplayer and validation limits

Built successfully against the installed Valheim 1.0.20 assemblies with zero warnings/errors. The production pairing/state rules passed 10,062 deterministic assertions. The same DLL passed 408 native single-player assertions (375 main checks and 33 after save/reload). This includes actual camera aiming, the full placement-preview update and native second-piece placement for both raised and lowered bridge types, alongside snap geometry, wards, pairing and repeated-interaction checks. See TESTING.md for the instrumented test scope and limitations.

The protocol routes commands to existing object owners and uses an explicit target state. It never claims ownership, broadcasts a toggle, or recursively invokes the other bridge's interaction. Duplicate and old commands are ignored. The normal native animation, effects, state replication and saving remain responsible for the leaves.

Two-client, dedicated-server and ownership-migration tests have not been completed. A change of owner, unloaded object, disconnected peer, or newly denied ward during delivery can leave one leaf unchanged. Commands expire rather than retry indefinitely; once conditions settle, another interaction reconciles the pair. This is not an atomic distributed transaction. Missing-mod peers are unsupported and may prevent an action from completing. Do not assume compatibility with mods replacing drawbridge geometry, Door interaction, wards, or network ownership.

Pair relationships are computed at interaction time and do not add new pieces or prefabs to saves. Small namespaced command timestamps are stored on existing bridge ZDOs to reject duplicate/stale operations across ownership changes and reloads. Uninstalling leaves the native bridge state intact; the extra timestamps are inert.

Feedback & Bug Reports

Visit the SmeagsMods Discord. Include the game version, mod version, bridge type, placement screenshot, and whether you were hosting or joining.

Credits and license

Created by SmeagsMods. Original mod code is MIT licensed; see LICENSE. Valheim and its assets belong to their respective owners and are not included.

CHANGELOG

Changelog

0.1.3

  • Removes an unrelated project reference from the README.
  • Documentation-only package update: contains the unchanged, tested plugin DLL 0.1.2. Gameplay and dependencies are unchanged.

0.1.2

  • Fixes the placement preview disappearing when Free end is selected and you aim at an existing drawbridge leaf. Vanilla rejects the animated leaf's Rigidbody before snapping; this release accepts only supported drawbridge targets for that selection.
  • Aiming at the bridge targets its fixed lowered free end. Normal reach, manual rotation, intervening obstacles, alternate placement, support-point selection and native placement validation remain in control.
  • Adds regression coverage through real camera raycasts, the complete preview update and native second-piece placement; the earlier snap-only tests missed this workflow.
  • Feedback and support: https://discord.gg/bfbb4yY6pt

0.1.1

  • Adds one centerline Free end snap point to both vanilla drawbridge types, including existing bridges and placement ghosts, without rebuilding.
  • Keeps the point anchored to the lowered deck geometry in both leaf positions and preserves all six native support snaps.
  • Adds a drawbridge-only discovery fallback when a raised leaf moves its colliders outside the native snap search. Native results, manual support selection and normal placement guards retain priority.
  • Shares connector geometry between snapping and pair recognition; duplicate initialization reuses the point.
  • Feedback and support: https://discord.gg/bfbb4yY6pt

0.1.0

  • Initial standalone paired-drawbridge implementation for matching vanilla large or log drawbridges.
  • Recognizes opposing, uniquely matched free ends using stable lowered geometry.
  • Preserves native standalone behavior and requires access at both supports.
  • Uses owner-directed, expiring target-state commands with duplicate protection and a shared interaction lock.
  • Adds no placement snap points or custom world objects.
  • Multiplayer runtime coverage remains pending; see README and TESTING.