Skip to content

Bot eating/drinking state machine and mage conjure improvements#269

Merged
billy1arm merged 1 commit intomangoszero:masterfrom
bozimmerman:bot_eating_drinking
Mar 9, 2026
Merged

Bot eating/drinking state machine and mage conjure improvements#269
billy1arm merged 1 commit intomangoszero:masterfrom
bozimmerman:bot_eating_drinking

Conversation

@bozimmerman
Copy link
Contributor

@bozimmerman bozimmerman commented Mar 8, 2026

This change is mostly about making better Mage Playerbot Group Members by:

  1. Magebots conjure their own food and drink.
  2. Magebots share food and drink with group members as appropriate (and common in real Wow)
  3. Magebots conjure Mana Gems and prefer using them to potions or Evocation

However, when working on these things, I discovered general issues with Bots eating and drinking, so this change ALSO tackles several things there that apply to ALL Playerbots:

  1. Instead of arbitrary health and mana thresholds, adds configuration thresholds Hungry and Thirsty, defaulting to 65%.
    ** 2. Instead of blocking the entire AI action processing during eating and drinking, this puts Eat/Drink firmly into the priority mix, allowing it to be interrupted by higher priority actions (such as responding to aggro)..
  2. It also has an early break from eating/drinking when the Bot is full.

This change is Reviewable

Copilot AI review requested due to automatic review settings March 8, 2026 17:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Playerbot AI to improve out-of-combat sustenance behavior (eating/drinking) for all bots, and enhances Mage bot group utility via conjured food/water and mana gems.

Changes:

  • Adds configurable “hungry”/“thirsty” thresholds (default 65%) and introduces corresponding triggers used by the food/drink strategy.
  • Reworks eat/drink handling to be stateful (via PlayerbotAI timers) and interruptible within the normal action priority mix.
  • Expands Mage behavior: conjure food/water/mana gems, share conjured food/water with nearby group members, and prefer mana gems over mana potions/evocation when low on mana.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/modules/Bots/playerbot/strategy/triggers/TriggerContext.h Registers new global triggers: hungry, thirsty.
src/modules/Bots/playerbot/strategy/triggers/HealthTriggers.h Adds HungryTrigger driven by config threshold and eating state.
src/modules/Bots/playerbot/strategy/triggers/GenericTriggers.h Declares ThirstyTrigger.
src/modules/Bots/playerbot/strategy/triggers/GenericTriggers.cpp Implements ThirstyTrigger using config threshold and drinking state.
src/modules/Bots/playerbot/strategy/mage/MageTriggers.h Adds mage triggers for mana gem presence and party sustenance needs.
src/modules/Bots/playerbot/strategy/mage/MageTriggers.cpp Implements party sustenance scanning/caching logic.
src/modules/Bots/playerbot/strategy/mage/MageAiObjectContext.cpp Registers new mage triggers and actions for conjuring/giving sustenance.
src/modules/Bots/playerbot/strategy/mage/MageActions.h Adds conjure food/water/mana gem actions and give-conjured actions.
src/modules/Bots/playerbot/strategy/mage/MageActions.cpp Implements giving conjured items to party and best-rank mana gem conjure selection.
src/modules/Bots/playerbot/strategy/mage/GenericMageStrategy.cpp Updates low-mana behavior to try mana gem before evocation.
src/modules/Bots/playerbot/strategy/mage/GenericMageNonCombatStrategy.cpp Adds non-combat triggers for conjuring mana gems and giving conjured food/water.
src/modules/Bots/playerbot/strategy/generic/UseFoodStrategy.cpp Switches food/drink triggers from fixed low-health/low-mana to hungry/thirsty.
src/modules/Bots/playerbot/strategy/actions/UseItemAction.h Makes UseItemAuto protected to allow derived overrides (mana gem preference).
src/modules/Bots/playerbot/strategy/actions/UseItemAction.cpp Removes prior food-use special-case that interrupted casting and delayed AI checks.
src/modules/Bots/playerbot/strategy/actions/TradeStatusAction.cpp Adds include for UseItemAction.h.
src/modules/Bots/playerbot/strategy/actions/NonCombatActions.h Reworks Eat/Drink actions to maintain state while active and use new thresholds.
src/modules/Bots/playerbot/strategy/actions/NonCombatActions.cpp Restores proper includes (uncommented).
src/modules/Bots/playerbot/strategy/actions/InventoryAction.h Adds InventoryAction::FindPlayerItem helper for scanning other players’ inventories.
src/modules/Bots/playerbot/strategy/actions/InventoryAction.cpp Adds mana gem inventory parsing and conjured food/drink parsing; implements FindPlayerItem.
src/modules/Bots/playerbot/strategy/ItemVisitors.h Adds visitors for (conjured) food/drink detection by spell category.
src/modules/Bots/playerbot/aiplayerbot.conf.dist.in Documents new config options: HungryHealth, ThirstyMana.
src/modules/Bots/playerbot/PlayerbotAIConfig.h Adds config fields hungryHealth and thirstyMana.
src/modules/Bots/playerbot/PlayerbotAIConfig.cpp Loads new hungry/thirsty thresholds from config with defaults.
src/modules/Bots/playerbot/PlayerbotAI.h Adds eat/drink state tracking (timers + helpers).
src/modules/Bots/playerbot/PlayerbotAI.cpp Initializes/clears eat/drink timers; minor guard added to SpellInterrupted.
src/game/Object/SpellMgr.h Defines spell category constants for food/drink used by the bot logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Adds IsEating/IsDrinking state tracking so bots hold their sit-and-eat
behavior for the full duration. New hungry/thirsty triggers fire at
configurable thresholds before health/mana are critical. Mage bots now
conjure food, water, and mana gems, and distribute conjured items to
party members who need them.
@bozimmerman bozimmerman force-pushed the bot_eating_drinking branch from 74ecd80 to 4279163 Compare March 8, 2026 18:04
@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

@billy1arm billy1arm merged commit c4bb03f into mangoszero:master Mar 9, 2026
8 checks passed
@bozimmerman bozimmerman deleted the bot_eating_drinking branch March 9, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants