feat: SK backlog from test through 2026.11.22.48 (Trade Shop, Oracle, quests, loot, nav)

Squash of test/main-merge-2026-10-25 onto aelrynth main 2026.11.19.1 for the standing sk PR. Includes Trade Shop, Oracle wiki/ILT tracker, quest runs, loot checklist, RynthNav, VTank import. HandWrittenVersion remains 0.5.0-legacy-ui. See Changelog/2026-11-22-sk-backlog-test-merge.md.
This commit is contained in:
BlankenshipG 2026-11-23 00:08:38 -05:00
commit dc08e1abba
521 changed files with 47247 additions and 795 deletions

View file

@ -25,7 +25,7 @@ namespace RynthCore.Plugin.RynthNav;
public sealed partial class RynthNavPlugin : RynthPluginBase
{
internal static readonly IntPtr NamePointer = Marshal.StringToHGlobalAnsi("RynthNav");
internal const string PluginVersion = "0.6.8"; // 0.6.8: the route maker (makeroute, makeloop, makepath, routeinfo, "RynthNav.Routes")
internal const string PluginVersion = "0.6.14"; // upstream 0.6.8 (the route maker: makeroute, makeloop, makepath, routeinfo, "RynthNav.Routes") merged into the test branch's 0.6.13
internal static readonly IntPtr VersionPointer = Marshal.StringToHGlobalAnsi(PluginVersion);
/// <summary>Lets PluginExports log through this plugin's host (the base Log is protected).</summary>
@ -144,6 +144,9 @@ public sealed partial class RynthNavPlugin : RynthPluginBase
// The panel's switches survive reloads and relogs (rynthnav.json, next to navDataDir).
_portalsEnabled = NavDataConfig.ReadSwitch("portals", false);
_recallsEnabled = NavDataConfig.ReadSwitch("recalls", true);
InitLearn();
InitGems();
InitDoors();
LoadAvoidSettings();
LoadMarkerSettings();
LoadMeshSettings();
@ -381,6 +384,7 @@ public sealed partial class RynthNavPlugin : RynthPluginBase
if (cancel)
{
if (_gotoActive) _goNote = "stopped"; // the panel's status line (the d-pad and Stop say nothing in chat)
StopLearn("stopped"); // Stop, or any movement key, ends learning portals too
_gotoActive = false; _route = null; _portalWait = false; if (_recallWait) EndRecall();
ResetHub();
HideMarkers("cancelled");
@ -491,9 +495,11 @@ public sealed partial class RynthNavPlugin : RynthPluginBase
// legs; otherwise StepGoto just navmesh-walks straight to the final target.
// Inside the Town Network there is no navmesh: the way on is one of its exits.
ResetHub();
bool inHub = _townNet?.Contains(CurrentLandblock) == true;
// In a dungeon RynthNav learned (custom portals) the plan itself weighs its walks to each of
// its portals (and on through other learned dungeons) against your recalls (PlanRoute).
bool inTownNet = _baseTownNet?.Contains(CurrentLandblock) == true;
int portalsUsed; double est; List<RecallOption> recalls;
if (inHub)
if (inTownNet)
{
recalls = new List<RecallOption>();
_route = PlanFromInsideHub(tns, tew, out est, out portalsUsed);
@ -513,7 +519,7 @@ public sealed partial class RynthNavPlugin : RynthPluginBase
_route = null;
return;
}
_route = plan.Steps; portalsUsed = plan.Teleports; est = plan.Est;
else { _route = plan.Steps; portalsUsed = plan.Teleports; est = plan.Est; }
}
_routeRecalls = recalls;
@ -525,7 +531,7 @@ public sealed partial class RynthNavPlugin : RynthPluginBase
_shownRoute = _route ?? new List<RouteStep> { new(tns, tew, false, false, "walk") };
_shownRouteFor = name; _shownRouteEst = est; _shownRouteLive = true; _routeVersion++;
SetSubGoalToCurrentLeg();
if (_route != null && portalsUsed > 0) _arrow.SetRoute(_route, name, type, tns, tew);
if (_route != null && portalsUsed > 0) _arrow.SetRoute(_route, name, type, tns, tew, s => TheHub(HubExitOf(s)));
else _arrow.SetTarget(name, type, tns, tew);
_openArrowSeq++;
@ -721,6 +727,22 @@ public sealed partial class RynthNavPlugin : RynthPluginBase
FinishGoto($"stopped: no progress for 30 s, {toGoal:F0}u short ({why})");
return;
}
// A closed door across the path ahead, or one we ran into: open it, unlock it, or go round it
// (RynthNavPlugin.Doors.cs; until 2026-11-01 only the dungeon walks opened doors).
switch (GotoDoor(NowMs, out string doorWhy))
{
case DoorAct.Busy:
AutoRun.Halt();
return;
case DoorAct.Blocked:
// A locked door in a wall this character jumps: over it (2026-11-07); else round it.
if (TryJumpLockedDoor()) return;
Host.Log($"[RynthNav] walk: {doorWhy}; planning again round it");
lock (_gotoGate) _gotoPath = null;
_replanTick = 0;
break;
}
// Running into something (RynthNavPlugin.Blocked.cs): turn away, plan again, or stop and say where.
if (StepBlocked()) return;
@ -760,11 +782,15 @@ public sealed partial class RynthNavPlugin : RynthPluginBase
// goal for a moment, which carries us over a seam, then stand and keep re-planning.
// Before, autorun stayed on with the old heading and nothing steering: the bot
// ran off in a straight line, or (no plan at all) stood forcing autorun off.
if (_blindTicks < BlindPushTicks)
// Following a trip's path (TripFollow: the aim is on the walk the markers draw), it keeps
// pushing along it (or the route graph's next crossing) rather than standing (2026-11-07: it stood 25 s against a wall at Yaraq
// until the progress watchdog stopped the goto): running into something there is what the
// stuck watch, the jumps and the stepping round are for.
if (_blindTicks < BlindPushTicks || _aimOnTrip || _coarse != null)
{
_blindTicks++;
// Straight at the goal, or along the route at its next crossing.
double bh = (_coarse != null ? Math.Atan2(_aimEw - _wx, _aimNs - _wy) : Math.Atan2(fdew, fdns)) * 180.0 / Math.PI;
double bh = (_coarse != null || _aimOnTrip ? Math.Atan2(_aimEw - _wx, _aimNs - _wy) : Math.Atan2(fdew, fdns)) * 180.0 / Math.PI;
bh = SteerRoundPortals(bh < 0 ? bh + 360.0 : bh, 10.0);
WalkDrive(bh);
if (_blindTicks % 10 == 0) lock (_gotoGate) _gotoPath = null; // re-plan soon
@ -854,7 +880,8 @@ public sealed partial class RynthNavPlugin : RynthPluginBase
lock (_gate) _status = status;
_gotoEndStatus = status; _gotoEndSeq++; // a route maker go job reads how it ended (RynthNavPlugin.RouteMaker.cs)
Host.Log($"[RynthNav] goto: {status}");
Say(status == "arrived" && _gotoName.Length > 0 ? $"goto: arrived at {_gotoName}" : $"goto: {status}");
string inside = TakeInsideTail(status); // a target inside a dungeon: where in it (RynthNavPlugin.Inside.cs)
Say((status == "arrived" && _gotoName.Length > 0 ? $"goto: arrived at {_gotoName}" : $"goto: {status}") + inside);
_goNote = status == "arrived" && _gotoName.Length > 0 ? $"arrived at {_gotoName}" : status;
_enterName = ""; _enterType = "";
HideMarkers(status == "arrived" ? "arrived" : "the goto ended");
@ -957,15 +984,15 @@ public sealed partial class RynthNavPlugin : RynthPluginBase
/// </summary>
private TravelPlan.Result PlanRoute(string name, double goalNs, double goalEw, out List<RecallOption> recalls, bool? portals = null)
{
bool portalsOn = portals ?? _portalsEnabled;
bool portalsOn = portals ?? PortalsRouting; // the switch, or learning portals (RynthNavPlugin.LearnPortals.cs)
double startNs = NavCoords.NsFromWorld(_wy), startEw = NavCoords.EwFromWorld(_wx);
bool startOnMap = IsOnMap(_cellId);
var recallNotes = new List<string>();
recalls = _charKey.Length == 0 ? new List<RecallOption>() : RecallPlanner.Build(_atlas, _known, _memory, _charKey, recallNotes);
recalls = _charKey.Length == 0 ? new List<RecallOption>() : RecallsRouting ? AllRecalls(_atlas, recallNotes) : RecallPlanner.Build(_atlas, _known, _memory, _charKey, recallNotes);
if (_charKey.Length == 0) recallNotes.Add("not logged in yet");
var hubNotes = new List<string>();
HubLinks? hub = portalsOn ? CurrentHubLinks(hubNotes) : null;
if (hub != null && _preferAphus && _recallsEnabled) hub = ViaAphus(hub, recalls, hubNotes);
if (hub != null && _preferAphus && RecallsRouting) hub = ViaAphus(hub, recalls, hubNotes, _baseTownNet?.Arrivals.Count ?? 0);
if (portalsOn) EnsurePortalsLoaded();
// Walks that can't be done over land (another landmass) are left out, so an island or the
// far side of water is only reached by a portal, a recall or the Town Network.
@ -975,10 +1002,15 @@ public sealed partial class RynthNavPlugin : RynthPluginBase
NavGraph.LandblockAt(NavCoords.WorldX(bew), NavCoords.WorldY(bns))) != false;
bool? land = startOnMap && g != null ? g.SameLand(CurrentLandblock, NavGraph.LandblockAt(NavCoords.WorldX(goalEw), NavCoords.WorldY(goalNs))) : null;
TravelPlan.Result r = TravelPlan.Plan(portalsOn ? _portals : null, RecallPlanner.Links(recalls), hub,
portalsOn, _recallsEnabled, startOnMap, startNs, startEw, goalNs, goalEw, canWalk, land, name);
List<PortalLink>? routePortals = portalsOn ? RoutePortals() : null;
// Standing in a dungeon RynthNav learned walks in: the walk from here to each of its portals.
int walkable = 0;
double[]? startWalks = !startOnMap && hub != null ? StartHubWalks(hub, out walkable) : null;
if (startWalks != null) Host.Log($"[RynthNav] plan: in a learned dungeon (0x{CurrentLandblock:X4}): {walkable} of its portal(s) reachable by a learned walk from here");
TravelPlan.Result r = TravelPlan.Plan(routePortals, RecallPlanner.Links(recalls), hub,
portalsOn, RecallsRouting, startOnMap, startNs, startEw, goalNs, goalEw, canWalk, land, name, startWalks);
Host.Log($"[RynthNav] plan {name}: {r.Basis}; {(portalsOn ? $"{_portals?.Count ?? 0} portals" : "no portals")}, "
Host.Log($"[RynthNav] plan {name}: {r.Basis}; {(portalsOn ? $"{routePortals?.Count ?? 0} portals ({(routePortals?.Count ?? 0) - (_portals?.Count ?? 0)} custom for {(_server.Length > 0 ? _server : "?")})" : "no portals")}, "
+ $"{recalls.Count} recall(s) ready" + (recalls.Count > 0 ? " (" + string.Join(", ", recalls.ConvertAll(o => o.Name)) + ")" : "")
+ $", Town Network {(hub == null ? (portalsOn ? "not loaded" : "unused") : $"{hub.Entries.Count} entries / {hub.Exits.Count} exits")}"
+ $", land check {(canWalk == null ? "off (no route graph)" : "on")}"
@ -1017,11 +1049,31 @@ public sealed partial class RynthNavPlugin : RynthPluginBase
var steer = CoarseSteer(sRef, sPt, ref loadedMore);
if (loadedMore) _query = new DtNavMeshQuery(_navMesh!);
// The trip's own path (TripFollow.cs, 2026-11-01): when this step has one, plan a few metres
// along it rather than to the route graph's next crossing, so the walk keeps to the path the
// markers show instead of finding its own way round.
bool onTrip = false;
if (CurrentFollow() is TripFollow follow)
{
var (fx, fy) = follow.Aim(_wx, _wy, out double off, out bool nearEnd);
if (!nearEnd)
{
steer = ((float)fx, (float)_wz, (float)fy);
onTrip = true;
if (off > TripFollow.OffPathUnits && !_offTripSaid)
{
_offTripSaid = true;
Host.Log($"[RynthNav] walk: {off:F0}u off the trip's path at {NavCoords.Fmt(NavCoords.NsFromWorld(_wy), NavCoords.EwFromWorld(_wx))}: heading back to it");
}
else if (off <= TripFollow.OffPathUnits) _offTripSaid = false;
}
}
// Prefer a DIRECT path to the actual target when its tile is loaded — one stable
// corridor we follow steadily. Only fall back to the 500u line-probe leapfrog when
// the target is too far to be loaded yet (that probe jitters and must stay a last resort).
double aimEw = steer?.Ew ?? _gotoTew, aimNs = steer?.Ns ?? _gotoTns;
_aimEw = aimEw; _aimNs = aimNs;
_aimEw = aimEw; _aimNs = aimNs; _aimOnTrip = onTrip;
// The route's last stretch ends on the ground its search ended on: the spot itself, or the
// nearest ground a walk can end on when the spot is fenced in (NavCoarse.ProbeReachable).
// Planned to the spot itself, the nearest polygon is the fenced-in one again.
@ -1034,7 +1086,7 @@ public sealed partial class RynthNavPlugin : RynthPluginBase
// (AllowB below). Through the avoid filter, a big open-ground polygon that also reaches
// another portal's circle hid the goal: 10-02 16:05, Lucy at the Lady Maila Estates Portal
// in a cluster of housing portals: "no tile ahead", 74u short, on the collision-built tiles.
_query.FindNearestPoly(targetP, steer != null ? new RcVec3f(8, 32, 8) : new RcVec3f(12, 256, 12), filter, out long gRef, out RcVec3f gPt, out _);
_query.FindNearestPoly(targetP, steer != null ? new RcVec3f(8, onTrip ? 64 : 32, 8) : new RcVec3f(12, 256, 12), filter, out long gRef, out RcVec3f gPt, out _);
bool direct = gRef != 0 && steer == null;
if (gRef == 0) gRef = FindGoalToward(aimEw, aimNs, out gPt);
if (gRef == 0) { lock (_gate) _status = "no tile ahead — bake the route"; lock (_gotoGate) _gotoPath = null; return; }