mekanism / Mekanism-Feature-Requests

All enhancements and feature requests for Mekanism (for current and future releases) should go here.
11 stars 4 forks source link

Improve Electrolytic Separator energy consumption with energy upgrades when speed upgrades are also used #262

Closed szikra closed 3 years ago

szikra commented 3 years ago

Describe the feature you'd like

I just recently started using Mekanism and as I understand there was a "nerf" to Electrolytic Separator to make in consume more energy (so it doesn't consume less than a Gas burning generator would produce) a while back. (described in https://github.com/mekanism/Mekanism/issues/2743 issue)

That's all good, I don't want to break the law of conservation of energy to produce free energy. (Well... I use wind generators and heat generators in passive mode... so I'm kinda already doing that ;)

I reached the point where I need oxygen for the Purification Chamber, and 400 J/t is not small, but it's ok. What I have problem with is when you apply speed upgrades to it.

As per the upgrade description at https://wiki.aidancbrady.com/wiki/Upgrades with 8 speed upgrades you can get 10x speed for the cost of (upgrade cards and) increased power consumption. 100 times more power if speed upgrades used alone, and 10 times when used with energy upgrades. 10x speed 10x power consumption, that makes sense... and doesn't violate the law of conservation of energy.

Unfortunately this is not the case for Electrolytic Separator (as described on the wiki https://wiki.aidancbrady.com/wiki/Electrolytic_Separator ), Energy Upgrades do not affect the energy efficiency. I'm not requesting that Energy Upgrades should improve the efficiency, but that it should compensate for the waste the speed upgrades apply.

The described energy generation exploit were only possible when there were more energy upgrade cards than speed upgrade cards, making Hydrogen generation cheaper (in terms of power cost) than power produced burning it.

To fix this we only need to modify the upper right half triangle of the Speed/Energy upgrade table, to not let greater than 100% efficiency (or less than 100% power consumed per unit produced). The consumed energy/tick has to be at least (energy cost/unit) (unit/tick) = cost/unit speed multiplier. (With +33% speed increase for every speed upgrade card, the power consumption should increase at least that much... and preferably not more when max energy upgrade is used.)

The current calculation (for standard machines) according to the wiki is DefaultUsage × EnergyMultiplier^[(2 × SpeedUpgrades - EnergyUpgrades)/8]

To prevent the infinite energy exploit we only need to apply this simple modification when used in Electrolytic Separator DefaultUsage × EnergyMultiplier^[(2 × SpeedUpgrades - MIN(EnergyUpgrades, SpeedUpgrades) )/8]

This ensures that we only negate the energy loss of the speed upgrades, but never improve the energy efficiency beyond 100% (never count more energy upgrade cards than speed upgrade cards).

Original Power usage table Speed/Energy 0 1 2 3 4 5 6 7 8
0 100% 75% 56% 42% 31% 24% 18% 13% 10%
1 178% 133% 100% 75% 56% 42% 32% 24% 18%
2 316% 237% 178% 133% 100% 75% 56% 42% 31%
3 562% 422% 316% 237% 178% 133% 100% 75% 56%
4 1000% 750% 562% 422% 316% 237% 178% 133% 100%
5 1778% 1333% 1000% 750% 562% 422% 316% 237% 178%
6 3162% 2371% 1778% 1333% 1000% 750% 562% 422% 316%
7 5623% 4217% 3162% 2371% 1778% 1333% 1000% 750% 562%
8 10000% 7499% 5623% 4217% 3162% 2371% 1778% 1333% 1000%
Calculated with new formula Speed/Energy 0 1 2 3 4 5 6 7 8
0 100% 100% 100% 100% 100% 100% 100% 100% 100%
1 178% 133% 133% 133% 133% 133% 133% 133% 133%
2 316% 237% 178% 178% 178% 178% 178% 178% 178%
3 562% 422% 316% 237% 237% 237% 237% 237% 237%
4 1000% 750% 562% 422% 316% 316% 316% 316% 316%
5 1778% 1334% 1000% 750% 562% 422% 422% 422% 422%
6 3162% 2371% 1778% 1334% 1000% 750% 562% 562% 562%
7 5623% 4217% 3162% 2371% 1778% 1334% 1000% 750% 750%
8 10000% 7499% 5623% 4217% 3162% 2371% 1778% 1334% 1000%

The other problem is that it's not 100x more power. It's 256x more power. Every speed upgrade doubles the energy consumption. From 400 to 800, 1.6k, 3.2k... 102.4k [J/t] just for 1 Electrolytic Separator. That's the power consumption of 213 maxed out Wind Generator... I don't have that many!

Since I haven't read in the documentation (neither on Electrolytic Separator nor on Upgrades wiki page) that this is an intended behavior, I will assume that this is a bug (and I will report it on a separate ticket).

Describe alternatives you've considered

Note: The other way to achieve 10x speed is to have 10 times as many Electrolytic Separators. And since an Electrolytic Separator is not that much more expensive than a speed+energy upgrade card, it really doesn't make sense to consume 100x power (operate them at 10% efficiency).

Difference in material between upgrading 1 separator vs building 9 more (10x speed either way)

So it costs little more than double osmium dust, and a little more redstone and iron (which is basically free because of iron farms)

But the difference in power is an order of magnitude. (The speed upgraded one consumes 10 (or 25.6) times of the 10 not upgraded ones)

So I don't see why would anyone use speed and/or energy upgrades on these.

Additional context

No response

pupnewfster commented 3 years ago

You do realize that speed upgrades don't increase the cost of the electrolytic separator the same as energy upgrades don't decrease it right? The only reason the energy cost goes up with speed upgrades is because more operations are happening each tick so the total energy usage goes up but the cost per operation is constant.

szikra commented 3 years ago

Actually no, I have not. I guess I have not measured the flow rates. It does seem a lot faster than 10x. Thanks for pointing that out.

Is that documented somewhere?

Because what's on the wiki says "Note that every speed upgrade makes the machine 33% faster, and the Power Usage increases with ~77% (33²%), which makes for an increase in power usage for each operation with 33%" Which is not the case if both the power consumption and the speed increases 256 times (I don't know how to accurately measure the speed increase).

And the Electrolytic Separator's page only says that energy upgrade does not affect efficiency, it does not say that speed upgrades don't either (that they behave differently than described on the Upgrades page).

Now... one could say I should have realized, because the speed upgrade card does say the effect is 256x... but so does it say on the Digital Miner... and 8 speed cards definitely don't make the Digital Miner 256x faster ;)

... I guess it's time to build a fusion reactor... because I'm not building 1000 wind generators :)

I'm gonna close my request, and I'm not opening a new one, but it would be nice if someone who know how these work would update the wiki...

pupnewfster commented 3 years ago

Feel free to update the wiki (it is primarily community driven). (Also in the case of the digital miner and a few other machines there is the issue of https://github.com/mekanism/Mekanism/issues/7206 that it was using the wrong scaling algorithm for showing what multiplier it had)

szikra commented 3 years ago

Yeah, I don't have enough experience with the mod to feel comfortable editing the wiki... but maybe one day.

... the wiki also says solar generators do "noticeably better in biomes that are hotter, such as deserts" but I'm getting 32.18 J/t in the desert (at noon, with /gamerule doDaylightCycle false) while getting 44.04 in plains... ... but I have found that this is a known issue https://github.com/mekanism/Mekanism/issues/6402 ... with the wiki being out of date. Unfortunately it seems no one got to it in a year to fix this misinformation on the wiki. ... hopefully I will do better:)

I know no one likes to document things, and people who know the code and write it, make changes to it are busy ... writing the code :) ... but I'm not sure that responding to issue tickets born out of outdated documentation takes less time than updating the documentation ;)

Thanks for your help.