Mana Cost Calculation and Rounding
I was asking around in Discord and Reddit already, while I did receive a few helpful links, I never really received any definite answer, which is why I'm now posting here. Below are links that can be helpful as we proceed.
TIL: Mana cost of skills can depend on gem order Explaining how mana cost is rounded down after each multiplier to 100th of an integer Mana Cost Calculation Increases and reductions are additive units rounding clarification How reductions to mana cost are calculated Reduced Mana cost mechanics? Elreon craft example Items being used in calculations and tests * The Blood Reaper - 50% increased Mana Cost of Skills * Rare ring with Channeling Skills Have -1 to Total Mana Cost * Jewels in tree or other gear pieces don't offer increased or reduced mana cost Gem Mana Cost Cyclone - 2 Cast on Crit - 140% (1.4) Fire Penetration - 140% (1.4) Inspiration (lvl 16) - 115% (1.15) ; 32% reduced mana cost Elemental Focus - 130% (1.3) Case 1: Cyclone + Cast on Crit, no increases or reductions Mana Cost with just Cyclone and Cast on Crit should be 2*1.4=2.80, rounded down to 2 No issue here Case 2: Cyclone + Cast on Crit + Channeling Skills Have -1 to Total Mana Cost There are two ways this could go: base mana cost * multiplier, round down -1; or base mana cost * multiplier -1, round down 2*1.4=2.8, round down to 2, then 2-1=1 And the other way 2*1.4=2.8 2.8-1=1.8, round down to 1 And sure enough, ingame the mana cost is 1 as well. However, this still doesn't explain which is correct Case 3: Cyclone + Cast on Crit + The Blood Reaper In this case, we need to reference the "units rounding clarification" thread and raics' answer " If I'm not completely misinterpreting what he's saying, the total mana cost would be 2*1.4=2.8, rounded down to nearest integer, 2, and add 50% to the cost 2+2*0.5=2+1=3 Yup, that's what game gives as the total mana cost as well. Though if the costs are not rounded down to an integer before reduction or increase, the mana cost would be different 2.8*0.5=1.4 2.8+1.4=4.2, rounded down to 4 The first one gives the same answer as the game, but the second one seems more logical. Case 4: Cyclone + Inspiration Now this is where it gets interesting. Nowhere is mentioned, if increases and reductions are rounded to closest integer before adding or deducting, but following "TIL: Mana cost of skills can depend on gem order" thread or rounding rule, let's test a couple of different options Rounding down to closest integer after multiplier and calculate the reduction and rounding it down to closest integer before deduction 2*1.15=2.3, rounding it down to 2 Calculate reduction 2*0.32=0.736, rounding down to closest integer, 0 Calculate total mana cost 2-0=2 Sure enough, game also give total mana cost of 2 However, one would think that the mana cost is not rounded down to an integer before calculating reductions and increases and neither reductions nor increases are rounded down to an integer at this point, but rather to 100th of an integer, like multipliers. If this rule was followed, the mana cost would end up at 2*1.15=2.3 2.3*0.32=0.736, rounded down to 0.73 2.3-0.73=1.57, rounded down to 1 That looks much more logical when comparing to rule of calculating the multipliers, but it seems that game is not following this rule. Case 5: Cyclone + all the support gems above To add all the multipliers together, I'll list them down by 1000th of an integer in the brackets (just like in the other thread) (formatting gets a bit messy here, sorry) Skill | Multiplier| Total Cast on Crit | 1.4 | 1.4 Fire Pene | 1.4 | 1.96 Inspiration (lvl 16) | 1.15 | 2.25(4) Ele Focus | 1.3 | 2.92(5) Mana cost of Cyclone before Inspiration reduction 2*2.92=5.84 Ingame the mana cost with all these links is 4. Below are few different methods the game could use to calculate the total mana cost. Method 1: No rounding to integers between multipliers and reductions If Inspiration reduction was calculated at this point and rounded down to 100th of and integer 5.84*0.32=1.86(8) Running a total of 5.84-1.86=3.98, rounding down to 3 Nope Method 2: Rounding Cyclone mana cost down to an integer and calculate reduction and deducting it from the mana cost and then round down again to an integer 5.84, rounded down to 5 5*0.32=1.6 5-1.6=3.4, rounded down to 3 Again, nope Method 3: Not rounding Cyclone down to an integer, but rounding the reduced cost to an integer and deducting it and then rounding 5.84*0.32=1.6, rounded down to 1 5.84-1=4.84, rounded down to 4 Possibly? Method 4: Rounding Cyclone down to an integer, rounding the reduced cost to an integer and deducting it 5.84, rounded down to 5 5*0.32=1.6, rounded down to 1 5-1=4 Again yields the same result as the game. The question Is there any official information how all this works, or is this all just guessing game? Just calculating the numbers doesn't actually offer any real answer, as both methods 3 and 4, while in my opinion are very illogical, yield the same result while being calculated a bit differently. Also, the method number 1 seems most logical, but yields a wrong result. Is this just an oversight, the numbers being rounded every step of the way and pretty aggressively as well, or is just how the game works? If you got this far, thank you. I would really appreciate some input on this. Last bumped on May 12, 2020, 8:30:07 AM
|
![]() |
Bump
|
![]() |
Bump
|
![]() |
Bump
|
![]() |
Bump
|
![]() |
Bump
|
![]() |
Bump
|
![]() |
Bump
|
![]() |
Bumping this as well. Just went down the rabbit hole of trying to figure this out as well. 65% Reduced Mana Cost on my Cyclone should have me at a total of 2 (7.6 Cyclone * 0.35 Reduced Mana). In game it won't budge from 3 Mana Cost.
This lead into me attempting to figure out all the gem combinations, and best Gem Order just in case any permutation of the Links would give me a better result with the Rounding. That was an absolute nightmare though, and I have a small brain. 120 Combinations isn't fun and I couldn't figure out a comfortable way to auto generate the best result. The easy solution is obviously to just ignore it and use -Mana Cost but the fact that there is no solid info on how this calculates is whack. Would be cool to get some clarification. My Path of Building which nets me 2 Mana Cost, and the Character on my Profile which is giving me 3 Mana Cost is SeekDeezNuts (creative I know). |
![]() |
Last night I stumbled upon the same problem and after some testing I can say that method 4 in case 5 of the original post is the way PoE calculates mana cost multipliers and reductions (or increases). The first two methods were already disproven in the first post and for the remaining two we can use Cyclone + lvl 20 Inspiration (multiplier 115%) + any 130% multiplier support (like Added Cold Damage) as an example. This setup in game yields the mana cost of 2 as a result.
First, we determine the cost before the reduction. 2 * 1.15 * 1.3 = 2.99 Next, we apply the 34% reduced mana cost from Inspiration. If we don't round down here (method 3), we should have: 2.99 * 0.34 = 1.0166, rounded down to 1 mana reduction totalling 2.99 - 1 = 1.99, rounded down to 1 total mana cost. The correct way, however, is this: 2 * 1.15 * 1.3 = 2.99, rounded down to 2 2 * 0.34 = 0.68, rounded down to 0 mana reduction totalling 2 - 0 = 2 total mana cost which corresponds to method 4 in the original post. In conclusion, the game rounds the numbers down to an integer after calculating the multipliers as well as before adding the reduction (or increase) to the cost. There should be no case though where the linked gem order would matter. If anyone is still confused, I made a spreadsheet here which calculates the final mana cost based on all multipliers and modifiers to it. Also PoB doesn't round the cost calculations until the end and can get it wrong in some cases unfortunately. Last edited by filip2211#2016 on May 12, 2020, 8:30:30 AM
|
![]() |