You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the skill point (SP) is not enough to upgrade the skill, this API should return 0. However, due to floating-point imprecision, when SP is too small and the current level is too high, this API may return 1. For example:
result is 0, cost is 1, and costOfResultPlus1 is 0, so it returns 1. In this case, the current level is too high (1e50), so increasing it by 1 (result + 1) won't do anything (costOfResultPlus1 = 0) (if the player calls ns.bladeburner.upgradeSkill with count = 1, we will notify them that it's impossible to do that).
At first glance, I think that this behavior is (somewhat ?) reasonable. However, some players may be confused: "Why does it return 1 when it's obvious that I won't be able to upgrade the skill with that amount of SP?".
@d0sboots What do you think about this problem? It only matters when the player is farming int and they don't know the pitfall of floating-point imprecision (A(big) + B(small) may be exactly A in some cases), so I don't think that it's a big deal.
The text was updated successfully, but these errors were encountered:
I think there's an actual problem here. For the right large values, I think the "result" calculation in skillMaxUpgradeCount can return a single number that is some power-of-2 due to rounding in the fundamental calculation. However, this result will be too big, and then the +-1 won't be enough to correct that, so the final result ends up being too big and fails if you try to pass it through on the other side.
Instead of using +-1, it needs to be using increments that are it minimum 1, but scale with the precision of the calculation. Ugh.
#1475 added
skillMaxUpgradeCount
formula API.When the skill point (SP) is not enough to upgrade the skill, this API should return 0. However, due to floating-point imprecision, when SP is too small and the current level is too high, this API may return 1. For example:
This is how we are implementing it:
result
is 0,cost
is 1, andcostOfResultPlus1
is 0, so it returns 1. In this case, the current level is too high (1e50), so increasing it by 1 (result + 1
) won't do anything (costOfResultPlus1
= 0) (if the player callsns.bladeburner.upgradeSkill
withcount
= 1, we will notify them that it's impossible to do that).At first glance, I think that this behavior is (somewhat ?) reasonable. However, some players may be confused: "Why does it return 1 when it's obvious that I won't be able to upgrade the skill with that amount of SP?".
@d0sboots What do you think about this problem? It only matters when the player is farming int and they don't know the pitfall of floating-point imprecision (
A(big) + B(small) may be exactly A in some cases
), so I don't think that it's a big deal.The text was updated successfully, but these errors were encountered: