ChthonVII / d2r_24ptr2_wereform_calculator

Wereform IAS Calculator for Diablo 2 Resurrected 2.4 PTR2
GNU General Public License v3.0
4 stars 0 forks source link

Dual Wielding Requires Testing #6

Open Warren1001 opened 2 years ago

Warren1001 commented 2 years ago

ChthonVII has stated that per-weapon speed calculation has been modified as of 2.4R2. He suggests VV may now be averaging EIAS values between weapons in some cases.

Warren1001 commented 2 years ago

This is outside the scope of the current calculator but I maintain an all-animation calculator and I'm sure that's what you're wanting to get to as well. I don't see the point in testing dual wielded Wereform animations since you can't attack during them anyway (until it's fixed).

Warren1001 commented 2 years ago

Starting with Normal Attack, WSM is just completely independent on each hand. I modded Phase Blade and Hydra Edge to have -50 and 50 WSM respectively. Currently eyeballing frame length with CTC casts. Normal Attack with Phase Blade has the same speed as Stun with Phase Blade. Stun with Phase Blade while Hydra Edge is in the offhand has the same speed as the previous two as well.

Edit: one thing that differs from LOD to PTR is that, while dual wielding, swinging with the main hand, swapping weapons, swinging again, then swapping weapons again and swinging will swing with the main hand on PTR, whereas it will continue to swing with the second hand on LOD. They did make some adjustment to how the attack is calculated at the very least, though this particular example may not be any issue.

Edit2: I see what you mean with Frenzy. Same circumstances, but I made Frenzy give no attackrate. Regardless of which hand each weapon is in, the first nova always starts at the same frame, and the second nova always follows almost immediately after at the same frame as well. Another edit: actually looks like they may be slightly different, hard to tell. Will proceed with mana testing to see if it is truly different.

Warren1001 commented 2 years ago

Frenzy has undergone significant change, and I'm 90% confident I've figured it out. It looks like your hypothesis of EIAS averaging is correct. I have been adjusting your Frenzy calculator (my local version) to try to match breakpoints as I discover them in-game. As of now, I have 4/4 frame lengths correct by formula (but I'm not measuring breakpoints precisely, just figuring out the frame calculation).

Here is the changes I have made:

  1. I adjusted your Frenzy calculator to apply our new logic with the double trun for the increment.
  2. I am averaging total EIAS between both hands, then applying the average to both hands, using these average values in the increment section of the formula.
  3. For each frame length, I am simply using the formula Math.ceil(256 * 17 / speedIncrease) for each hit. 'speedIncrease' is the same thing as increment, which at this step is after the EIAS averaging. I am assuming 17 correlates to the framesPerDirection constant of 1HS, as I am testing with two swords currently. Just paid better attention and saw 1HS = 16 for Barbarian.. need to do more testing :) Paying even better attention, all possible weapon types' framesPerDirection constants for Barbarian to Frenzy are 16. 17 is what gets the closest so far, so it may be the case that even if the Frenzy quirk still existed it's impossible to observe with EIAS averaging.

It looks as though Frenzy now averages the EIAS between both weapons, then calculates using the formula listed in 3., meaning for similar weapon types, both hit lengths will always be the same.

I do not yet know if the Frenzy quirk still exists, as I'm using similar weapon types. Both hit lengths are the same so I will see the first hit length regardless if I hit or miss (as they're the same). All possible weapon types' framesPerDirection constants for Barbarian to Frenzy are 16. 17 is what gets the closest so far, so it may be the case that even if the Frenzy quirk still existed it's impossible to observe with EIAS averaging.

Edit: here is the data, I'm currently mid-testing so you'll likely see me update it if you see this any time soon: https://docs.google.com/spreadsheets/d/1eo3VeIrSG3PvE0woLRqtG3tofafjaXEaBDsCU0uETvU/edit#gid=780483173

Edit2: I'd like to add that in my tests, I'm noticing the second hit follows very closely to the first hit (my CTCs are some frames apart, likely in the range of 3-10, not sure exactly). Also, Frenzy (and assumingly other Sequence skills) still have the -30 EIAS part.

Also, I think I'm noticing a couple bugs:

  1. When using a Sequence skill, it looks like on Attack CTCs are treated as on Hit CTCs. Any time I see the miss indicator pop up (against monsters standing still, and I'm directly next to them and not causing them to move), a CTC doesn't activate. on Attack CTCs should activate on swing attempts even if they miss or are blocked (monster isn't blocking though). I noticed this in previous tests with A5 Mercenaries (I believe their Normal Attack is a Sequence skill, or at the very least behaves like it).
  2. CTCs consume mana client-side when they have no mana cost. The client corrects it and sets the mana back to the true value after a couple frames.

Edit3: it does a little more than average. I tried testing what happened when the EIAS changed after a hit succeeded (Frenzy giving attackrate). I messed with auralencalc for Frenzy on the original frame length listed in the data and went from 5 frame Frenzy down to 0 frames and saw improvement over Frenzy giving no attackrate. This gets into the ticking stuff that's more your expertise, as the lower I set the auralencalc, the slower I lost mana (even when auralencalc=0), so clearly the length of the increment is different per auralencalc and thus giving different lengths of Frenzy animation for each auralencalc. This might change where the rounding needs to happen for the EIAS compared to what I have now.

Warren1001 commented 2 years ago

Double Swing works the exact same way. Only difference is instead of the -30 EIAS nerf that Sequence skills have, Double Swing has its +20 (50 attackrate bonus). Everything else is the exact same as Frenzy it looks like. https://docs.google.com/spreadsheets/d/1eo3VeIrSG3PvE0woLRqtG3tofafjaXEaBDsCU0uETvU/edit#gid=1665006487 Additionally, the two hits are very close together as well. Within a few frames I would imagine.

Edit: Tested the CTC issue again. There is definitely an issue with CTCs and Sequence skills. I attacked at least 100 times with Normal Attack (ensured alwayshit=0), I saw miss indicators, but the CTC was there even if the miss indicator showed. The moment I switch to Double Swing, a solid 10% of my CTCs are not going off at the same time I'm getting a miss indicator.

Even more puzzling, maybe I just don't understand the miss indicator in general. I have 5% chance to hit, yet I only see the miss indicator like 10% of my attacks. My attack rating is 84, I gave my target a billion defense, and I'm level 30 while the target is level 99.

ChthonVII commented 2 years ago

Wow, that's a lot. I'm not sure I can organize my thoughts well enough to respond to everything properly...

  1. Since I care about Frenzy barbs, I'm 100% on board with expanding the calculator to deal with it. Additionally, since the change from floor((animationspeed * (100 + EIAS))/100) to animationspeed + TruncateToInt((animationspeed * EIAS)/100) potentially changes a few breakpoints all over the place, D2R is going to need a full calculator for everything at some point.
  2. I did test dual wield and werewolf. Normal attack is bugged an unusable. Feral Rage uses the gloves-side weapon with no input from the boots-side weapon.
  3. My brief observation with normal attacks matches yours -- they sure look like each weapon is computing EIAS fully independent of the other. All that's left is to test to make sure there are no surprises. As for what to expect: normal attack while dual wielding uses two normal (non-sequence) animations. For barbs, it's A1/A2 and S3; for sins, it's A1/A2 and S4. For barb weapon types, 1SS is two swinging weapons, 1JT is two thrusting weapons, 1JS is left thrusting and right swinging, and 1ST is the opposite. These are all identical, except that the actionframe on some of the S3s is different. Framesperdirection is 16 for A1/A2 and 12 for S3. For sin weapons HT2 is two claws. Framesperdirection is 11 for A1, but 12 for A2, and then 12 for S4. I'll try to get that added to the calculator soonish.
  4. (Balance changing consequence if that hypothesis is true: In most cases you'll want your faster weapon in the gloves-side hand.)
  5. Useful info on Frenzy: (a) As a sequence skill, tick 0 is not skipped. (I.e., there is no -1 at the end of the fpa equation) (b) The sequence has 17 framesperdirection. (You were right the first time.) (c) Frames 00 through 08 come from A1 and frames 09 through 16 come from S3, so it should visually look like it's switching on the 10th frame. (d) Actionframes are 04 and 09. So the second swing hits on the same frame it visually starts. (This explains why the second hit follows so quickly after the first.) (Sequence tables can be found here in the 5th post.)
  6. I think the first step to figuring out Frenzy is to figure out whether the -30 goes on the right or the left of the + in animationspeed + TruncateToInt((animationspeed * EIAS)/100). In order to properly isolate variables, we should start with a non-dual-wield skill like Jab or something.
  7. I'm not sure if EIAS averaging means "compute EIAS, then average it" or "average WSM, average on-weapon-IAS, then compute EIAS." These would lead to different final EIAS values because the second one partially bypasses diminishing returns, even before considering issues of rounding.
  8. Another rounding issue is whether EIAS is averaged and truncated before going in to the increment calculation (double truncation), or the averaging operation is merged into increment calculation (single truncation). animationspeed + TruncateToInt((animationspeed * TruncateToInt((right_EAIS + left_EIAS)/2))/100) or animationspeed + TruncateToInt((animationspeed * (right_EIAS + left_EIAS))/200)
  9. The auralencalc stuff is odd. Part of it can be explained by the fact that, as per Hammerman, the increment recalculation on an actionframe effects that actionframe itself. (This is one of the parts of "the ticking stuff" that I don't understand very well. What Hammerman says is at odds with what everyone else says, but no one addresses the difference, and it leads to correct results for cases of increment recalculation, but wrong results for rollback skills.) That would explain why a 0-duration aura still has an effect. However, there's something else going on here too. In Hammerman's description, the increment only gets recalculated on the actionframes. But your results seem to suggest that it's getting recalculated on every tick. Or perhaps the expiration of the aurastate causes a recalculation independent of what the Frenzy animation is doing.
  10. Does the CTC bug also exist in LoD?
  11. Guessing the miss indicator is on a timer so it doesn't spam the screen too much. Or maybe just buggy.
  12. Guessing main-hand-only skills now only use the main-hand weapon. (Like my Feral Rage result.)
  13. Also need to look at Whirlwind. That will be a challenge.
Warren1001 commented 2 years ago

1. I already have a mostly up-to-date IAS calculator for D2R live for people to use. It's a rewrite of d2.lc/IAS/. I'm pretty sure these new adjustments are the only thing I'm lacking in it. 6. It's worth briefly mentioning that the Sequence skills that have additional speed changes get them in skills.txt and are simply treated as SIAS. That leaves the -30 working as SIAS or they're separate, so we would have a -30 term and then any additional modifier like +50 (Double Swing) or +30 (Impale, this is the change they made to Impale in the latest patch notes) to SIAS. 9. It was mostly by eyeball, so it may not have been adjusting at every auralencalc change. I can do testings to find the actual frame values at each to see if they're all truly different or not after more important testing is figured out. 10. I'll test it soon, not sure, but never seen anyone mention it in ~20 years. 11. I would find it to be useless if it's on a timer.. it's relatively small and suppose to show when you miss. But I doubt that's the case, I've talked to people and they suggest it doesn't always play on misses and sometimes it plays on things that don't have hit checks (Torch's Firestorm as it passes through monsters). It definitely does something. It shows up 100% of the time a CTC doesn't play during a Sequence skill. I've never noticed it when testing skills with alwayshit=1 though. 12. I would have assumed so. 13. I don't believe so. You had thought video recording to be widely inaccurate but every breakpoint I recorded through video turned out to be correct after mana cost testing. I'd like to reclarify that I didn't bother counting the visual frames, but rather recorded how many frames I advanced through the video. You could treat it as though I counted how many video frames I skipped through for 3 in-game animations and then averaged to get the frame length. I find it to be more efficient than mana cost testing when I have no basis for breakpoints. If I'm comparing against specific breakpoints, then mana cost testing is usually easier.

Edit: Whirlwind has been assumed to be bugged due to the appearance of other testers that the 4th and 8th frame don't work as they did in LOD. However, this has been an issue since D2R releases, and didn't originate with 2.4. I wonder if they made notable Whirlwind attack speed changes..

Warren1001 commented 2 years ago

I got a little bit of Jab testing in: https://docs.google.com/spreadsheets/d/1eo3VeIrSG3PvE0woLRqtG3tofafjaXEaBDsCU0uETvU/edit#gid=323008599 The expected values were computed using the most recent formula, but treating the -30 Sequence debuff as SIAS. Seems like something is off. I'll continue testing another time.

I tested CTCs on Double Swing in LOD. Also fails to play there.

Edit: unfortunately I no longer have PTR access. The "not online in 30 days thing" is probably what will eventually boot everyone off of the PTR unless someone finds a way to work around it. Nevermind, obvious workaround to set system time back some days and it works.

Warren1001 commented 2 years ago

I finished testing Jab on Amazon, 1HT with Pilum (0 WSM): https://docs.google.com/spreadsheets/d/1eo3VeIrSG3PvE0woLRqtG3tofafjaXEaBDsCU0uETvU/edit#gid=323008599

Edit: Jab has the same CTC issue. I can Normal Attack, see the miss indicator, but the CTC goes off. But when I Jab, if I see the miss indicator, the CTC does not go off.

Edit2: Also, I figured out why the Miss Indicator was behaving weirdly. Forgot that, in Hell, area level overrides set monster level, so I had a higher chance of attack than the character screen shows. Interestingly enough, the character screen will show the data of the monster before its stats were adjusted by the area.

ChthonVII commented 2 years ago

If we switch increment = animationspeed + TruncateToInt((animationspeed * EIAS)/100) back to increment = TruncateToInt((animationspeed * (100 + EIAS))/100) then Jab works out perfectly with the -30 sequence factor treated as skill IAS. Soooo, looks like the increment = animationspeed + TruncateToInt((animationspeed * EIAS)/100) thing is limited to wereforms. (Which is good, because it means there aren't a whole bunch of scattered breakpoints that got changed.)

Warren1001 commented 2 years ago

Is that all that would be different from 2.3? I think we covered all the differences... The only thing that can be done is just more empirical testing for a greater margin of safety.

Warren1001 commented 2 years ago

Things to test:

Warren1001 commented 2 years ago

Some updates: I made a mistake with my testing. I assumed the old bug where dual wielded sequence skills consuming mana twice still existed. It does not. Mana cost listed is what is consumed per animation. Skill tooltip currently ingame indicates it still consumes twice, which is wrong. The previous frame lengths you would've seen were double the length they should've been, which means:

For Frenzy to meet the currently recorded data, it looks like its brought in line with every other sequence skill, and now all sequence skills do the attack speed calculation for both weapons once (initially) instead of once for each weapon, using the sequence FPD for its attack length. So, instead of each Frenzy weapon having the formula Math.ceil(256 * 17 / speedIncrease), they both share this, and speedIncrease is based on the average.

Also: EIAS averaging happens before the 75 EIAS limit. Have yet to test Whirlwind.

Warren1001 commented 2 years ago

I tested Whirlwind. It works exactly the same as LOD.

I also tested the hit-check bug that people have been talking about. It's actually not what everyone thinks it is. The game still hits on 4 and 8, but (this is with some assumptions in mind): The increased resolution on D2R allows for shorter Whirlwinds than what was possible in LOD. In D2R, you can have the Whirlwind state (the swirl, not the rotating animation) last for 3 (and maybe 2) frames. In LOD, it was always at least 4 frames. I'm guessing this is the issue with D2R's Whirlwind hit-check. The animation is finishing before it gets to the 4th frame hit-check. If I make the Whirlwind animation ever so slightly longer to observe a 4 frame Whirlwind state, I always see the 4th frame hit.

Also: Strafe bug was fixed. You can attack at 2 FPA now.

Testing still needed:

ChthonVII commented 2 years ago

I'm sorry for the lack of replies. I've been buried under real-life obligations lately.

Do I understand correctly that the EIAS averaging is working as follows?

glovesside_EIAS = TruncateToInt(skill_IAS + DiminishingReturns(offweaponIAS + glovesside_onweaponIAS) - glovesside_WSM);
bootsside_EIAS = TruncateToInt(skill_IAS + DiminishingReturns(offweaponIAS + bootsside_onweaponIAS) - bootsside_WSM);
average_EIAS = TruncateToInt((glovesside_EIAS + bootsside_EIAS)/2);
capped_EIAS = Min(Max(average_EIAS, -85), EIAScap);

The second swing on normal attack uses the S3 animation for barbs and the S4 animation for sins. It just so happens that BAS31SS, BAS31ST, BAS31JT, BAS31JS, and AIS4HT2 all have framesperdirection of 12.


As for Whirlwind, after a bit of research, I think I understand how it works under LoD:

Attacks are made at frame 4, frame 8, and EIAS-dependent intervals thereafter. On frame 4, one attack is attempted; subsequently two attacks are attempted each interval. Due to a bug (nicely explained here), the weapon base damage and WSM switch for every attempted attack, but the weapon stats, including IAS, only switch when an attack successfully hits something. So you can end up using the WSM from one weapon and the IAS from the other. Due to poor design, if you hit 100% of the time, then the delay between attacks is always calculated with the boots-side weapon WSM and IAS. (Because you switched everything twice.)

Targets need to be both within range of of your weapon and within 5 subtiles. TitanSeal says that the second attack is not attempted, and therefore no switching occurs, if there was nothing within 5 subtiles for the first attack. It's not clear if this represents a misunderstanding of the above bug, or something is happening in addition to the above bug.

If two or more targets are in range, the two attacks will hit different ones.

Due to a bug, two-handed swords always use their one-handed framesperdirection value, even when used two-handed; and always use their two-handed damage, even when used one-handed.

Soooo... there's a whole bunch of crazy, buggy complexity there. And I'm not even sure where to start testing what may have changed. I'm really hoping they used averaged EIAS again, because it would make things a lot simpler.

Warren1001 commented 2 years ago

ya, thats how im calculating it.

well i can tell u for mechanics i observed everything as u described. like i said previously, whirlwind works exactly the same as it did in lod. i didnt test the one hand <-> two hand craziness tho

edit: also didnt test whether or not the weapons/statlist swap correctly or not