Xalcon / EnergyConverters

Simple mod which provides a few blocks which can convert energy from and to EU or RF
MIT License
12 stars 17 forks source link

Bug of outputting EU #52

Closed ProperSAMA closed 4 years ago

ProperSAMA commented 4 years ago

If 1 Fe energy consumer, 1 energy bridge, multiple IV energy consumers (IC2) are used.All IV energy consumers (IC2) will output EU. With several IV energy consumers, you can output several times of EU.

This is an example: https://upload.cc/i1/2019/10/28/Pd8JIj.png https://upload.cc/i1/2019/10/28/WuZM7q.png On the right is the vibrant photovoltaic cell from enderio. It can generate up to 160. On the left is the molecular transformer of advancedsolarpanels. I use it to see how much EU is output. In exchange for EU, it should be able to generate 40. But it generated 80 EU.If I use one more IV energy consumer. Output will be higher. It seems that every IV energy consumer will output EU once.

Minecraft Version: 1.12.2 Forge Version: 14.23.4.2705 and 14.23.5.2847. (There are problems with both versions.) EnergyConverters Version: 1.3.3.19 IndustrialCraft Version: 2-2.8.187-ex112 AdvancedSolarPanels Version: 4.2.0

In addition, can we add more advanced EU energy consumers? For some mods, IV is not enough.

Xalcon commented 4 years ago

I was able to reproduce the bug. I'll need to go to work soon, so the fix will have to wait a few hours.

In addition, can we add more advanced EU energy consumers? For some mods, IV is not enough.

As far as I remember, the IC2 energy API does not support higher energy transfers than IV. IC2 Itself only really uses EV. Energy Converters already breaks the balancing of a lot of mods (especially Buildcrafts), adding even higher energy transfers just feels out of scope of this mod.

ProperSAMA commented 4 years ago

adding even higher energy transfers just feels out of scope of this mod.

I only think about IC2. Too many machines make the game lag. So I used modular machinery to make machines that generate more power. Direct output of EU will cause some problems. So I used your mod. Your idea makes sense. Thank you for your reply. I will wait for you to fix this bug.

Xalcon commented 4 years ago

Okay, this problem is a bit more complicated than expected. IC2 asks each block how much power they can provide and then requests that power. The issue here is, if you use 2 or more producers on a single energy bridge, IC2 doesnt know they are providing power from the same source. In fact, the IC2 Energy net asks each tile how much power they can provide and THEN requests that power. Assuming we have 10k Energy in the Bridge, each producer tells IC2 there are 10k energy buffered (2.5k converted to EU), which means IC2 thinks that it can get 20k. There are no additional checks, so there is no way for me to tell IC2 otherwise.

The Energy Bridge + Producers could be considered a multiblock structure. IC2 does have an interface to work with multiblocks, but that API expects that the whole structure uses only one power tier (i.e. LV, MV, HV, etc). The current design of energy converters allows to use different producer tiers at once though. I could probably make it so you can only use the same IC2 producer tier on a single bridge, but communicating that is rather hard.. especially because it was working "fine" in the past.

I will use a different route and probably re-design the whole mod in 1.14 (or 1.15, depending on how fast IC2, Buildcraft, etc update).

Xalcon commented 4 years ago

the bug has been fixed in 1.3.4.22. The IC2 producers now have a small internal buffer to prevent this issue. The mod is currently awaiting approval on curseforge and should be available shortly.

ProperSAMA commented 4 years ago

After my testing, this bug has been fixed. Thank you for your work!