
Increasing throughput of EnderIO Energy Conduits prevents energy transfer.
etmoonshade opened this issue · 5 comments
Issue Description:
After increasing the energy throughput of conduits to a sufficiently obscene number and replacing a portion of my power network (formerly fluxducts) with them, I found that the conduits wouldn't power any of my machines. Using the Conduit Probe on the bit of network showed that the conduit storage was a very large (or small) negative number.
What happens:
Machines are not powered.
What you expected to happen:
Machines should be powered.
Steps to reproduce:
- Edit enderioconduits.cfg:
energy {
I:tier1_maxIO=640000
I:tier2_maxIO=5120000
I:tier3_maxIO=20480000
}
- Create a power network with production on one end, a consumer on the other, and 105 or more Ender Energy conduits in the network (based on the above values, at least.)
- Observe lack of power on consumers. Conduit probe shows a large negative number.
Affected Versions (Do not use "latest"):
- EnderIO: 5.0.26
- EnderCore: 1.12.2-0.5.30
- Minecraft: 1.12.2
- Forge: 14.23.4.2705
Your most recent log file where the issue was present:
N/A
I strongly suspect that the "conduit storage" given by the probe is just the maximum I/O multiplied by the number of conduits in the network. Once this value overflows a signed int, the system thinks there's no power available and therefore doesn't transmit anything.
Hmmm.
public final class ConduitConfig {
private static final int MAX = 2_000_000_000; // 0x77359400, keep some headroom to MAX_INT
private static final int MAXIO = MAX / 2;
In im reading that right max storages is caped at 1Bill.... ill need henry to explain this one as i have no idea...
Note that my "analysis" is just an educated guess based on having seen problems like this before, albeit in C. I still can't really wrap my head around Java for the most part. :V
I tried some code-diving, but I can't even find the place where everything is (presumably) being added up - I could be entirely on the wrong path here. The numbers just added up a bit too nicely for me not to mention what I was thinking.
Im also new at java.. and i was having a hard time too.. thats why i was hoping for epic or henry to chime in because they are the experienced onces.
Reduce the values of your energy transfer.
Already done - that's how I realized it was an overflow problem. In this sense, I've fixed my experience with the bug.
A) nothing needs that much power
I blame the quantum quarries from Extra Utilities 2. I was hoping to add a few more. :(
B) your close to int_max which is most likely causing issues.
Pfft. Not even 1% of a signed int. ;)
Note, I'm not arguing the defaults here - those are reasonable for normal people - just that the config comments state that 1G is an acceptable maximum for the value:
# The maximum IO for the tier 3 power conduit. (synced from server) [range: 1 ~ 1000000000, default: 20480]
I:tier3_maxIO=204800
I'd suggest that read something more like 1 million or so, or possibly just add a disclaimer explaining the issue:
# The maximum IO for the tier 3 power conduit. (synced from server) [range: 1 ~ 1000000000,
# default: 20480, max recommended: 1000000]
I:tier3_maxIO=204800
OR
# Setting maxIO too high will cause problems! Recommended max for each is 1000000.
# The maximum IO for the tier 1 power conduit. (synced from server) [range: 1 ~ 1000000000, default: 640]
I:tier1_maxIO=6400
<snip>
That's a bit over 2000 conduits, and I don't think I'll hit that even with my absurd sprawling build style. Although if I stopped using the dimensional transcievers, I totally could...
I've had a bit more time to poke at the code, and it looks like getMaxEnergyStored() is where you'd put a fix, but I can't understand how that interacts with the rest of the code (i.e. how we get from that to max energy for the entire network.) I suspect that just hacking in an if-then statement to clamp the return value to 1G would end poorly. :V
@tyler489: Fun fact, that MAXIO value you dug up? It's only used when reading the configs as far as I can tell. ¯\(ツ)/¯
Edit: Oh look, you can see the values I bumped everything up to. Obviously if someone uses this idea, it should not be cut and pasted. ;p