PathOfBuildingCommunity / PathOfBuilding

Offline build planner for Path of Exile.
https://pathofbuilding.community
Other
3.63k stars 2k forks source link

Manaforged Trigger Rate is not correct. #7625

Closed 8Times closed 4 days ago

8Times commented 1 month ago

Check version

Check for duplicates

Check for support

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 = (111,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: https://github.com/PathOfBuildingCommunity/PathOfBuilding/blob/ad60a7a1a3d50ea88c0ba20394a0c618a3fc58af/src/Modules/CalcTriggers.lua#L535 https://github.com/PathOfBuildingCommunity/PathOfBuilding/blob/ad60a7a1a3d50ea88c0ba20394a0c618a3fc58af/src/Modules/CalcTriggers.lua#L538
  2. trigRate = trigRate / m_ceil(manaSpentThreshold / sourceManaCost): https://github.com/PathOfBuildingCommunity/PathOfBuilding/blob/ad60a7a1a3d50ea88c0ba20394a0c618a3fc58af/src/Modules/CalcTriggers.lua#L551
  3. Replacement with accurate description https://github.com/PathOfBuildingCommunity/PathOfBuilding/blob/ad60a7a1a3d50ea88c0ba20394a0c618a3fc58af/src/Modules/CalcTriggers.lua#L541-L549

How to reproduce the issue

No response

Character build code

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

Screenshots

No response