Files
ThordekkCore/playerbot_audit_report.md
T
2026-01-20 21:33:16 -03:00

6.6 KiB

Playerbot Module Audit Report

This report provides a comprehensive audit of the Playerbot module codebase. It includes findings on functional redundancies, architectural issues, and recommendations for enhancements, refactoring, and new features.

1. Functional Redundancies and Architectural Issues

1.1. AI/ClassAI System (High Criticality)

  • Finding: Massive code duplication exists between ClassAI implementations for different classes and specializations. The presence of legacy files (ClassAI_Legacy.h, .cpp.orig) indicates a history of incomplete refactoring. A new template-based architecture is being developed (ArmsWarriorRefactored.h) but is not consistently used.
  • Recommendation: Complete the migration to the new template-based architecture for all classes and specializations. Create a set of base templates (e.g., MeleeDpsSpecialization, RangedDpsSpecialization, HealerSpecialization, TankSpecialization) and resource templates (e.g., RageResource, ManaResource, EnergyResource). Once the migration is complete, remove the old, redundant ClassAI files.

1.2. Lifecycle Management (High Criticality)

  • Finding: BotLifecycleManager.h and BotLifecycleMgr.h are two different and redundant implementations of the same concept. BotLifecycleMgr appears to be the one in use, while BotLifecycleManager is a newer but incomplete replacement.
  • Recommendation: Merge the two lifecycle management systems into a single, cohesive system. The new system should be based on the more modular design of the BotLifecycleManager, but it should also incorporate the powerful features of the BotLifecycleMgr (scheduling, throttling, etc.).

1.3. Social/Loot Management (High Criticality)

  • Finding: LootDistribution.h and UnifiedLootManager.h are redundant. The UnifiedLootManager is an incomplete facade that adds an unnecessary layer of abstraction over the LootDistribution class.
  • Recommendation: Remove the UnifiedLootManager. The LootDistribution class should be used directly.

1.4. Social/Trade Management (High Criticality)

  • Finding: TradeManager.h and TradeSystem.h are redundant. The TradeManager is a high-level manager that decides when to trade, while the TradeSystem is a low-level system for handling the mechanics of a trade. They are implemented as two separate, and largely redundant, classes.
  • Recommendation: Merge the TradeManager and TradeSystem into a single, cohesive system. The new system should be the single point of control for all trading-related activities.

1.5. Professions/Gathering Management (High Criticality)

  • Finding: GatheringManager_LockFree.cpp provides alternative, lock-free implementations of some of the GatheringManager's methods. However, these methods are not integrated into the GatheringManager class.
  • Recommendation: Integrate the lock-free methods in GatheringManager_LockFree.cpp into the GatheringManager class and remove the old, lock-based methods.

2. Incomplete Features

2.1. PvP AI (High Criticality)

  • Finding: The BattlegroundAI and ArenaAI are not functional. The core logic is missing, and the files are mostly skeletons.
  • Recommendation: Complete the implementation of the BattlegroundAI and ArenaAI. This will require adding the logic for moving to objectives, interacting with flags, coordinating with teammates, and executing the various strategies.

2.2. "Smart" Automation Features (Medium Criticality)

  • Finding: The "smart" automation features in the InteractionManager (SmartSell, SmartRepair, etc.) are incomplete. The comments mention that VendorDatabase and TrainerDatabase are not yet implemented.
  • Recommendation: Complete the implementation of the "smart" automation features. This will likely require implementing the VendorDatabase and TrainerDatabase classes to provide the bots with the information they need to make smart decisions.

2.3. Auction House Integration (Medium Criticality)

  • Finding: The "bridge" files in the Professions subdirectory suggest that the integration with the auction house is not yet complete.
  • Recommendation: The "bridge" files should be fully implemented to allow bots to buy materials and sell crafted items on the auction house.

3. Testing

3.1. Incomplete Test Coverage (High Criticality)

  • Finding: The tests for the ClassAI implementations are incomplete placeholders. There are also likely other areas of the codebase with insufficient test coverage.
  • Recommendation: Complete the implementation of the ClassAI tests. Conduct a full test coverage analysis to identify other areas that need more tests.

3.2. Lack of End-to-End Tests (Low Criticality)

  • Finding: The current test suite is focused on unit and integration tests. There are no end-to-end tests that simulate a bot playing through a complete scenario.
  • Recommendation: Add a suite of end-to-end tests that simulate a bot playing through various scenarios, such as completing a quest line, running a dungeon, or playing a battleground from start to finish.

4. New Feature Recommendations

4.1. AI (Artificial Intelligence)

  • Learning System for AI (High Criticality): Implement a simple learning system that records the outcomes of combat encounters and uses that data to adjust the bots' behavior.
  • More "Human-Like" Movement and Behavior (Medium Criticality): Add more "human-like" behaviors to the movement system, such as jumping, hesitation, and "AFK" behavior.
  • More Sophisticated Crowd Control Usage (Medium Criticality): Enhance the CC AI to be more sophisticated, with features like coordinated CC, peeling for teammates, and avoiding breaking CC.

4.2. Social

  • Guild Progression System (Medium Criticality): Implement a guild progression system that allows bots to participate more fully in guilds.
  • Friendship and Rivalry System (Low Criticality): Implement a system that allows bots to form relationships with other players.

4.3. Professions

  • More Sophisticated Crafting and Gathering Logic (Medium Criticality): Enhance the crafting and gathering logic to be more "economically-minded".

4.4. PvP

  • Support for More Battlegrounds and Arenas (Medium Criticality): Add support for all battlegrounds and arenas.
  • Better Objective-Based Play in Battlegrounds (Medium Criticality): Enhance the objective-based play to be more sophisticated.

4.5. Miscellaneous

  • Continuous Integration/Continuous Deployment (CI/CD) Pipeline (High Criticality): Implement a CI/CD pipeline to automate the build, test, and deployment process.