SunstriderEmu / BugTracker

Endless.gg bugtracker
https://endless.gg
30 stars 25 forks source link

Charge stun landing after the enemy's first action starts #5666

Closed Dalzedur closed 6 months ago

Dalzedur commented 6 months ago

Describe the bug Noticed when playing my warrior that if I charge an unaware enemy that is not in combat, for example, a Witherbark Caller in Hinterlands, that when the charge stuns them, the enemy has already started summoning their felhunter. Thus, the charge kicks the summon spell, causing it to enter a cooldown period. I could then easily dispatch the enemy, whose main defence after that point is just spamming shadow bolts. The issue here is that the stun should land before the enemy starts casting, thus the enemy should not be able to start casting their long cooldown ability during the initial stun period which forces it to fail and imposing the ability cooldown to start ticking. I mean, players can't start casting their spells while in stun only to have them immediately fail, cost mana, and then enter the cooldown period either.

The way I see it, it is a sequencing failure. You have several conditions that trigger at the 'same time', they just get applied in the wrong order.

/ Charge Start of combat applied to player and target (because charge cannot be used in combat, has to be in this order) Enemy AI ability that gets forced to start as soon as they enter combat Charge stun -> countering the enemy AI ability /

Charge stun should ideally land before the enemy AI starts casting their spell, and that stun effect should prevent them from starting their spellcasting ability while stunned. Only after the stun ends, do they get to start casting what their AI programming states should be their first action.

Character name Valendra

To Reproduce

  1. See an enemy, not in combat with you
  2. Charge at them
  3. Observe what the enemy spellcasting bar says: Failed

Witherbark Caller: https://www.wowhead.com/tbc/npc=2654/witherbark-caller Rank 3 charge: https://www.wowhead.com/tbc/spell=11578/charge Charge stun effect: https://www.wowhead.com/tbc/spell=7922/charge-stun

Expected behavior Charge 1 Stun applied as well as inability to start casting spells 2 Start_of_combat applied to both player and target 3 End_of_stun_period and spellcasting can now proceed as normal 4 Start_casting_1st_designated_start_of_combat_ability because the enemy didn't get a chance to do so yet and thus it hasn't been countered, so it is not in cooldown period yet

Of course, at this point the warrior will shield bash or pummel or some such the ability (like the summon) so it doesn't make too much of a difference. But it might be a crucial fix with regards to some other enemy out there being lobotomized by charge stun auto-countering their 1st ability.

Dalzedur commented 6 months ago

For clarity, cooldown period is both the programmed AI script's interval between uses and the hard cooldown that prevents the use of that ability for N seconds, such as through actually using the ability to completion. It is mostly relevant in the sense of the AI, as interrupting an ability only imposes a hard cooldown of 'cannot use spells from that school for 6 seconds' kind of cooldown', whereas a successful use of an abilty could impose a hard cooldown of, for example, '30 seconds' or some such.

Yet, it often seems like the AI doesn't even try to use the ability when it is available, rather opting to wait until its programming determines that it should try to use it. You can see this when an enemy debuffs you periodically - if you stun them just before the ability is to be used by the AI's internal clock which tells it to use it, for example, every 15 seconds, and that 15 second moment happens while the enemy is stunned, which prevents the use of the said ability, then the AI won't immediately attempt to use that ability once the stun ends. Rather, its AI programming makes it wait until another 15 seconds have passed before it attempts to use it again.

So even a healing spell with no cd, is not continuously spammed by a caster with enough mana - it has its own prerequisite AI checks that must first pass - a target that is damaged enough to warrant healing, and a time period between attempting to cast the heals and this varies with each enemy afaik. And this is not always a bad thing, because there are multiple enemies in the game that become outright unkillable without enough dps (such as when soloing) if they keep healing themselves whenever they could do so. You can see the time limitations between heals in low level dungeons, where a single interrupt is often enough to keep an enemy with a healing ability from getting to try and use it a second time.

Jerrythemagicdog commented 6 months ago

Thanks for the issue! The creature engages you when you take a hostile action, in this case — casting a spell. For the most part, creatures that are considered casters use unified behavior that makes them cast spells on aggro with a repeat timer of cast time + some leeway to allow for other actions to be taken if any. In these cases, there is no initial cooldown and the creature starts casting as soon as it's engaged. Adding an initial cooldown here wouldn't do much other than a cosmetic improvement to fix the situation where they lose one cast in your scenario. In other cases, when it's not a spammable spell and the creature is not a caster, there already is an initial cooldown and this situation doesn't happen. We could try adding some initial cooldown of 100-400ms to caster creatures to fix this behavior.

Jerrythemagicdog commented 6 months ago

This change will be live with the next update.