Twintop's Resource Bar

Twintop's Resource Bar

670k Downloads

Voidform timer displaying infinite sign if haste% goes to high.

OxymoronDK opened this issue · 1 comments

commented

Pretty much the title.
While in Torghast and i suspect it's not exclusive, the "$vfTime" will change to "∞" if you get to much haste.
I haven't been able to pinpoint the breakpoint, but it's somewhere between 150% and 220% haste.
Of course your Voidform time isn't infinite, but it displays as such.
Worth mentioning, it doesn't change back untill you exit voidform agian.
If you need my specific settings for the bar to test this and troubleshoot, let me know.

Discord: Oxymoron#0577

commented

Hey @OxymoronDK, thanks for reporting!

This behavior is largely intentional to prevent an infinite loop causing the bar to crash (see #114). With that said, there are some tweaks that could/should be made to how it handles things. I'm going to jot some notes down below to explain what it is currently doing and why (for both future reference and to provide context).

There are two sets of variables for Hungering Void that are calculated -- $hvTime + $vbCasts and $hvAvgTime + $hvAvgCasts. The difference between the two is that the 'average' variables factor in your Crit% when calculating how much time gain you'll receive, on average, from a Void Bolt cast on the target. $hvTime is used in the "Simple" bar text defaults while $hvAvgTime is used in the "Advanced" bar text defaults (but you can change the bar text to include whichever you'd like!).

As a blanket statement, the calculations inside the bar also include your latency but I will not be including that below for simplicity.

Assuming you don't have any CDR (from Elethium Muzzle, which is implemented but not yet released - see #116), Void Bolt's base cooldown is 4.5 seconds. Since we gain 1sec added to Voidform every time we cast Void Bolt (not factoring in Crit at all yet), if the cooldown of Void Bolt drops below 1sec we can, in theory, remain in Voidform forever. This happens at 350% haste -- 4.5 / (1 + 3.5) = 1 sec.

So it stands that, for $hvTime + $vbCasts, if your Haste% is below 350%, you shouldn't ever see "∞". This is a tweak I definitely feel comfortable making.

When you factor in Crit% though, things get wild really fast due to gaining not 1.0sec but rather 2.0 on a crit. Starting at 100% crit and a Void Bolt cooldown of 2.0sec (125% haste) down to 0% crit and 350% haste, we're in infinite Voidform territory. If you had 89% crit and 150% haste (1.8sec cooldown), this would do it (2 - (2/1.8) = 0.8889..). At 220% haste you'd only need 57.78% haste for this to happen.

For fun, if you had Elethium Muzzle (25% reduced CD for all abilities), for this to occur with 150% haste you'd need 51.85% crit and with 220% haste you'd need just 10.37% crit.

Right now if either of the calculations tends towards infinity, both $hvTime and $hvAvgTime get labeled with "∞". This should only happen if that variable specifically is infinite. There are some other adjustments that need to happen as well to make things a bit more streamlined:

  • Have $hvTime + $vbCasts determine if they are infinite separately from $hvAvgTime + $hvAvgCasts.
  • Supplement the maximum loop in the code to do checks for Crit and Haste levels to save computation cycles. Keep the current max iterations in place as a safety fallback.
  • Factor in current cooldown/GCD lock to calculations.