mod-playerbots/src/Ai/Raid/ZulAman/Action/RaidZulAmanActions.h
Crow 91eac70ca2
Implement Zul'Aman Strategies (#2186)
# Pull Request

_Implement strategies for all bosses in Zul'Aman. See next post for
overview of implemented strategies._

---

## Design Philosophy

We prioritize **stability, performance, and predictability** over
behavioral realism.
Complex player-mimicking logic is intentionally limited due to its
negative impact on scalability, maintainability, and
long-term robustness.

Excessive processing overhead can lead to server hiccups, increased CPU
usage, and degraded performance for all
participants. Because every action and
decision tree is executed **per bot and per trigger**, even small
increases in logic complexity can scale poorly and
negatively affect both players and
world (random) bots. Bots are not expected to behave perfectly, and
perfect simulation of human decision-making is not a
project goal. Increased behavioral
realism often introduces disproportionate cost, reduced predictability,
and significantly higher maintenance overhead.

Every additional branch of logic increases long-term responsibility. All
decision paths must be tested, validated, and
maintained continuously as the system evolves.
If advanced or AI-intensive behavior is introduced, the **default
configuration must remain the lightweight decision
model**. More complex behavior should only be
available as an **explicit opt-in option**, clearly documented as having
a measurable performance cost.

Principles:

- **Stability before intelligence**  
  A stable system is always preferred over a smarter one.

- **Performance is a shared resource**  
  Any increase in bot cost affects all players and all bots.

- **Simple logic scales better than smart logic**  
Predictable behavior under load is more valuable than perfect decisions.

- **Complexity must justify itself**  
  If a feature cannot clearly explain its cost, it should not exist.

- **Defaults must be cheap**  
  Expensive behavior must always be optional and clearly communicated.

- **Bots should look reasonable, not perfect**  
  The goal is believable behavior, not human simulation.

Before submitting, confirm that this change aligns with those
principles.

---

## Feature Evaluation

Please answer the following:

- Describe the **minimum logic** required to achieve the intended
behavior?
- Describe the **cheapest implementation** that produces an acceptable
result?
- Describe the **runtime cost** when this logic executes across many
bots?

_I have attempted to order checks while taking into account cost and
likelihood and have opted to find lower-cost methods where possible. I
have also not gone as in depth as I have with other strategies,
partially because it is not necessary to complete encounters but also to
try to limit the performance impact. From my observation, including with
pmon, none of the methods should be overly taxing._

---

## How to Test the Changes

- Step-by-step instructions to test the change
- Any required setup (e.g. multiple players, bots, specific
configuration)
- Expected behavior and how to verify it

_Run Zul'Aman. See next post for strategies to test._

## Complexity & Impact

Does this change add new decision branches?
- - [ ] No
- - [x] Yes (**explain below**)

_Only in the context of raid strategies, with new methods to consider
and new multipliers to evaluate when bots perform actions with the
instance strategy active._

Does this change increase per-bot or per-tick processing?
- - [ ] No
- - [x] Yes (**describe and justify impact**)

_The impact is only with the "zulaman" strategy active, which will be
applied only in the instance. There is currently a PR open to also
remove instance strategies when leaving the map to get rid of the
residual performance impact._

Could this logic scale poorly under load?
- - [ ] No
- - [x] Yes (**explain why**)

_Technically yes, but I think it is unlikely to have an appreciable
difference unless there are many groups running the instance at the same
time on a large server._

## Defaults & Configuration

Does this change modify default bot behavior?
- - [ ] No
- - [x] Yes (**explain why**)

_Only in the instance. It is a necessary trade-off to consider with raid
strategies that I always keep in mind (degree of automation vs. player
choice)._

If this introduces more advanced or AI-heavy logic:
- - [x] Lightweight mode remains the default
- - [ ] More complex behavior is optional and thereby configurable

_Not exactly sure how to address this question in the context of this
PR, but there aren't any techniques or methods for this strategy that I
have not tried before (or something very similar)._

## AI Assistance

Was AI assistance (e.g. ChatGPT or similar tools) used while working on
this change?
- - [ ] No
- - [x] Yes (**explain below**)

If yes, please specify:

- AI tool or model used (e.g. ChatGPT, GPT-4, Claude, etc.)
- Purpose of usage (e.g. brainstorming, refactoring, documentation, code
generation)
- Which parts of the change were influenced or generated
- Whether the result was manually reviewed and adapted

_Gemini and GPT for some questions about the codebase and C++ and
assistance with drafting a few things like containers that I find more
tedious to do myself._

AI assistance is allowed, but all submitted code must be fully
understood, reviewed, and owned by the contributor.
Any AI-influenced changes must be verified against existing CORE and PB
logic. We expect contributors to be honest
about what they do and do not understand.

---

## Final Checklist

- - [x] Stability is not compromised
- - [x] Performance impact is understood, tested, and acceptable
- - [x] Added logic complexity is justified and explained
- - [x] Documentation updated if needed

---

## Notes for Reviewers

Anything that significantly improves realism at the cost of stability or
performance should be carefully discussed
before merging.

---------

Co-authored-by: Keleborn <22352763+Celandriel@users.noreply.github.com>
Co-authored-by: bash <hermensb@gmail.com>
Co-authored-by: Revision <tkn963@gmail.com>
Co-authored-by: kadeshar <kadeshar@gmail.com>
2026-03-27 10:38:12 -07:00

254 lines
8.2 KiB
C++

/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_RAIDZULAMANACTIONS_H
#define _PLAYERBOT_RAIDZULAMANACTIONS_H
#include "Action.h"
#include "AttackAction.h"
#include "MovementActions.h"
// Trash
class AmanishiMedicineManMarkWardAction : public Action
{
public:
AmanishiMedicineManMarkWardAction(
PlayerbotAI* botAI, std::string const name = "amani'shi medicine man mark ward") : Action(botAI, name) {}
bool Execute(Event event) override;
};
// Akil'zon <Eagle Avatar>
class AkilzonMisdirectBossToMainTankAction : public AttackAction
{
public:
AkilzonMisdirectBossToMainTankAction(
PlayerbotAI* botAI, std::string const name = "akil'zon misdirect boss to main tank") : AttackAction(botAI, name) {}
bool Execute(Event event) override;
};
class AkilzonTanksPositionBossAction : public AttackAction
{
public:
AkilzonTanksPositionBossAction(
PlayerbotAI* botAI, std::string const name = "akil'zon tanks position boss") : AttackAction(botAI, name) {}
bool Execute(Event event) override;
};
class AkilzonSpreadRangedAction : public MovementAction
{
public:
AkilzonSpreadRangedAction(
PlayerbotAI* botAI, std::string const name = "akil'zon spread ranged") : MovementAction(botAI, name) {}
bool Execute(Event event) override;
};
class AkilzonMoveToEyeOfTheStormAction : public MovementAction
{
public:
AkilzonMoveToEyeOfTheStormAction(
PlayerbotAI* botAI, std::string const name = "akil'zon move to eye of the storm") : MovementAction(botAI, name) {}
bool Execute(Event event) override;
};
class AkilzonManageElectricalStormTimerAction : public Action
{
public:
AkilzonManageElectricalStormTimerAction(
PlayerbotAI* botAI, std::string const name = "akil'zon manage electrical storm timer") : Action(botAI, name) {}
bool Execute(Event event) override;
};
// Nalorakk <Bear Avatar>
class NalorakkMisdirectBossToMainTankAction : public AttackAction
{
public:
NalorakkMisdirectBossToMainTankAction(
PlayerbotAI* botAI, std::string const name = "nalorakk misdirect boss to main tank") : AttackAction(botAI, name) {}
bool Execute(Event event) override;
};
class NalorakkTanksPositionBossAction : public AttackAction
{
public:
NalorakkTanksPositionBossAction(
PlayerbotAI* botAI, std::string const name = "nalorakk tanks position boss") : AttackAction(botAI, name) {}
bool Execute(Event event) override;
private:
bool MainTankPositionTrollForm(Unit* nalorakk);
bool FirstAssistTankPositionBearForm(Unit* nalorakk);
};
class NalorakkSpreadRangedAction : public MovementAction
{
public:
NalorakkSpreadRangedAction(
PlayerbotAI* botAI, std::string const name = "nalorakk spread ranged") : MovementAction(botAI, name) {}
bool Execute(Event event) override;
};
// Jan'alai <Dragonhawk Avatar>
class JanalaiMisdirectBossToMainTankAction : public AttackAction
{
public:
JanalaiMisdirectBossToMainTankAction(
PlayerbotAI* botAI, std::string const name = "jan'alai misdirect boss to main tank") : AttackAction(botAI, name) {}
bool Execute(Event event) override;
};
class JanalaiTanksPositionBossAction : public AttackAction
{
public:
JanalaiTanksPositionBossAction(
PlayerbotAI* botAI, std::string const name = "jan'alai tanks position boss") : AttackAction(botAI, name) {}
bool Execute(Event event) override;
};
class JanalaiSpreadRangedInCircleAction : public MovementAction
{
public:
JanalaiSpreadRangedInCircleAction(
PlayerbotAI* botAI, std::string const name = "jan'alai spread ranged in circle") : MovementAction(botAI, name) {}
bool Execute(Event event) override;
};
class JanalaiAvoidFireBombsAction : public MovementAction
{
public:
JanalaiAvoidFireBombsAction(PlayerbotAI* botAI, std::string const name = "jan'alai avoid fire bombs") : MovementAction(botAI, name) {}
bool Execute(Event event) override;
};
class JanalaiMarkAmanishiHatchersAction : public Action
{
public:
JanalaiMarkAmanishiHatchersAction(
PlayerbotAI* botAI, std::string const name = "jan'alai mark amani'shi hatchers") : Action(botAI, name) {}
bool Execute(Event event) override;
};
// Halazzi <Lynx Avatar>
class HalazziMisdirectBossToMainTankAction : public AttackAction
{
public:
HalazziMisdirectBossToMainTankAction(
PlayerbotAI* botAI, std::string const name = "halazzi misdirect boss to main tank") : AttackAction(botAI, name) {}
bool Execute(Event event) override;
};
class HalazziMainTankPositionBossAction : public AttackAction
{
public:
HalazziMainTankPositionBossAction(
PlayerbotAI* botAI, std::string const name = "halazzi main tank position boss") : AttackAction(botAI, name) {}
bool Execute(Event event) override;
};
class HalazziFirstAssistTankAttackSpiritLynxAction : public AttackAction
{
public:
HalazziFirstAssistTankAttackSpiritLynxAction(
PlayerbotAI* botAI, std::string const name = "halazzi first assist tank attack spirit lynx") : AttackAction(botAI, name) {}
bool Execute(Event event) override;
};
class HalazziAssignDpsPriorityAction : public AttackAction
{
public:
HalazziAssignDpsPriorityAction(
PlayerbotAI* botAI, std::string const name = "halazzi assign dps priority") : AttackAction(botAI, name) {}
bool Execute(Event event) override;
};
// Hex Lord Malacrass
class HexLordMalacrassMisdirectBossToMainTankAction : public AttackAction
{
public:
HexLordMalacrassMisdirectBossToMainTankAction(
PlayerbotAI* botAI, std::string const name = "hex lord malacrass misdirect boss to main tank") : AttackAction(botAI, name) {}
bool Execute(Event event) override;
};
class HexLordMalacrassAssignDpsPriorityAction : public AttackAction
{
public:
HexLordMalacrassAssignDpsPriorityAction(
PlayerbotAI* botAI, std::string const name = "hex lord malacrass assign dps priority") : AttackAction(botAI, name) {}
bool Execute(Event event) override;
};
class HexLordMalacrassRunAwayFromWhirlwindAction : public MovementAction
{
public:
HexLordMalacrassRunAwayFromWhirlwindAction(
PlayerbotAI* botAI, std::string const name = "hex lord malacrass run away from whirlwind") : MovementAction(botAI, name) {}
bool Execute(Event event) override;
};
class HexLordMalacrassCastersStopAttackingAction : public Action
{
public:
HexLordMalacrassCastersStopAttackingAction(
PlayerbotAI* botAI, std::string const name = "hex lord malacrass casters stop attacking") : Action(botAI, name) {}
bool Execute(Event event) override;
};
class HexLordMalacrassMoveAwayFromFreezingTrapAction : public MovementAction
{
public:
HexLordMalacrassMoveAwayFromFreezingTrapAction(
PlayerbotAI* botAI, std::string const name = "hex lord malacrass move away from freezing trap") : MovementAction(botAI, name) {}
bool Execute(Event event) override;
};
// Zul'jin
class ZuljinMisdirectBossToMainTankAction : public AttackAction
{
public:
ZuljinMisdirectBossToMainTankAction(
PlayerbotAI* botAI, std::string const name = "zul'jin misdirect boss to main tank") : AttackAction(botAI, name) {}
bool Execute(Event event) override;
};
class ZuljinTanksPositionBossAction : public AttackAction
{
public:
ZuljinTanksPositionBossAction(
PlayerbotAI* botAI, std::string const name = "zul'jin tanks position boss") : AttackAction(botAI, name) {}
bool Execute(Event event) override;
};
class ZuljinRunAwayFromWhirlwindAction : public MovementAction
{
public:
ZuljinRunAwayFromWhirlwindAction(
PlayerbotAI* botAI, std::string const name = "zul'jin run away from whirlwind") : MovementAction(botAI, name) {}
bool Execute(Event event) override;
};
class ZuljinAvoidCyclonesAction : public MovementAction
{
public:
ZuljinAvoidCyclonesAction(PlayerbotAI* botAI, std::string const name = "zul'jin avoid cyclones") : MovementAction(botAI, name) {}
bool Execute(Event event) override;
};
class ZuljinSpreadRangedAction : public MovementAction
{
public:
ZuljinSpreadRangedAction(
PlayerbotAI* botAI, std::string const name = "zul'jin spread ranged") : MovementAction(botAI, name) {}
bool Execute(Event event) override;
};
#endif