d07RiV / d3planner

Diablo III Character Planner
Apache License 2.0
113 stars 39 forks source link

R6 generator: animation time not taken into account #191

Open haasn opened 7 years ago

haasn commented 7 years ago

In d3planner, an ability with an animation time of say 13 frames will deal the damage immediately (tick t=0.00) and then delay for 13 frames.

In the game, the animation will play for 13 frames and then deal damage, at the end. This means that in practice, stuff like on-hit effects with ICDs will proc inconsistently for stuff with variable animation time. (lik monk generators)

If I have a generator with breakpoints like 6 / 6 / 9, then in d3planner I get:

t=0.00: hit, procs stricken, ICD = ceil(0.9*6)=6
t=0.10: icd expires
t=0.10: hit, procs stricken, ICD = ceil(0.9*6)=6
t=0.20: icd expires
t=0.20: hit, procs stricken, ICD = ceil(0.9*9)=9
t=0.35: icd expires
t=0.35: hit, procs stricken, ICD = ceil(0.9*6)=6
...

So after 4 hits, we have 4 stricken stacks. However, this is how it works in the real game:

t=0.00: animation started (length=6)
t=0.10: hit lands, procs stricken, ICD=6
t=0.10: animation started (length=6)
t=0.20: icd expires
t=0.20: hit lands, procs stricken, ICD=6
t=0.20: animation started (length=9)
t=0.30: icd expires
t=0.35: hit lands, procs stricken, ICD=9
t=0.35: animation started (length=6)
t=0.45: hit lands, **stricken on cooldown**
t=0.45: animation started (length=6)
t=0.50: icd expires
t=0.55: hit lands, procs stricken, ICD=6
...

In the real world, 3 generator hits = 2 stricken stacks, because going from a slow hit to a fast hit (as typically happens when going from the third to the first) triggers stricken with a longer ICD than the animation of the next attack.

But in d3planner, 3 generator hits = 3 stricken stacks. It's worth noting that this issue can't simply be “worked around” except by actually simulationg the animation duration / figuring out the point in time where the hit actually lands, because for example Fists of Fury's DoT can trigger stricken the moment the ICD expires, which means that FoF stacks at the fastest rate possible.

Also, for some reason, breaking wave doesn't seem to have this behavior - I haven't looked into it, but perhaps it's because breaking wave has the actual “hit” at a more consistent part of the animation?

haasn commented 7 years ago

As for how to approach this bug in the short-term, I think a reasonable work-around would be to just make the third hit of all generators except crippling wave and fists of fury not apply stricken.

d07RiV commented 7 years ago

Any idea where we could get the correct time of impact for every animation? I'll try to look through the animation files, maybe its all there.

If I can get these, it would be easy to fix the code.

haasn commented 7 years ago

Also, for some reason, breaking wave doesn't seem to have this behavior - I haven't looked into it, but perhaps it's because breaking wave has the actual “hit” at a more consistent part of the animation?

Incidentally, I had followed up on this thought previously but forgot to post. The reason it works for breaking wave is because breaking wave's damage is front-loaded, the damage comes first followed by the sweeping animation. That way it procs stricken for all three hits.

Any idea where we could get the correct time of impact for every animation?

No idea. I don't know anything about diablo data harvesting or file formats. As for alternatives, I think getting them from the client is the only reasonable solution; but failing that a special-cased exception for monk generators would be reasonable.