6.6 KiB
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
ClassAIimplementations 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, redundantClassAIfiles.
1.2. Lifecycle Management (High Criticality)
- Finding:
BotLifecycleManager.handBotLifecycleMgr.hare two different and redundant implementations of the same concept.BotLifecycleMgrappears to be the one in use, whileBotLifecycleManageris 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 theBotLifecycleMgr(scheduling, throttling, etc.).
1.3. Social/Loot Management (High Criticality)
- Finding:
LootDistribution.handUnifiedLootManager.hare redundant. TheUnifiedLootManageris an incomplete facade that adds an unnecessary layer of abstraction over theLootDistributionclass. - Recommendation: Remove the
UnifiedLootManager. TheLootDistributionclass should be used directly.
1.4. Social/Trade Management (High Criticality)
- Finding:
TradeManager.handTradeSystem.hare redundant. TheTradeManageris a high-level manager that decides when to trade, while theTradeSystemis a low-level system for handling the mechanics of a trade. They are implemented as two separate, and largely redundant, classes. - Recommendation: Merge the
TradeManagerandTradeSysteminto 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.cppprovides alternative, lock-free implementations of some of theGatheringManager's methods. However, these methods are not integrated into theGatheringManagerclass. - Recommendation: Integrate the lock-free methods in
GatheringManager_LockFree.cppinto theGatheringManagerclass and remove the old, lock-based methods.
2. Incomplete Features
2.1. PvP AI (High Criticality)
- Finding: The
BattlegroundAIandArenaAIare not functional. The core logic is missing, and the files are mostly skeletons. - Recommendation: Complete the implementation of the
BattlegroundAIandArenaAI. 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 thatVendorDatabaseandTrainerDatabaseare not yet implemented. - Recommendation: Complete the implementation of the "smart" automation features. This will likely require implementing the
VendorDatabaseandTrainerDatabaseclasses 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
Professionssubdirectory 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
ClassAIimplementations are incomplete placeholders. There are also likely other areas of the codebase with insufficient test coverage. - Recommendation: Complete the implementation of the
ClassAItests. 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.