Commit graph

8 commits

Author SHA1 Message Date
Stephen Dennis
e7eb6ec76d nls: route literal #-1 softcode tokens through S_ (#1475)
Mechanical hygiene under the opt-in M_() design: replace T("#-1…") and
T("#-2…") with S_() so softcode ABI tokens are obvious in source and
cannot enter a player catalog. ~400 call sites across engine, exp3,
mail, and driver. Assembled/library-spliced diagnostics (plan §4.2)
are unchanged where they are not a single literal.
2026-07-27 01:00:55 +00:00
Stephen Dennis
03d017fc20 Implement Phase 4 routing: @walk and @patrol NPC primitives
Add server-side @walk <npc>=<destination> that moves an object one hop
per second along the routed path until arrival, and @patrol <npc>=<rooms>
for continuous waypoint loop movement. Both use the system scheduler
(DeferTask self-rescheduling, same pattern as @cron) and call move_exit()
for full movement side effects.

New route_next_exit() C-level API returns the next-hop exit dbref
directly, avoiding text format/parse overhead for the walk subsystem.

Switches: /stop cancels, /quiet suppresses notifications, /locked
validates exit locks during movement.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 08:54:51 -06:00
Stephen Dennis
d5dbe021cb Restore routing fast path for Phase 3a 2026-03-29 08:38:45 -06:00
Stephen Dennis
737eadb8ee Implement Phase 3a routing: query-time lock validation
Add route(..., locked) option that validates the next-hop exit against
the executor via could_doit(). Returns #-1 EXIT IMPASSABLE if the exit
is locked against the executor. Works with distance and path options.

This is a thin Tier 2 layer: no lock-equivalence classes, no TTL, no
uncached BFS fallback. The Tier 1 table is reused as-is; only the
returned next-hop exit is validated at query time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 08:36:15 -06:00
Stephen Dennis
39691912e3 Fix Phase 2 routing gateway selection 2026-03-29 04:05:34 -06:00
Stephen Dennis
1bc324c022 Implement Phase 2 routing: per-zone tables with cross-zone meta-table
Partition the routing graph by Zone(room). Each zone has an independent
BFS table and generation counter, so topology changes in one zone do not
force rebuilds elsewhere. Rooms with no zone (NOTHING) are grouped into
a synthetic orphan zone.

Cross-zone routing uses a gateway-edge meta-table: exits that cross zone
boundaries are collected as GatewayEdge structs, and queries between
different zones run BFS over the zone graph to find the gateway chain,
then use local tables for intra-zone segments.

New API: route_invalidate_zone() and route_invalidate_meta() for
targeted invalidation. do_chzone() now invalidates both the old and new
zone plus the meta-table when a navigable room changes zones.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 03:53:13 -06:00
Stephen Dennis
82d0ff1728 Fix Phase 1 routing correctness gaps 2026-03-29 03:28:10 -06:00
Stephen Dennis
a348e27f33 Implement Phase 1 routing: static unconditional next-hop tables
Add route() softcode function with BFS-based shortest-path routing
over rooms marked NAVIGABLE. The routing table stores only the next-hop
exit for each (source, dest) pair, compressed via diagonal elimination,
adjacent marking, and row redundancy. Lazy rebuild on generation-counter
mismatch triggered by topology changes (@dig, @destroy, @link, @open,
@unlink) and NAVIGABLE flag changes. SQLite schema v10 adds route_nodes,
route_table, route_meta tables for future persistence phases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 03:18:37 -06:00