Repository navigation
Movers step 1: legal routing with roads, travel mode and pace - #182
Conversation
…lace mph Step 1 of the movers plan. NPC journeys now get the shortest LEGAL path to each waypoint instead of a straight line through fog: shared `rules/journey.ts` runs A* that ignores fog but respects the mover's travel medium (land cannot enter water, water only water/coast, air anything) and impassable edges, with integer cost tiers — road 1, known off-road 2, unknown off-road 3 — times the edge effort. Party routing and the client's preview use the same step cost, so the party prefers roads on known ground. Roads are trails with `kind: 'road'` (Trail tool → Road): no gate, no signs, skipped by the track engine, delivered to players clipped to known fog, drawn as a solid way for everyone. Tokens and retinues carry `travelMode` + `pace` (resolving token → retinue → foot/normal) instead of a bare mph; custom modes are campaign customTravelModes, now with a medium, added from the Tokens panel's "Custom…" form. The mph column stays but is unread. Seed roster converted. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6c420e5279
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| trails: mapState.trails | ||
| .filter((t) => t.kind === 'road') | ||
| .map((t) => ({ ...t, dmNotes: '', cells: t.cells.filter((c) => fogAt(c.q, c.r) !== 'hidden') })) | ||
| .filter((t) => t.cells.length > 0), |
There was a problem hiding this comment.
Keep filtered road snapshots schema-valid
When a player has explored exactly one cell of a road, this filter emits a trail with one cell, but TrailSchema requires at least two. The client validates snapshots with ServerMessageSchema.safeParse, so it rejects the entire snapshot and can remain blank or stale until a second road cell becomes known. Either omit one-cell road fragments or introduce a player-road schema that permits them.
Useful? React with 👍 / 👎.
| } | ||
| ] | ||
| } | ||
| }\n No newline at end of file |
There was a problem hiding this comment.
Remove the literal escape from the roster JSON
The file ends with the literal characters \n after the closing brace, so JSON.parse in seed-retinues.mjs throws before making any API request. Invoking the documented seed command with its default roster is therefore completely broken.
Useful? React with 👍 / 👎.
| <TravelPicker | ||
| mode={token.travelMode} | ||
| pace={token.pace} |
There was a problem hiding this comment.
Expose travel mode before routing a plain NPC
For a freshly created ordinary NPC, retinue is absent, route is empty, and note is empty, so the enclosing condition prevents this new TravelPicker from rendering. The DM must consequently plan the first route as foot; changing the mode afterward does not recalculate the stored route, making it impossible through the normal UI to directly plan a ship or flying route for such a token.
Useful? React with 👍 / 👎.
Step 1 of the movers plan (routing fix, mode/pace, roads).
shared/rules/journey.ts— A* over the whole map (fog ignored) honouring the mover's medium (land/water/air vs terrain) and impassable edges; cost tiers road 1 / known 2 / unknown 3, times edge effort. A leg with no legal route falls back to the straight line. Party routing and the client preview share the step cost, so the party prefers roads within explored ground.POST …/trailsacceptskind.travelMode/pace(token → retinue → foot/normal). Custom modes are campaigncustomTravelModes(newmediumfield) added from the Tokens panel.mphcolumn kept, unread.🤖 Generated with Claude Code