Skip to content
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

Manaforged Trigger Rate is not correct. #7625

Open
3 tasks done
8Times opened this issue May 20, 2024 · 0 comments · May be fixed by #7636
Open
3 tasks done

Manaforged Trigger Rate is not correct. #7625

8Times opened this issue May 20, 2024 · 0 comments · May be fixed by #7636
Labels
bug:calculation Numerical differences

Comments

@8Times
Copy link

8Times commented May 20, 2024

Check version

  • I'm running the latest version of Path of Building and I've verified this by checking the changelog

Check for duplicates

  • I've checked for duplicate open and closed issues by using the search function of the issue tracker

Check for support

  • I've checked that the calculation is supposed to be supported. If it isn't please open a feature request instead (Red text is a feature request).

What is the value from the calculation in-game?

As this is more indepth let me explain it with an example:
Lightning Arrow (11 Mana) - GMP (150%) - Elemental Damage with Attacks (130%) - Trinity (140%) - Faster Attacks (110%) - Concentrated Effect (140%)
Storm Rain (11 Mana) - Elemental Damage with Attacks (130%) - Concentrated Effect (140%) - Manaforged Arrows (200%) - Lightning Penetration (130%) - Mirage Archer (130%)

Ingame with this setup (excluding other sources of reduced and increased mana cost) I trigger Storm Rain every 5 shots.

To reach that point I need to use the formula Math.ceil(Blast Rain Manaforged Threshold / Lightning Arrow Cost) with the exact mana cost of both skills to avoid rounding issues.

Lightning Arrow Cost = 111,51,31,41,11,4 = 46,2462
Blast Rain Manaforged Threshold = (11
1,31,421,31,3)*3 = 203,0028

Math.ceil(203,0028/46,2462) = Math.ceil(4,38961038961) = 5 shots

That means my trigger rate will be my attack rate / shots required. e.g. at 3,87 APS I have a trigger rate of 0,774.

What is the value from the calculation in Path of Building?

PoB ignores the required amount of shots to trigger manaforged arrows and instead uses the constant mana cost per second. Additionally it is not accurate because it uses the already rounded down mana cost which will lead to issues on edge cases where the required amounts of shots are almost over a threshold. This leads to a trigger rate of 0,88 which would only work with a much higher attack rate.

  1. Those two imports need to be fixed, it has to be the exact mana cost:
    local triggeredManaCost = GlobalCache.cachedData[env.mode][triggeredUUID].Env.player.output.ManaCost or 0

    local sourceManaCost = GlobalCache.cachedData[env.mode][uuid].Env.player.output.ManaCost or 0
  2. trigRate = trigRate / m_ceil(manaSpentThreshold / sourceManaCost):
    trigRate = (trigRate * sourceManaCost) / manaSpentThreshold
  3. Replacement with accurate description
    t_insert(breakdown.EffectiveSourceRate, s_format("* %.2f ^8(Mana cost of trigger source)", sourceManaCost))
    t_insert(breakdown.EffectiveSourceRate, s_format("= %.2f ^8(Mana spent per second)", (trigRate * sourceManaCost)))
    t_insert(breakdown.EffectiveSourceRate, s_format(""))
    t_insert(breakdown.EffectiveSourceRate, s_format("%.2f ^8(Mana Cost of triggered)", triggeredManaCost))
    t_insert(breakdown.EffectiveSourceRate, s_format("%.2f ^8(Manaforged threshold multiplier)", actor.mainSkill.skillData.ManaForgedArrowsPercentThreshold))
    t_insert(breakdown.EffectiveSourceRate, s_format("= %.2f ^8(Manaforged trigger threshold)", manaSpentThreshold))
    t_insert(breakdown.EffectiveSourceRate, s_format(""))
    t_insert(breakdown.EffectiveSourceRate, s_format("%.2f ^8(Mana spent per second)", (trigRate * sourceManaCost)))
    t_insert(breakdown.EffectiveSourceRate, s_format("/ %.2f ^8(Manaforged trigger threshold)", manaSpentThreshold))

How to reproduce the issue

No response

Character build code

https://pobb.in/g-a58sUT0t-p

Screenshots

No response

@8Times 8Times added the bug:calculation Numerical differences label May 20, 2024
@Paliak Paliak linked a pull request May 29, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:calculation Numerical differences
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant