Crow b31bda85ee Refactor raid strategy framework (#2069)
# Pull Request

The purposes of this PR are to (1) establish a general raid helper
framework for the benefit of future raid strategies and (2) make some
improvements to problematic areas of the raid strategy code.

List of changes:
1. Added new RaidBossHelpers.cpp and RaidBossHelpers.h files in the Raid
folder.

3. Moved reused helpers from Karazhan, Gruul, and Magtheridon strategies
to the new helper files.
4. Modified the prior function that assigned a DPS bot to store and
erase timers and trackers in associative containers--the function now
includes parameters for mapId (so a bot that is not in the instance will
not be assigned) and for the ability to exclude a bot (useful for
excluding particular important roles, such as a Warlock tank, so they
are not bogged down by these extra tasks at critical moments). I also
renamed it from IsInstanceTimerManager to IsMechanicTrackerBot.
5. Moved all helper files in raid strategies to Util folders (was needed
for ICC, MC, and Ulduar).
6. Renamed and reordered includes of Ulduar files in AiObjectContext.cpp
to match other raid strategies.
a. This initially caused compile errors which made me realize that the
existing code had several problems with missing includes and was
compiling only due to the prior ordering in AiObjectContext.cpp.
Therefore, I added the missing includes to Molten Core, Ulduar, and
Vault of Archavon strategies.
b. Ulduar and Old Kingdom were also using the same constant name for a
spell--the reordering caused a compile error here as well, which just
highlighted an existing problem that was being hidden. I renamed the
constant for Ulduar to fix this, but I think the better approach going
forward would be to use a namespace or enum class. But that is for
another time and probably another person.
7. Several changes with respect to Ulduar files:
a. The position constants and enums for spells and NPCs and such were in
the trigger header file. I did not think that made sense so moved them
to existing helper files.
b. Since the strategy does not use multipliers, I removed all files and
references to multipliers in it.
c. I removed some unneeded includes. I did not do a detailed review to
determine what else could be removed--I just took some out that I could
tell right away were not needed.
d. I renamed the ingame strategy name from "uld" to "ulduar," which I
think is clearer and is still plenty short.
8. Partial refactor of Gruul and Magtheridon strategies:
a. I did not due a full refactoring but made some quick changes to
things I did previously that were rather stupid like repeating
calculations, having useless logic like pointless IsAlive() checks for
creatures already on the hostile references list, and not using the
existing Position class for coordinates.
b. There were a few substantive changes, such as allowing players to
pick Maulgar mage and moonkin tanks with the assistant flag, but a
greater refactoring of the strategies themselves is beyond this PR.
c. I was clearing some containers used for Gruul and Magtheridon
strategies; the methods are now fixed to erase only the applicable keys
so that in the unlikely event that one server has multiple groups
running Gruul or Magtheridon at the same time, there won't be timer or
position tracker conflicts.

## How to Test the Changes

1. Enter any raid instance that has any code impacted by this PR
2. Engage bosses and observe if any strategies are now broken

I personally tested Maulgar, Gruul, and Magtheridon and confirmed that
they still work as intended.

## Complexity & Impact

I do not expect this PR to have any relevant changes to in-game
performance, but I will defer to those more knowledgeable than I if
there are concerns in this area. As I've mentioned before, you can
consider me to be like a person who has taken half an intro C++ course
at best.

## AI Assistance

None beyond autocomplete of repetitive changes.

---------

Co-authored-by: bashermens <31279994+hermensbas@users.noreply.github.com>
2026-02-06 11:55:43 -08:00
2025-11-05 21:10:17 +01:00
2026-02-06 11:55:28 -08:00
2021-12-30 17:13:09 +01:00
2021-12-30 17:13:09 +01:00
2025-11-05 21:10:17 +01:00
2022-03-12 22:27:09 +01:00
2024-03-05 11:06:57 +08:00
2024-04-08 21:38:36 +08:00
2025-11-18 18:08:16 +01:00

English | 中文 | Español

Playerbots Icon

Playerbots Module

mod-playerbots is an AzerothCore module that adds player-like bots to a server. The project is based off IKE3's Playerbots.

Features include:

  • The ability to log in alt characters as bots, allowing players to interact with their other characters, form parties, level up, and more
  • Random bots that wander through the world, complete quests, and otherwise behave like players, simulating the MMO experience
  • Bots capable of running most raids and battlegrounds
  • Highly configurable settings to define how bots behave
  • Excellent performance, even when running thousands of bots

We also have a Discord server where you can discuss the project, ask questions, and get involved in the community!

Installation

Supported platforms are Ubuntu, Windows, and macOS. Other Linux distributions may work, but may not receive support.

All mod-playerbots installations require a custom branch of AzerothCore: mod-playerbots/azerothcore-wotlk/tree/Playerbot. This branch allows the mod-playerbots module to build and function. Updates from the upstream are implemented regularly to this branch. Instructions for installing this required branch and this module are provided below.

Cloning the Repositories

To install both the required branch of AzerothCore and the mod-playerbots module from source, run the following:

git clone https://github.com/mod-playerbots/azerothcore-wotlk.git --branch=Playerbot
cd azerothcore-wotlk/modules
git clone https://github.com/mod-playerbots/mod-playerbots.git --branch=master

For more information, refer to the AzerothCore Installation Guide and Installing a Module pages.

Docker Installation

Docker installations are considered experimental (unofficial with limited support), and previous Docker experience is recommended. To install mod-playerbots on Docker, first clone the required branch of AzerothCore and this module:

git clone https://github.com/mod-playerbots/azerothcore-wotlk.git --branch=Playerbot
cd azerothcore-wotlk/modules
git clone https://github.com/mod-playerbots/mod-playerbots.git --branch=master

Afterwards, create a docker-compose.override.yml file in the azerothcore-wotlk directory. This override file allows for mounting the modules directory to the ac-worldserver service which is required for it to run. Put the following inside and save:

services:
  ac-worldserver:
    volumes:
      - ./modules:/azerothcore/modules:ro

Additionally, this override file can be used to set custom configuration settings for ac-worldserver and any modules you install as environment variables:

services:
  ac-worldserver:
    environment:
      AC_RATE_XP_KILL: "1"
      AC_AI_PLAYERBOT_RANDOM_BOT_AUTOLOGIN: "1"
    volumes:
      - ./modules:/azerothcore/modules:ro

For example, to double the experience gain rate per kill, take the setting Rate.XP.Kill = 1 from woldserver.conf, convert it to an environment variable, and change it to the desired setting in the override file to get AC_RATE_XP_KILL: "2". If you wanted to disable random bots from logging in automatically, take the AiPlayerbot.RandomBotAutologin = 1 setting from playerbots.conf and do the same to get AC_AI_PLAYERBOT_RANDOM_BOT_AUTOLOGIN: "0". For more information on how to configure Azerothcore, Playerbots, and other module settings as environment variables in Docker Compose, see the "Configuring AzerothCore in Containers" section in the Install With Docker guide.

Before building, consider setting the database password. One way to do this is to create a .env file in the root azerothcore-wotlk directory using the template. This file also allows you to set the user and group Docker uses for the services in case you run into any permissions issues, which are the most common cause for Docker installation problems.

Use docker compose up -d --build to build and run the server. For more information, including how to create an account and taking backups, refer to the Install With Docker page.

Documentation

The Playerbots Wiki contains an extensive overview of AddOns, commands, raids with programmed bot strategies, and recommended performance configurations. Please note that documentation may be incomplete or out-of-date in some sections, and contributions are welcome.

Bots are controlled via chat commands. For larger bot groups, this can be cumbersome. Because of this, community members have developed client AddOns to allow controlling bots through the in-game UI. We recommend you check out their projects listed in the AddOns and Submodules page.

Contributing

This project is still under development. We encourage anyone to make contributions, anything from pull requests to reporting issues. If you encounter any errors or experience crashes, we encourage you report them as GitHub issues. Your valuable feedback will help us improve this project collaboratively.

If you make coding contributions, mod-playerbots complies with the C++ Code Standards established by AzerothCore. Each Pull Request must include all test scenarios the author performed, along with their results, to demonstrate that the changes were properly verified.

We recommend joining the Discord server to make your contributions to the project easier, as a lot of active support is carried out through this server.

Please click on the "" button to stay up to date and help us gain more visibility on GitHub!

Acknowledgements

mod-playerbots is based on ZhengPeiRu21/mod-playerbots and celguar/mangosbot-bots. We extend our gratitude to @ZhengPeiRu21 and @celguar for their continued efforts in maintaining the module.

Also, a thank you to the many contributors who've helped build this project:

Languages
C++ 99.7%
Python 0.2%