New power-GC3.conf option not working

Discussion in 'Support' started by Pyure, Jan 29, 2015.

  1. Pyure

    Pyure Member

    Joined:
    Jan 19, 2015
    Messages:
    14
    Likes Received:
    2
    Greetings folks :)

    The team recently added a new option to allow lossy conversions via the Energy Storage Module/Cluster blocks.

    I can't get it to work with anything other than 100. Tried 50, 75, 99, 100. Works properly at 100, but block accepts no power at other values.

    To replicate:
    Change this option
    I:"Loss factor when converting energy as a percentage (100 = no loss, 90 = 10% loss ...)"=100
    To (any other integer)
    I:"Loss factor when converting energy as a percentage (100 = no loss, 90 = 10% loss ...)"=99

    The block makes connections but accepts no power.

    Tested with both Energy Storage Module and Energy Storage Cluster.
    Tested with both MFSU (IC2) and various EnderIO capacitors as energy providers.
    Confirmed using correct input dot (blocks suddenly receive power when you switch back to 100).
     
  2. radfast

    radfast Administrator
    Staff Member

    Joined:
    Apr 27, 2014
    Messages:
    1,143
    Likes Received:
    352
    Oops, not sure what's gone wrong there but I'll take a look.
     
  3. Pyure

    Pyure Member

    Joined:
    Jan 19, 2015
    Messages:
    14
    Likes Received:
    2
    Just for fun, if it were my code I'd probably be implicitly converting a value to an integer when I wanted it to remain a float, and instead of "energy_multiplier=0.47" I'd be getting "energy_multiplier=0"

    Common mistake for me when dealing with percentages :)
     
  4. Pyure

    Pyure Member

    Joined:
    Jan 19, 2015
    Messages:
    14
    Likes Received:
    2
    Actually I just looked at the commit. I don't know java from mandarin chinese tbh, but in many languages, including C iirc, that line would evaluate int/int = int, and then assign that to the factor (float) variable.

    Code:
    ....
    float factor = conversionLossFactor / 100;
    ....
    
    A simple fix is to cast one value or the other to float before dividing. Maybe doesn't apply to Java?

    ...None of which explains the fact that no power is transferred. Ultimately I'd expect this to evaluate to "no loss at all" rather than "no transfer at all."
     
    #4 Pyure, Jan 30, 2015
    Last edited: Jan 30, 2015
  5. radfast

    radfast Administrator
    Staff Member

    Joined:
    Apr 27, 2014
    Messages:
    1,143
    Likes Received:
    352
    I think you've nailed it.
     
  6. Pyure

    Pyure Member

    Joined:
    Jan 19, 2015
    Messages:
    14
    Likes Received:
    2
    Good thing we don't divide by factor :)
     
  7. Pyure

    Pyure Member

    Joined:
    Jan 19, 2015
    Messages:
    14
    Likes Received:
    2
    @radfast, I see you already released a fix for this. Just wanted to express my gratitude, thanks kindly sir.
     
    Ezer'Arch and Vigilantecow like this.
  8. Hanakocz

    Hanakocz Member

    Joined:
    Dec 14, 2013
    Messages:
    117
    Likes Received:
    2
    Radfast is good at repairing things, which we can deliver to him. :)
     
  9. Pyure

    Pyure Member

    Joined:
    Jan 19, 2015
    Messages:
    14
    Likes Received:
    2
    Hope so, have two new errors connected to this issue that @radfast can hopefully assist with :)

    1) Ratio Flipped?
    I think the loss ratio is flipped. At 100 I get "normal" throughput, 4RF->1EU, which is good. (Arrow instead of colon because a Loss means its not a bi-directional ratio)

    But then the conversion scales upwards instead of downwards. At 50% "Loss Factor" I expected something like 8RF->1EU, but got 1RF->1EU instead. At 10% Loss, I got 1RF->25EU or something of that sort.

    2) Infinite Power?
    In some circumstances the energy storage cluster seems to try to subtract X amount of power from a NEARLY empty source (EIO Capacitor Bank, 3RF remaining) and keeps incrementing its own internal buffer. Its not subtracting that 3RF from the source, but is adding XRF internally.

    Tested in 261 with EnderIO Capacitor Bank as energy producer, energy storage cluster as bridge, MFSU as consumer.
     
  10. radfast

    radfast Administrator
    Staff Member

    Joined:
    Apr 27, 2014
    Messages:
    1,143
    Likes Received:
    352
    1) It's possible it's flipped, I'll run some tests. I don't understand exactly what you mean by RF -> EU. Galacticraft's own energy units are gJ and all other mods' energy units get converted internally into that.

    2) Why do you think the infinite power issue you described is in Galacticraft and not one of the other mods you are using? In any case, please provide a screenshot + specify your setup precisely - including, in particular, which types of wires you are using, that's kinda important.
     
  11. Pyure

    Pyure Member

    Joined:
    Jan 19, 2015
    Messages:
    14
    Likes Received:
    2
    Hi radfast, I'll try to get you some screenshots asap. Might not be for the next 24 hours. In the meantime:

    * My apologies, I should have been more clear and said RF->gJ->EU
    * No wiring used. To keep the test as simple as possible I did a Ender IO Capacitor Bank (RF) outputting into a GalactiCraft Energy Storage Module (gJ) -> outputting into a IC2 MFSU (EU).

    The problem is noticeable even without the end consumer (MFSU) because the Storage Module increases its internal buffer very quickly while consuming negligible quantities of RF (while at 10 "loss"). At 10 loss-factor, I should be creating negligible quantities of gJ, otherwise this is actually a "Super Efficiency Bonus Factor".

    Hope this helps, and I'm very happy to answer further questions.
     
  12. radfast

    radfast Administrator
    Staff Member

    Joined:
    Apr 27, 2014
    Messages:
    1,143
    Likes Received:
    352
    OK I see what's happening here. It's not because the sign is flipped, it's more subtle than that.
    If you test using aluminum wire connections, I think you will find the numbers are OK. Mostly.
     
  13. radfast

    radfast Administrator
    Staff Member

    Joined:
    Apr 27, 2014
    Messages:
    1,143
    Likes Received:
    352
    Please try out version 3.0.8.265. The loss ratio is now behaving perfectly in my testing, and no power is being "created" at any point. But it could maybe do with more testing, I have not tested every possible permutation as there are 32.

    Some permutations are:
    GC machine -> Other mod machine
    GC machine -> Alu wire -> Other mod machine
    GC machine -> Other mod wire -> Other mod machine
    Other mod machine -> GC machine
    Other mod machine -> Alu wire -> GC machine
    Other mod machine -> Other mod wire -> GC machine
    Charge GC item in other mod machine (only valid for IC2 and Mekanism machines)
    Discharge GC item in other mod machine (only valid for IC2 and Mekanism machines)
    Charge other mod item in GC machine (only valid for IC2 and Mekanism items)
    Discharge other mod item in GC machine (only valid for IC2 and Mekanism items)

    These could be tested for all four power mods, and if we want to get fancy, IC2 can be tested separately in Minecraft 1.7.2 and 1.7.10 (it's different code in each).

    It's not really necessary to test combinations of 3 mods (e.g EU -> gJ -> RF). If EU -> gJ is working and gJ -> RF is working then the triple should also work.
     
  14. Pyure

    Pyure Member

    Joined:
    Jan 19, 2015
    Messages:
    14
    Likes Received:
    2
    Thanks sir. I've been out of action for a couple weeks (machine not behaving). I'll test asap and report.
     
  15. Pyure

    Pyure Member

    Joined:
    Jan 19, 2015
    Messages:
    14
    Likes Received:
    2
    Tested in 266. Works as expected, and with perfect precision too.

    1,000,000RF -> X gJ -> 240,000EU (0% loss, forgot to note X)
    1,000,000RF -> 122,000gJ -> 61,000EU (50% loss)

    50% loss produces 25% energy at end destination as expected, because the loss occurs twice. This is absolutely perfect.

    Thanks again radfast.
     
  16. radfast

    radfast Administrator
    Staff Member

    Joined:
    Apr 27, 2014
    Messages:
    1,143
    Likes Received:
    352
    Np, I think this is a useful improvement to the mod, and will certainly help guys who are aiming to make high-quality, balanced modpacks.
     

Share This Page