View Issue Details

IDProjectCategoryView StatusLast Update
0002345Industrial-Craft²crossmod-compatibility / submodules / APIpublic2020-12-22 09:33
ReporterOrygeunik Assigned Toestebes  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Summary0002345: New oil refinery from buildcraft (BC8 / 7.99+)
DescriptionHello
In buildcraft was changed oil processing system (in BC8 version). Now oil refineries processing to gas and some liquid fuel. On screen some results of oil processing.

So, semifluid generator can take only "raw oil" (not processing), but in config contains lines:
semiFluidOil = 1.0
semiFluidFuel = 1.0
semiFluidBiomass = 1.0
semiFluidBioethanol = 1.0
semiFluidBiogas = 1.0

This lines actual to old version of buildcraft, in new - no one take new fluids.
Please add support for new fluids, thanks!
Tagsbuildcraft, Fluid, Oil
Minecraft Version1.12.2

Relationships

has duplicate 0002402 resolvedChocohead Semifluid generator won't accept BuildCraft fuels 
has duplicate 0002431 resolved Buildcraft 7.99 fuels not working in semifluid generator. 

Activities

Orygeunik

2018-03-12 19:31

reporter  

oils.png (64,919 bytes)   
oils.png (64,919 bytes)   

Orygeunik

2018-03-12 19:34

reporter   ~0005608

Found link to system new scheme
https://imgur.com/gallery/AXUOX#bZcu6ie
P.S.
fluids have temperature

Chocohead

2018-03-16 02:37

developer   ~0005609

BuildCraft is still in alpha and so hasn't really worked out the final fuel values for all the different oil variants. When it stabilises a bit more in beta this will definitely be something that will be looked into.

Orygeunik

2018-03-16 19:19

reporter   ~0005610

Thanks for answering. But buildcraft with new oil system version of 7.99.0 started at 10-04-2017 (april of 2017 year). Alpha goes so 1 approximately year. So maybe you can add support this request and add to configure values of the oils?

Golias

2018-04-15 09:54

reporter   ~0005649

Currently liquids have 3 temperatures: Cold, Hot, Searing. In BC8, only the cold temperature can be used in engines. This forces players to use Heat Exchanger to cool down the liquid. Each cooling/warm has a energy cost in MJ. My suggestion is that we leave the details of balancing between these to BC8 team, and focus only on the cold version of the liquid, that has a direct conversion to MJ in BC8, via their engines. This allow us to look at the values of MJ for the different fluids to set the correct conversion to EU.

The current conversion ratio of a bucket of OIL to EU (the natural occurring oil in BC8 and below) can be our reference point: I will call it EU_PER_OIL, whose unit is [EU/B], B of bucket (this should be somewhere in the IC2 source code).

Taking the reference point of OIL (called crudeOil in BC8), the conversion to EU can be made: for a given fluid X, the EU/B is given by

`EU_PER_X = MJ_PER_X/MJ_PER_OIL * EU_PER_OIL`

We only need the values of MJ_PER_X, unit [MJ/B], of each fluid X in BC8. Attached (1) I present their current values and a script to get them. Using the equation above,
we get that the energy (EU/B) that the semifluid generator should generate from each fluid should be given by:

BCEnergyFluids.fuelGaseous = EU_PER_OIL*1/2
BCEnergyFluids.fuelLight = EU_PER_OIL*2
BCEnergyFluids.fuelDense = EU_PER_OIL*4
BCEnergyFluids.fuelMixedLight = EU_PER_OIL*8/10
BCEnergyFluids.fuelMixedHeavy = EU_PER_OIL*8/5
BCEnergyFluids.oilDense = EU_PER_OIL*4
BCEnergyFluids.oilDistilled = EU_PER_OIL
BCEnergyFluids.oilHeavy = EU_PER_OIL*8/3
BCEnergyFluids.crudeOil = EU_PER_OIL

------------------------------------------------------------------

(1)

I attached a small Python 3 script that reads the values from the source code of BuildCraft 8.x and prints their MJ/B, so that we can update them as needed.
The current values (cross-validated by an independent calculation [here](https://docs.google.com/spreadsheets/d/1mOopGxzo5GOWQhECv3inwmpZi-ZQ3IjJPzq76UkMDVk/edit#gid=0)) are:

Total power (MJ/B) of each of the BuildCraft fluids:
BCEnergyFluids.fuelGaseous = 15.000
BCEnergyFluids.fuelLight = 60.000
BCEnergyFluids.fuelDense = 120.000
BCEnergyFluids.fuelMixedLight = 24.000
BCEnergyFluids.fuelMixedHeavy = 48.000
BCEnergyFluids.oilDense = 120.000
BCEnergyFluids.oilDistilled = 30.000
BCEnergyFluids.oilHeavy = 80.000
BCEnergyFluids.crudeOil = 30.000
read_bc_mj_values.py (2,456 bytes)   
"""
Script to extract the total amount of MJ of the different fluids of BuildCraft 8+.
"""
import re
import argparse
import urllib.request


DEFAULT_URL = 'https://raw.githubusercontent.com/BuildCraft/BuildCraft/8.0.x/common/' \
              'buildcraft/energy/BCEnergyRecipes.java'


def _parse_total_power(code):
    # read the constants in the file
    constants = {}
    for x in re.findall(r'final int (.*?) = (\d*)', code):
        constant, value = x
        if constant == 'TIME_BASE':
            value = int(value) * 1000
        constants[constant] = int(value)

    # read the assigned values in the function
    amount_diffs = {}
    for x in re.findall(r'add(Dirty)?Fuel\((.*?), (.*?), (\d*?)\)', code):
        _, fluid, amountDiff, multiplier = x
        if amountDiff not in constants:
            raise ValueError('The source code can\'t be read. It should have changed')
        amount_diffs[fluid] = constants[amountDiff]

    # print the total power of each fluid:

    # total power = totalTime * powerPerCycle = multiplier * MjAPI.MJ * (TIME_BASE / multiplier / amountDiff) <=>
    # total power = MjAPI.MJ * TIME_BASE / amountDiff

    total_power = {}
    for fluid in amount_diffs:
        total_power[fluid] = constants['TIME_BASE'] // amount_diffs[fluid]

    return total_power


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("--url",
                        help="The url of the file that contains the BC energy recipes, "
                             "BCEnergyRecipes.java. Something starting with https://raw.githubusercontent",
                        type=str)
    parser.add_argument("--file",
                        help="The location of the file that contains the BC energy recipes, "
                             "BCEnergyRecipes.java.",
                        type=argparse.FileType('r', encoding='UTF-8'))

    args = parser.parse_args()

    if args.file is None:
        # read the content of the relevant source
        if args.url is None:
            url = DEFAULT_URL
        else:
            url = args.url

        with urllib.request.urlopen(url) as f:
            code = f.read().decode('utf-8')
    else:
        code = args.file.read()

    total_power = _parse_total_power(code)
    print('Total power (MJ/B) of each of the BuildCraft fluids:')
    for fluid in total_power:
        print('%s = %d' % (fluid, total_power[fluid]))


if __name__ == '__main__':
    main()
read_bc_mj_values.py (2,456 bytes)   

Nazrac

2018-08-18 15:08

reporter   ~0005780

So this doesn't seem to be an important issue to you to fix, seems like the values are pretty stable, so can you point me in the right direction to where your values are @ and I will try to learn how to change it? I am not versed in Java or MC mods but I am a controls engineer so hopefully I can figure it out.

Chocohead

2018-08-19 17:54

developer   ~0005784

It's not that it isn't an important issue for us to fix, it is simply that Buildcraft hasn't been moving very quickly itself. MJ has been in the process of changing for months without any actual changes pushed to end users. It remains Buildcraft that is being waited on, and once it has worked out it's own values we can add ours comparatively quickly.

If you particularly wanted to add your own values in the mean time and deal with any issues that arises from it yourself, they can be added via ic2.api.recipe.Recipes.semiFluidGenerator (in the API)

Nazrac

2018-08-21 15:09

reporter   ~0005785

Let me rephrase that, the values seem pretty set for quite a while now. Seems like it should be added based off current values, either way I will have a crack at it, I need to figure out what the tags are for their fluids as I would like ti preserve the idea that fluids need to be cool to burn, I also am considering using the seering fluids for the heat exchanger, logically I would think I/P seering and O/P cool. I am not sure how the mechanics would work for heat values though. In BC 1mb seering heats 1mb of a fluid to the next state and vice versa, this frim a heat transfer standpoint is completely wrong but that's not the point here, the question is how much heat for the heat generator is generated by 1mb of seering fluid and should it go to hot or cool?

orangelynx

2019-02-05 17:10

reporter   ~0005904

For anyone coming across this and seeking an immediate solution see this thread / addon:

https://forum.industrial-craft.net/thread/15569-ic2-exp-1-12-2-ic2-extra-fuels/

Golias

2019-08-11 07:54

reporter   ~0006117

I went through the values again, and my opinion is that BC still needs to balance their values. I fielded the request here: https://github.com/BuildCraft/BuildCraft/issues/4460

matt96

2020-01-24 23:52

reporter   ~0006171

the buildcraft issue have some update:

AlexIIL commented on 4 Dec 2019:
----
I've implemented some similar values (although slightly lower) in 7.99.24.4 (https://mod-buildcraft.com/buildcraft-799244.html).
----

orangelynx

2020-06-14 10:02

reporter   ~0006262

@estebes could you explain how this issue was resolved? Was there a patch that fixes this? If so please link the changelog.

estebes

2020-06-14 10:23

developer   ~0006263

Starting with build 215 the semifluid generator and the fluid heat generator accept the new bc fluiids

Golias

2020-12-22 09:33

reporter   ~0006289

For reference, the values from the BuildCraft after that update are:

Total power (MJ/B) of each of the BuildCraft fluids:
BCEnergyFluids.fuelGaseous = 15000
BCEnergyFluids.fuelLight = 90000
BCEnergyFluids.fuelDense = 360000
BCEnergyFluids.fuelMixedLight = 30000
BCEnergyFluids.fuelMixedHeavy = 96000
BCEnergyFluids.oilDense = 120000
BCEnergyFluids.oilDistilled = 37500
BCEnergyFluids.oilHeavy = 80000
BCEnergyFluids.crudeOil = 30000

The code was updated, and I have uploaded the script that parses them on this note (that reproduce the values above).
read_bc_mj_values-2.py (2,615 bytes)   
"""
Script to extract the total amount of MJ of the different fluids of BuildCraft 8+.
"""
import re
import argparse
import urllib.request


DEFAULT_URL = 'https://raw.githubusercontent.com/BuildCraft/BuildCraft/8.0.x-1.12.2/common/buildcraft/energy/BCEnergyRecipes.java'


def _parse_total_power(code):
    # read the constants in the file
    constants = {}
    for x in re.findall(r'final int (.*?) = (\d*)', code):
        constant, value = x
        if constant == 'TIME_BASE':
            value = int(value) * 1000
        constants[constant] = int(value)

    # read the assigned values in the function
    amount_diffs = {}
    for x in re.findall(r'add(Dirty)?Fuel\((.*?), (.*?), (\d*?)\, (\d*?)\)', code):
        _, fluid, amountDiff, multiplier, boostOver4 = x
        if amountDiff not in constants:
            raise ValueError('The source code can\'t be read. It should have changed')
        amount_diffs[fluid] = {
            'value': constants[amountDiff],
            'boostOver4': int(boostOver4),
        }

    # print the total power of each fluid:

    # total power = totalTime * powerPerCycle = multiplier * MjAPI.MJ * (TIME_BASE * (boostOver4 / 4) / multiplier / amountDiff) <=>
    # total power = MjAPI.MJ * TIME_BASE * (boostOver4 / 4) / amountDiff

    total_power = {}
    for fluid, item in amount_diffs.items():
        total_power[fluid] = constants['TIME_BASE'] * (item['boostOver4'] / 4) // item['value']

    return total_power


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("--url",
                        help="The url of the file that contains the BC energy recipes, "
                             "BCEnergyRecipes.java. Something starting with https://raw.githubusercontent",
                        type=str)
    parser.add_argument("--file",
                        help="The location of the file that contains the BC energy recipes, "
                             "BCEnergyRecipes.java.",
                        type=argparse.FileType('r', encoding='UTF-8'))

    args = parser.parse_args()

    if args.file is None:
        # read the content of the relevant source
        if args.url is None:
            url = DEFAULT_URL
        else:
            url = args.url

        with urllib.request.urlopen(url) as f:
            code = f.read().decode('utf-8')
    else:
        code = args.file.read()

    total_power = _parse_total_power(code)
    print('Total power (MJ/B) of each of the BuildCraft fluids:')
    for fluid in total_power:
        print('%s = %d' % (fluid, total_power[fluid]))


if __name__ == '__main__':
    main()
read_bc_mj_values-2.py (2,615 bytes)   

Issue History

Date Modified Username Field Change
2018-03-12 19:31 Orygeunik New Issue
2018-03-12 19:31 Orygeunik File Added: oils.png
2018-03-12 19:31 Orygeunik Tag Attached: buildcraft
2018-03-12 19:31 Orygeunik Tag Attached: Fluid
2018-03-12 19:31 Orygeunik Tag Attached: Oil
2018-03-12 19:34 Orygeunik Note Added: 0005608
2018-03-16 02:37 Chocohead Status new => acknowledged
2018-03-16 02:37 Chocohead Note Added: 0005609
2018-03-16 19:19 Orygeunik Note Added: 0005610
2018-04-15 09:54 Golias File Added: read_bc_mj_values.py
2018-04-15 09:54 Golias Note Added: 0005649
2018-08-03 23:40 Chocohead Relationship added has duplicate 0002402
2018-08-18 15:08 Nazrac Note Added: 0005780
2018-08-19 17:54 Chocohead Note Added: 0005784
2018-08-21 15:09 Nazrac Note Added: 0005785
2018-10-15 16:39 Chocohead Relationship added has duplicate 0002431
2019-02-05 17:10 orangelynx Note Added: 0005904
2019-08-11 07:54 Golias Note Added: 0006117
2020-01-24 23:52 matt96 Note Added: 0006171
2020-06-04 16:49 estebes Assigned To => estebes
2020-06-04 16:49 estebes Status acknowledged => resolved
2020-06-04 16:49 estebes Resolution open => fixed
2020-06-14 10:02 orangelynx Note Added: 0006262
2020-06-14 10:23 estebes Note Added: 0006263
2020-12-22 09:33 Golias File Added: read_bc_mj_values-2.py
2020-12-22 09:33 Golias Note Added: 0006289