Skip to content

Sailing/ocean destinations: route via Chart Plotter for water travel #100

Description

@Mitchole

Problem

Pathing to a waypoint that sits on open water (or while the player is sailing)
doesn't work. Capturing the tile is fine, but "path to" produces nothing usable.

Why

Waypointer hands its destination to Shortest Path (WaypointPathfinder posts a
shortestpath / path PluginMessage with the packed target, and clear to
cancel). Shortest Path is a walkable-tile pathfinder with a static transport
database. It has no model of the ocean or the Sailing skill, so any target on
water has no route.

Fix, part 1 - Chart Plotter (external)

Chart Plotter (Dazuzi) already does collision-aware ocean routing, but it only
takes a destination from a world-map click; it exposes no inter-plugin API.

I'm adding a small PluginMessage API to Chart Plotter on a branch, to PR
upstream. It mirrors how we drive Shortest Path:

  • namespace chartplotter
  • name chart, data { "x": <int>, "y": <int> } (world tile) -> sets the course
  • name clear -> drops the course

It routes straight into Chart Plotter's existing destination handling, so it
reuses its snapping, async routing, and overlays. It only charts while the
player is aboard a boat, and no-ops otherwise. No new dependencies, no
reflection, no file I/O.

Fix, part 2 - Waypointer (only if the Chart Plotter PR is accepted)

  • New ChartPlotterPathfinder service mirroring WaypointPathfinder: unpack the
    target to world x/y and post chartplotter / chart, plus clear.
  • Detect Chart Plotter at runtime via a ConfigManager probe of group
    chartplotter (same approach we use to detect Shortest Path).
  • Pick the router by sailing state: read VarbitID.SAILING_BOARDED_BOAT; when
    aboard, route via Chart Plotter, otherwise via Shortest Path.
  • Keep the pathing banner / arrival auto-clear behaviour consistent across both
    routers.

Follow-up phase: navigate to the boat first

When the target is across water but the player is on land, the journey is two
legs: walk to the boat, then sail. The game exposes where each boat is moored
(VarbitID.SAILING_BOAT_1_PORT..SAILING_BOAT_5_PORT,
SAILING_BOARDED_BOAT_LAST_DOCK, VarPlayerID.SAILING_BOAT_SELECTION /
SAILING_BOAT_SELECTION_CURRENT_DOCK). So:

  1. Read the selected/last boat and its port.
  2. Map the port to a dock boarding tile (small static table we maintain).
  3. Shortest Path the player to the dock.
  4. On boarding, hand off to Chart Plotter for the sea leg.

This can land as a separate change after the basic sailing route works.

To verify before the port table

Confirm the runtime values of the port/dock varbits in-game (port/dock ID vs a
tile-derived value), so the port-to-tile mapping is built on the right
representation.

Status

Blocked on the Chart Plotter PR being accepted. The waypointer-side work is
small and self-contained once the API exists.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestpriority: mediumSolid roadmap items, ship in normal cadence

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions