Repository navigation
Conversation
Random bots can remain in taxi state when movement splines stop making progress. Centralize taxi handling in PlayerbotAI, track route and position progress, relaunch a stalled spline once, and safely finish at the validated final destination when recovery cannot resume. Closes mod-playerbots#2863
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 📝 WalkthroughWalkthroughThe RPG flight action now sets in-flight state after taxi activation and no longer continues cross-map travel through its removed helper. PlayerbotAI tracks taxi progress and handles stalled flights by restarting eligible movement or clearing flight state and taxi cleanup flags. Priority: ⬆️ High Severity of issue fixed: High Merge Risk: 🟡 Moderate · up to Bots whose taxi splines stall may keep restarting instead of being cleaned up, which could leave them stuck in flight. The 15-second cleanup is meant to prevent this. Confirm or fix how restart attempts are counted before merging. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Recovery now affects all eligible bots in taxi flight and can restart movement or relocate a stalled bot. Destination checks constrain this behavior, but interrupted recovery and cleanup have not been fully verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
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: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: mod-playerbots/mod-playerbots/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID: 78379c90-85ba-4e6c-8af4-535b11129af5
📒 Files selected for processing (4)
src/Ai/World/Rpg/Action/NewRpgAction.cppsrc/Ai/World/Rpg/Action/NewRpgAction.hsrc/Bot/PlayerbotAI.cppsrc/Bot/PlayerbotAI.h
💤 Files with no reviewable changes (1)
- src/Ai/World/Rpg/Action/NewRpgAction.h
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
| if (!CanUpdateAI()) | ||
| return; | ||
|
|
||
| if (HandleTaxiFlight()) |
There was a problem hiding this comment.
This pauses the whole bot AI for every bot in flight, not only stalled ones. HandleTaxiFlight() returns true on every path once the bot is in flight, so UpdateAI() returns here until the bot lands. Chat commands, packet handlers and the strategy engine all wait. That includes altbots, so healthy flights don't keep their existing behavior.
I ran this on a test server with an altbot flying Stormwind to Booty Bay (about 3 minutes). On test-staging, who whispered mid-flight was answered at once, and summon pulled the bot off the gryphon. With this PR, both only ran after the bot landed.
The pause may be what you want: no engine action can touch the taxi spline mid-flight, and that's where #2863 is now looking. If so, please say it in the description, since it changes every bot. If not, return false from HandleTaxiFlight() when the progress check passes, so only stalled flights skip the rest of the update. The engine then runs in flight again, though, so an action that stops the spline goes through the restart path instead of being prevented.
Pull Request Description
Fixes random bots becoming permanently stuck in taxi state when their flight movement spline stops progressing.
Taxi recovery is moved into
PlayerbotAI, where it runs consistently for every bot currently marked as in flight instead of depending on the New RPG travel action being selected.The watchdog:
Healthy taxi flights retain their existing behavior.
Closes #2863
Feature Evaluation
Describe the minimum logic required to achieve the intended behavior.
A small per-bot watchdog records the most recent taxi progress indicators. Recovery is attempted only when the bot is currently in flight and the spline has stopped progressing. It first attempts to resume the existing route, then uses a bounded cleanup fallback.
Describe the processing cost when this logic executes across many bots.
All bots perform a cheap
IsInFlight()check during their normal AI update. Bots that are not flying immediately bypass the remaining logic. Flying bots perform a small number of integer comparisons and a squared-distance calculation. There are no database queries, path searches, or unbounded loops. Recovery and destination lookups occur only while handling a taxi flight.How to Test the Changes
playerbotslog messages for cross-map continuation, restart attempts, and fallback cleanup.The change was exercised on a live local realm during two approximately 24-hour soak test. Follow-up checks did not find bots remaining indefinitely stuck in taxi state.
Impact Assessment
Does this change increase per-bot/per-tick processing or risk scaling poorly with thousands of bots?
The normal per-bot cost is an
IsInFlight()check. Additional progress comparisons run only for bots actively using a taxi. The watchdog has a fixed amount of state and all recovery attempts are bounded.Does this change modify default bot behavior?
It changes failure handling for bots whose taxi movement stops progressing. Normal, progressing taxi flights are not intentionally changed.
Does this change add new decision branches or increase maintenance complexity?
It adds a contained taxi-recovery state machine to
PlayerbotAI. The additional branches distinguish healthy progress, cross-map continuation, one restart attempt, and final cleanup. Recovery is bounded to keep its behavior predictable.AI Assistance
Was AI assistance used while working on this change?
I used GPT-5.6 Sol High to assist in investigating the flight failures and architecting a solution for flight recovery. I also utilized it's assistance in implementation, monitoring bot health after the changes over two 24 hour peroids, and making sure I had everything lined up to try to contribute back in the least headache inducing way possible for the team.
Code Provenance / Attribution
Was any code in this PR copied or adapted from a sister / upstream project (e.g. CMaNGOS playerbots, MaNGOS, another module)?
Final Checklist
Notes for Reviewers
PlayerbotAI::UpdateAIthe appropriate centralized location for taxi recovery?