Watz integer truncation error
Shirhix opened this issue ยท 0 comments
The Bug
The Neptunium Watz Pellets (which have a decay multiplier of 0.5%) do not increase the total decayMultiplier.
Due to decayMultiplier being an integer with base at 100, multiplying it by the fuel decayMultiplier 1.005 will result in the int being truncated back to 100 (100.5 to 100). This and similar issues occur for values where something changes at less than 1% mutliplier, so 0.5, 1.5, 2.5 will not give a correct value. This is on almost every pellet.
The issue I found here:
https://github.com/Alcatergit/Hbm-s-Nuclear-Tech-GIT/blob/Custom-1.12.2/src/main/java/com/hbm/tileentity/machine/TileEntityWatzCore.java
Suggestion:
The way it currently works is that pellet multipliers induce multiplications on the total multiplier of the watz plant. Generally when working with multiplier-designed variables you perform additions on them to then finally apply the multiplicator as a multiplication to the base value.
This is what I had imagined:
base = 100;
mult = 0;
base += base for every pellet
mult += mult for every pellet
total = base * (1 + mult / 100)
As so would I expect the Watz to function based on the tooltips.
The difference in calculation is the following:
With the current system, adding 5 Neps (+10% power multiplier) does not increase the total power by 50%, it increases it by 61%.
What this does is essentially turning the Watz from a fuel-based to moderator-based reactor as the maximum power achieved is by having a fuel/moderator ratio of less than one.
Remarks
I achieved a maximum Power Production by putting in 7 Pures and 29 Neps (~270MHE/s). This is really cheap on the schrabidium side and the decay is bareable because the Neps don't increase it like they're supposed to. This also means, Neps are better in every way than Deshs or Berys. The fuel I find interchangable for not that much of a difference in Power Output. And for LES fuel, it's objectively worse than Neps, they have similar power, but Neps have double the multiplier and do not cost any Schrabidium.
Very often, other mods are used and some of them offer elegant solutions for storing large quantities of liquids such as Dynamic Tanks (Mekanism) and Black Hole Tanks (Industrial Foregoing). In my opinion, the Watz waste is not an issue, making this reactor very safe and efficient.
Talking about efficiency, back in the Drilligon Port days, the Watz Pellets had a power output of 10% of what they have today, and so their recipe was altered to require Tennessine. But what is the point of increasing the output of the Pellets tenfold if the power required to craft them was also increased at least tenfold (see Tennessine productiong using a Cyclotron). Maybe there is a more interesting way to craft them other than raw power requirement, just something to consider.