Enhance Rs2Walker route handling, gate traversal, and recovery logic#1817
Enhance Rs2Walker route handling, gate traversal, and recovery logic#1817infuse21 wants to merge 9 commits into
Conversation
…terim recovery This PR hardens Rs2Walker against several movement stalls and route-object edge cases found during live walking tests. Changes • Improved small gate / door detection on raw path segments. • Added generic detection for diagonal gate crossings, including corner cases where the smoothed path crosses a gate edge diagonally. • Prevented door-like catalog transports, such as Open Gate, from being incorrectly treated as generic transports. • Added pending door/gate scans before direct minimap clicks, route checkpoint clicks, interim movement waits, and unreachable recovery. • Expanded raw-path door scanning to include nearby previous raw edges when the player starts slightly off-path near a gate. • Added range gating before interacting with future door/gate objects so the walker does not mark a far-away gate as handled. • Fixed false “gate opened” handling where the walker clicked near a gate, failed to open it, but still treated it as successful. • Reworked post-door edge nudging so it only counts as successful if the player actually reaches or crosses the target door edge. • Added unresolved nudge logging with door_edge_nudge_unresolved. • Improved doorStillHasAction to rescan nearby/segment objects instead of relying only on the exact probe tile. • Added stale sticky interim cleanup: ◦ clears interim checkpoint when the player is already close enough ◦ clears expired interim checkpoints ◦ clears invalid interim checkpoints ◦ clears interim state on stall recalculation • Added interim_clear diagnostic logging. • Documented movement gotchas for gate edge handling and sticky interim cleanup in docs/entity-guides/movement.md. • Added unit tests for: ◦ diagonal gate segment detection ◦ wrong-neighbor door-edge nudge rejection ◦ successful door-edge nudge resolution ◦ stale interim checkpoint cleanup currently Testing for regression
This PR adjusts Rs2Walker unreachable-tile recovery so it behaves better around tight door clusters. Changes: • Suppresses broad optimistic minimap recovery when an unresolved door-like object is still present on the nearby raw route. • Adds a raw-path door scan before unreachable recovery clicks, using a small backtrack/lookahead window. • Logs door_recovery_suppressed when recovery is skipped because a nearby route door should be retried instead. • Stops session-blacklisting path-adjacent fallback doors after one wrong-way traversal. • Still keeps normal segment-door blacklisting behavior intact.
mproves Rs2Walker behavior on long routes and tight/shortcut-heavy paths. Changes include: • Clear interim targets earlier when route progress goes stale, reducing visible stop/start pauses. • Issue immediate route-aligned continuation clicks when an interim target is reached, without consuming tail-loop budget. • Keep outside-minimap fallback clicks constrained to the raw path instead of choosing generic reachable tiles off-route. • Reduce interim pre-click distance to limit rapid re-clicking while still keeping movement flowing. • Detect failed adjacent same-plane shortcut landings faster, including stepping-stone style failures where the player settles on the wrong tile. • Add unit coverage for stale interim progress clearing. • Document movement gotchas for route fallback, stale interim targets, tail-exempt continuation clicks, and adjacent shortcut failures.
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR extends Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.java (1)
4438-4479: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winResolve impostors when checking whether the door action still exists.
Line 4477 uses the base composition, while the door probe path uses
resolveCompositionForDoorProbe(...). For impostor-backed doors, this can read stale actions after interaction and incorrectly skipmarkStationaryDoorOpened(...)/ edge nudging.Proposed fix
- ObjectComposition composition = Rs2GameObject.convertToObjectComposition(object); + ObjectComposition composition = resolveCompositionForDoorProbe(object);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.java` around lines 4438 - 4479, The door-action validation in doorStillHasAction()/doorObjectStillHasAction() is using the base ObjectComposition, which can miss impostor-backed state changes after interaction. Update the composition lookup to resolve the door via resolveCompositionForDoorProbe(...) before calling getDoorAction(...), so checks against action freshness use the same impostor-aware path as the probe logic and don’t incorrectly suppress markStationaryDoorOpened(...) or edge nudging.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.java`:
- Around line 1248-1252: The active route idle nudge path in Rs2Walker is
resetting the stall clock even when the click does not cause movement, which can
delay the stall recovery logic. Update the handling around
shouldIssueActiveRouteIdleNudge(), tryIssueRouteRecoveryClick(), and the
lastMovedTimeMs update so that “active route idle nudge” clicks do not count as
movement unless actual position progress is detected, and keep the
isStuckTooLong() stall check able to run/recalculate promptly.
- Around line 2621-2635: Guard rawPath before using it in
tryIssueRouteContinuationClick: the current getClosestTileIndex(rawPath) call
can run when rawPath is null. Update the early return check in this method so it
also skips the raw-path lookup when rawPath is absent, while still allowing the
rest of the route-continuation logic to proceed. Keep the door-recovery check in
tryIssueRouteContinuationClick aligned with the existing “no raw path” behavior
and avoid forcing a failure path through the catch block.
- Around line 4986-4995: The door-action whitelist in isDoorLikeTransportAction
is missing several traversal actions already recognized by DOOR_ACTION_PRIORITY,
causing some catalog-backed door/gate rows to be misclassified. Update the
action check in Rs2Walker so it stays aligned with the priority list by
including the same door-traversal verbs (such as pay-toll, pick-lock,
climb-over, squeeze-through, and other matching variants) alongside the existing
open/pass/go-through/walk-through prefixes.
---
Outside diff comments:
In
`@runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.java`:
- Around line 4438-4479: The door-action validation in
doorStillHasAction()/doorObjectStillHasAction() is using the base
ObjectComposition, which can miss impostor-backed state changes after
interaction. Update the composition lookup to resolve the door via
resolveCompositionForDoorProbe(...) before calling getDoorAction(...), so checks
against action freshness use the same impostor-aware path as the probe logic and
don’t incorrectly suppress markStationaryDoorOpened(...) or edge nudging.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 3e3ba561-fd07-48e6-a3e7-ee3be18468c7
📒 Files selected for processing (4)
docs/entity-guides/movement.mdrunelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.javarunelite-client/src/test/java/net/runelite/client/plugins/microbot/util/walker/Rs2WalkerUnitTest.javarunelite-client/src/test/resources/threadsafety/client-thread-guardrail-baseline.txt
his PR addresses review findings in Rs2Walker with minimal scoped changes. Changes: • Prevent active route idle nudges from resetting lastMovedTimeMs, so failed nudge clicks do not delay stall recalculation. • Guard rawPath before raw-path door scanning in route continuation clicks. • Use impostor-aware door composition resolution when checking whether a door action is still present after interaction. • Align catalog-backed door transport action detection with DOOR_ACTION_PRIORITY, covering traversal actions like pay-toll, pick-lock, climb-over, squeeze-through, cross, and force.
Increased interim pre-click range when run is enabled so the walker queues the next movement earlier. • Added route-progress stabilization to prevent folded/switchback paths, such as White Wolf Mountain, from snapping back to an earlier nearby path branch. • Capped post-transport door scan timing so failed door probes do not consume long waits before movement resumes. • Added walker unit coverage for the switchback/backtracking regression.
Reduced long-route stalls by clearing interim targets when route progress goes stale.
•
Added immediate route-aligned continuation clicks after interim targets clear, so the walker keeps moving instead of waiting for idle recovery.
•
Made continuation clicks tail-exempt to avoid long routes hitting MAX_PROCESS_WALK_TAIL_ITERATIONS while still progressing.
•
Tightened interim pre-click distance to reduce rapid repeated clicking.
•
Changed minimap fallback behavior so outside-clip route clicks stay on the raw path instead of picking arbitrary reachable tiles away from the route.
•
Improved tight-room/door recovery by suppressing broad optimistic recovery when unresolved route doors are still nearby.
•
Avoided blacklisting fallback doors after wrong-way traversal, since the same door can become valid again after player movement.
•
Added faster failed-landing detection for adjacent same-plane shortcuts, including stepping stones that fail and move the player to the wrong tile.
•
Removed a new client-thread guardrail violation in the shortcut landing helper.
•
Regenerated the client-thread guardrail baseline after Rs2Walker lambda-name drift.
•
Added unit coverage for stale interim-target clearing.
•
Updated movement entity docs with the new walker gotchas and recovery
so far no issues