Skip to content

Feature/sailing helm - #182

Draft
MouldyToast wants to merge 9 commits into
OpenRune:mainfrom
MouldyToast:feature/sailing-helm
Draft

Feature/sailing helm#182
MouldyToast wants to merge 9 commits into
OpenRune:mainfrom
MouldyToast:feature/sailing-helm

Conversation

@MouldyToast

Copy link
Copy Markdown
Contributor

Sailing Engine -- World-Entity Framework + Helm Navigation

Adds the core sailing engine: world-entity boat spawning, boarding/disembarking, per-tick kinematics, 16-way helm steering, and deck furnishing. The full sail loop works end-to-end against the real client.

What works

Board at a dock -> Navigate the helm -> first ocean click departs straight ahead at full throttle -> 16-way steering by clicking -> Stop-navigating -> decelerate -> Disembark.

World-Entity Engine (Phases 0-2c)

  • Dynamic instance regions allocated per boat, zone-copied from static template maps
  • WORLDENTITY_INFO protocol: world-entity avatar lifecycle, coord updates, angle broadcasts
  • Player ride/unride onto world entities with worldentity_ride bypass (root rebuild + map_loader.load_area())
  • Zone-update fixes: aboard root zone view centering, world-scoped deck zone updates, zone-state replay on high-res view entry

Sailing Module (Phase 3)

  • Docks & Gangplank -- Bidirectional board/disembark at Port Sarim (and extensible to other docks). Player faces south on board to match the capture's departure orientation
  • BoatKinematics -- Per-tick speed ramp (+/- acceleration), shortest-path turning (+/- 128 angle units/tick), movement integration along post-turn angle, q32 fixed-point quantization. Parity-tested: 0 mismatches vs reference across 2048 angles x 7 speeds and 2000 random 40-tick trajectories
  • Helm + SET_HEADING -- All 42 steering multiloc variants bound (Navigate / Stop-navigating), SetHeadingHandler net handler -> SailingEvent.SetHeading -> content, interaction-mode switching (heading tile-mode while steering, walk tile-mode on release), helmsman tracking with releaseHelm safety net on every off-boat path
  • Deck Furnishing -- 43 facility locs (12 raft / 14 skiff / 17 sloop) spawned per boat type via LocRepository onto the instance region. Helm, sails, cargo, keel, trim, and ambience emitters all server-spawned (the static template zones carry only the hull shell -- this is how per-boat customisation works)
  • Three boat types -- Raft, Skiff, Sloop with distinct speed/acceleration profiles, helm anim/synth sets, and deck furniture layouts

New Files

File Purpose
BoatKinematics.kt Singleton integrator -- speed ramp, turn, movement
BoatKinematicsScript.kt LateCycle tick binding
HelmEvents.kt Navigate/Stop/steer, 42 loc bindings, SetHeading consumer
SailingMoveModes.kt STOPPED/HALF/FULL/REVERSE/HELM_IDLE constants
DeckLoc.kt / DeckLocs.kt Per-type facility furniture data
InteractionModes.kt SetInteractionMode/ResetInteractionMode output wrappers
SailingEvent.kt SetHeading(player, heading) UnboundEvent
SetHeadingHandler.kt Net handler for SET_HEADING, gates heading > 15

Modified Files

Boat.kt, BoatType.kt, BoatManager.kt, SailingVars.kt, GangplankEvents.kt, SailingDebugCommands.kt, MessageConsumerProvider.kt

Known Gaps / Next Steps

  • Sail state machine -- down/half/full transitions with loc anim pairs + synths. Blocked on op-mask support (sails need restricted ops per state)
  • Helm keepalive anims -- 10-tick resend of player loop anim + helm loc loop anim while navigating (player currently stands still at helm after grab)
  • Sidepanel UI -- IF 937 (speed controls, navigator name, move-mode display)
  • Boat-selection UI -- IF 934 modal for choosing which boat to take out on boarding (currently spawns a default raft)
  • OpWorldEntity handlers -- rsprot decoders exist, OpenRune has none yet
  • Boarding choreography -- Fade transitions, synth 10754, music region changes
  • Boat ownership -- Ownership varbits (Pandemonium quest gate)
  • Facility customisation -- IF 939 modal for upgrade tiers (C4 blocked on build-confirm capture)
  • Mooring points -- Loc 59867-59893 coords at other docks unverified
  • Logout/login aboard -- Not safe to log out aboard; heading tile-mode would persist incorrectly (lockedin self-heal covers the varbit half)
  • No root-world collision for boats -- Boats clip through land
  • Moored boats never despawn -- One raft per visited dock until ::delboat or restart

Debug Commands

  • ::setheading <0-2047> -- Set boat angle directly
  • ::setspeed <value> -- Set boat speed directly
  • ::moveboat <dx> <dz> -- Teleport boat (syncs targetAngle)
  • ::exitboat -- Force-disembark with helm release
  • ::delboat -- Remove a moored boat

- BoatKinematics: per-tick speed ramp, shortest-path turning, fine-coord
  integration on LateCycle; ::setheading/::setspeed debug commands
- Helm: Navigate/Stop-navigating across all 42 steering multiloc variants,
  SET_HEADING net handler + SailingEvent bridge, heading/walk interaction
  tile modes, releaseHelm teardown on every off-boat path
- Deck furnishing: per-type facility locs (helm, sails, cargo, keel, trim,
  ambience) spawned onto the boat region at spawn
@MouldyToast
MouldyToast deleted the feature/sailing-helm branch August 23, 2026 05:58
@MouldyToast
MouldyToast restored the feature/sailing-helm branch August 23, 2026 06:04
@Mark7625 Mark7625 reopened this Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants