-
Notifications
You must be signed in to change notification settings - Fork 556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor PetAI #520
base: master
Are you sure you want to change the base?
Refactor PetAI #520
Conversation
* Remove PetAI::UpdateAllies() and timer and iterate over the owner's group directly. * Remove unnecessary duplicate check for disabled actions in PetAI::UpdateAI() * Convert and store Creature pointer as a pet in PetAI to simplify checks. * Create Pet::HasActionsDisabled() and refactor checks for disabled pet mode * Refactor spell pick and cast into separate PetAI::Cast() and PetAI::PickSpellWithTarget() functions. * Refactor autocast spell picking logic and order. * Use a single spell-target pair instead of a vector storage and random choice.
Did you make sure a pet breaks attack off when a target was cced after attack order was issues? Because that currently works. |
Aha! So that additional check for victim was actually to support this behavior. I noticed that pet stops attacking polymorphed creature, but then ignores attack order. Though I see that pet still attacks feared target, even though this a CC that we might not want to break. Is this expected? 🤔 |
It's common for warlocks to fear-juggle enemies. If their pets would stop attacking with every fear that'd be a significant DPS loss, so I'm pretty sure the only CCs that should stop pet attacks are those that break with any damage, such as sap, sheep or gouge |
The pet needs to ignore damage breakable cc that occurs after attack order. You can always tell pet to attack after the fact and it needs to comply. |
Lookup the commits adding it to see the rationale using git blame. |
Yes, I understand and I will fix this. I'm trying to identify the culprit of this issue since I see it occasionally happens even with the current code (and the AI logic does not seem to handle this in any way, it seems to me as a timing issue or improper state handling). The attack order may still be ignored sometimes after the target was polymorphed and only target switching helps to bypass the restriction to attack CCed target.
I don't object this kind of logic, but I'd like to understand whether this is a blizzlike behavior. Another example, pets also don't stop attacking enemies affected by frost nova, but this is a CC that breaks immediately.
I think this might be an issue with updated logic too (it most likely will always autocast it), but I'm not sure how to check. Can I somehow make pet learn spells with a command? There is a similar issue (in both the current and updated logic) with Thunderstomp that's an AoE spell that has no min/max distance, and pets need to get into the victim to actually cast it. |
I think I've sorted the issues out. Pets stop attacking CCed targets correctly in this PR now, and there were also a few fixes added to different behaviors:
|
Ok and now one last thing to bother you with PetAI is notoriously known to be ass to script. Something like this: When you start a script, nothing that a player can do, short of abandon or unsummon should be able to interrupt such a sequence. I understand its a tbc script but I am sure you could write a similar thing in vanilla where a pet moves a bit, does some emote and wont have its script broken. |
Done. I've tested on TBC and scripted pet shouldn't get stuck anymore. The issue you mentioned was mostly due to the fact that pet was interrupted on combat or on retreating and this messed up the combat and movement states. EDIT: Though I noticed that it still may stuck when commanded to stay or retreat during/after scripted scene (pet gets stuck in following state and does not actually follow after stay, but continues to follow after attack). And I think it may also stuck when commanded to attack during script. I'll look into it. |
I think simply removing this line would suffice once the changes are ported to other cores. IMO, there's no point in sending pet back to owner after scripted sequence, since once you remove combat script status, the movement will be delegated back to AI (unless it's really necessary to send pet back even if it's supposed to stay, then setting Works almost flawlessly: |
4e476af
to
0561c88
Compare
f0e0768
to
334446b
Compare
334446b
to
cef9c11
Compare
cf988b4
to
81e1458
Compare
🍰 Pullrequest
Refactors PetAI logic to be more concise and possibly a bit more optimized by reducing number of checks:
Additionally, introduces conditional spell casts based on the info I managed to gather:
Proof
Issues
How2Test
Regression test checklist
I've tried to cover all scenarios that are affected by this refactor, but I can check more if something is missing.