How rychek4/playerbots works
Playerbots is a CMaNGOS module that creates and operates autonomous player characters, including random world/BG populations and alts directed by player commands. The main behavior loop turns events and strategies into prioritized actions, which act in the game world; specialized systems cover combat, travel, PvE, and item behavior. Separate branches manage bot population and auction-house behavior, while a JSON bridge and LLM interface represent integrations. The README documents major capabilities; unsampled subsystem wiring is represented cautiously rather than as a detailed call graph.
Main entry points: actions Game actions · PlayerbotAI.cpp Playerbot AI · Engine.cpp Strategy engine · RandomPlayerbotMgr.cpp Random bot manager
Components 20
Bot control
- Bot manager
playerbot/PlayerbotMgr.cpp - Playerbot AI
playerbot/PlayerbotAI.cpp - Bot login
playerbot/PlayerbotLoginMgr.cpp - Chat commands
playerbot/strategy/generic/ChatCommandHandlerStrategy.cpp
AI behavior
- Strategy engine
playerbot/strategy/Engine.cpp - Reaction engine
playerbot/strategy/ReactionEngine.cpp - Strategies
playerbot/strategy/Strategy.cpp - Game actions
playerbot/strategy/actions - Class strategies
playerbot/strategy
Game activity
- Travel and maps
playerbot/TravelMgr.cpp - Combat movement
playerbot/FleeManager.cpp - Auction-house bot
ahbot/AhBot.cpp
Bot population
- Random bot manager
playerbot/RandomPlayerbotMgr.cpp - Character factory
playerbot/RandomPlayerbotFactory.cpp - Bot database access
playerbot/PlayerbotDbStore.cpp
External interfaces
- JSON bridge
playerbot/bridge/BridgeServer.cpp - LLM interface
playerbot/PlayerbotLLMInterface.cpp
Other components
- Player / master
- CMaNGOS world
- Bridge client
Connections 20
- Player / master → Chat commands: sends commands
- Chat commands → Strategy engine: queues actions
- Bot manager → Playerbot AI: manages bots
- Bot manager → Bot login: requests login
- Playerbot AI → Strategy engine: runs decisions
- Strategy engine → Strategies: evaluates strategies
- Strategy engine → Game actions: dispatches actions
- Reaction engine → Game actions: executes reactions
- Class strategies → Strategies: provides behavior
- Game actions → CMaNGOS world: acts in world
- Travel and maps → Game actions: supports navigation
- Combat movement → Game actions: selects destinations
- Random bot manager → Character factory: generates bots
- Random bot manager → Bot database access: loads bot data
- Character factory → Bot database access: stores bot data
- Random bot manager → CMaNGOS world: populates world
- Auction-house bot → CMaNGOS world: trades items
- Bridge client → JSON bridge: sends JSON
- JSON bridge → Playerbot AI: forwards commands
- Playerbot AI → LLM interface: requests responses