-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing the Chemistry, Take Two #1492
Conversation
Due to @DStrand1 's pull request here(GregTechCE#1414), the recipes for processing Uraninite into Uranium 238 were changed. One of the recipes, which outputs 144mb of liquid Aluminium, allows you to delay making a blast furnace until further materials are needed. By changing the EU/t cost of the recipe to require MV power, it ensures that you need to make your first aluminium from smelting in the blast furnace. In the future, uraninite processing needs to be looked at in more depth.
The last commit addressed an issue where Uraninite processing used an Aluminium Dust, and output 144mB Aluminium to conserve the material. However, since this was an LV recipe, it was possible to skip the EBF and simply do this reaction then Fluid Solidify the Aluminium. This recipe has been moved to MV to avoid this, and the duration was cut to incorporate the overclocking speed increase. If we implement the Uranium Processing changes discussed in #1426, this issue would no longer be present and can be resolved more effectively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have commend your bravery touching this area again.
I will leave checking if chemistry is correct/makes sense to community.
I like your idea to extract recipes to own files but would not be easier to have it machine per file?
I think this would make the most sense, but I was not sure if this was the path you wanted to take. I can create a subdirectory in recipes “chemistry” and create files for each machine (that has enough recipes to justify it, I will not make a file for 2 fluid heater recipes :) ). I have a few more things to add to this PR, and a few discussion points that I will post here when I can, but I’ve got things to do right now and am trying to just get a quick response down. As a result, I will temporarily convert this PR to draft. |
Sure go for it. I would rather not have own files for recipe maps with less then 5 recipes. |
With this above refactor, I separated the chemistry recipes into more files, as discussed above. I also added a few more methods to Supports blocks and items, meta value, and wildcard (input only). |
There was a recipe conflict with Hydrogen Sulfide in the Chemical Reactor: As you can see, these share identical inputs with only varying amounts. I added circuits to both of these recipes, of values 1 and 2 respectively. |
I want to really highlight this issue and make a case for implementing the Uraninite processing in #1426 soon, to avoid further issues. Before this PR, the EBF was entirely optional due to an exploit with Uraninite and Aluminium that output fluid Aluminium at LV-voltage. Even with this PR, the EBF is again required for an MV chemical reactor, but can easily be ignored and use this method instead, for less power usage and recipe time. This recipe is extremely problematic, and I think it should be either entirely removed, or we should add better Uraninite processing. I want to mention that there is the other recipe, outputting fluid Magnesium, which while not progression-breaking, is still a very bad recipe in my opinion. |
In this last commit, I fixed Yttrium Barium Cuprate Oxide and Tungstencarbide. YBCO: Tungstencarbide: This YBCO issue is definitely needed, since currently there is an Oxygen dupe bug present. The Tungstencarbide change may warrant further discussion, as there is inconsistencies as to how to handle this situation. The two arguments:
|
From codding perspective this looks good. I have bit of reservation regarding nonfunctional change to From chemical stand point, well I will wait for some community members to speak up. |
I changed two more things to address #1525:
|
The chemistry changes (up to the comments asking for feedback) all look good to me. I'll weigh in on the feedback requests: We had talked a bit about YBCO in Discord, but to recap I think the electrolysis argument is more persuasive there. This recipe is rather contrived as the real recipe for this stuff involves several chemicals that are not in GTCE, but otherwise is consistent with our chemistry rules expectations. The new behavior for Tungstencarbide and the change to the material definition for TiCl4 both make sense to me. The former is now consistent with other alloys, and the latter was clearly defined incorrectly. The recipe to make TiCl4 does involve Carbon as a reactant, but it definitely doesn't end up in that fluid. Given that there are no particularly tricky or rare materials in NZF, I don't think there's too substantial of a balance implication in giving it an accurate number of dusts for its formula (also considering that we basically did this for YBCO anyway). If it's possible to decompose this stuff, the ratio of the proposed recipe using an approximated half-mole of oxygen would lead to an imbalance, and it deviates from the rest of our chemistry overhauling that actively avoids doing partial moles. |
I will mark this as approved. But if there is need for change or addition then just do it. But if possible I would like to get it out on next release. |
In these last 5 commits, I finished up some last things discussed here and on Discord:
With these last few changes, this PR is finished and ready for merge. |
Unfortunate that the TNM recipe from before turned out to be imbalanced, good catch. The new one seems reasonable enough given our limitations. I agree the PR seems ready to go. Outside the scope of this PR, but it would be really helpful if at some point we could add a few more chemicals, as it would allow us to implement the actual processes rather than rough approximations that are harder to balance and often need circuits to prevent conflicts. |
Just this morning we got an issue reported regarding a recipe overlap between Invar and Ferrite Mixture in the mixer. While this PR is correcting the formula for NZF, It would probably be a good idea to also disambiguate these recipes, as Invar is a subset of the ingredients of Ferrite Mixture. |
Lastly, I removed electrolysis recipes for 5 materials:
All 5 of these had electrolysis recipes as dusts only, and since the chemistry for polymerized plastics in GTCE is a little... inaccurate due to the transition from dust to ingot moles, these were removed for safety. I doubt many people even knew they existed anyway. |
* update advanced item/fluid detectors' tooltip * small changes
Introduction
This PR is a continuation of #1414, addressing a few dangling issues, adding some new Electrolysis, and a few more recipes that help make our chemistry more robust. Additionally, I included a major refactor of our
ChemistryRecipes
file to make it much easier to read and edit later on down the road.The Refactor
Here is an example of a newly refactored chemistry recipe:
The method calls are organized as follows:
Additionally, as you can see from the
output
line, I added a couple methods intoRecipeBuilder
to allow for the same syntax on outputs that we could already do ininput()
. With this change, we do not need to calloutputs(OreDictUnifier.get(dust, Carbon, 2))
, and instead justoutput(dust, Carbon, 2)
.I also separated out multiline additions into their own lines for readability. When doing this, I made sure to maintain the original ordering. In some cases, this shouldn't matter, but in others (Distillation Tower), it is very important.
Old Format:
New Format:
This made some files very long, so I separated our
ChemistryRecipes
file out, having a new one calledReactorRecipes
that contains all the Chemical Reactor recipes previously inChemistryRecipes
.Additionally I added several static imports to remove some unnecessary verbosity such as
MaterialIconSet.DULL
,Materials.Carbon
,RecipeMaps.CHEMICAL_REACTOR
to keep the code as clean as possible. I also pulled the recipes fromMachineRecipeLoader#registerChemicalRecipes()
and put them intoChemistryRecipes
andReactorRecipes
to keep everything together.Chemistry Fixes
There were a total of 6 outstanding issues remaining that I did not address in #1414. They are all quite minor, either adjusting amounts, or changing an output material.
0.5C₆H₆ + 2Cl -> HCl + 0.5C₆H₄Cl₂
This recipe lost 0.5B of Chlorine on each reaction. The new recipe:
C₆H₆ + 4Cl -> 2HCl + C₆H₄Cl₂
Old:
2HF + CHCl₃ -> 3HCl(dil.) + 0.5C₂F₄
New:
4HF + 2CHCl₃ -> 6HCl + C₂F₄
Old:
2Cl + H₂O -> HCl(dil.) + HClO
New:
2Cl + H₂O -> HCl + HClO
Old:
P + 2.5O + 1.5H₂O -> H₃PO₄
New:
2P + 5O + 3H₂O -> 2H₃PO₄
Old:
1 Sulfuric + 1 Nitric -> 1 Nitration Mixture
,1 Nitration Mixture -> (electrolyzer) 1 Sulfuric + 1 Nitric
New:
1 Sulfuric + 1 Nitric -> 2 Nitration Mixture
,2 Nitration Mixture -> (centrifuge) 1 Sulfuric + 1 Nitric
This is a precedent being set by our chemistry, that I have already been incorporating in similar mixtures in Gregicality, as they have others on top of this (like Aqua Regia).
DISABLE_DECOMPOSITION
. In base GTCE, this recipe was impossible, since it took well over a stack of material to electrolyze it. It does not make sense to me to have this recipe enabled when it is entirely impossible to do in the mod by itself. There was an (ancient) issue Zeolite Dust Electrolyzing Recipe has input over ItemStack size #354 that said this recipe will only be possible in a multiblock Electrolyzer, and I think at this point it is safe to say we have no intention to add this multiblock to GTCE. As a result, I will re-enable electrolysis for it in Gregicality since they have the Large Electrolyzer multiblock.Chemistry Additions
I re-enabled electrolysis of some organic chemicals (much to the chagrin of many chemists) to match how the others were already handled. I added a few special recipes though, not using the standard generated electrolysis format.
Custom Electrolysis Recipes:
2CH₃COOH -> H₃CCH₃ + 2CO₂ + 2H
These next three are based loosely on realistic chemical processes, more accurate than straight decomposition:
2CH₃Cl -> H₃CCH₃ + 2Cl
(creates Ethane)NaOH(catalyst) + CH₃COOCH₃ + H₂O -> CH₃COOH + CH₃OH
(creates Acetic Acid and Methanol)2C₃H₆O -> C₃H₈ + 3C + 2H₂O
(creates Propane)New Chemical Reactor Recipes:
NaHSO₄ + H₂O -> NaOH + H₂SO₄
With this recipe, we now have a loop with its formation recipe:
NaCl + H₂SO₄ -> HCl + NaHSO₄
As a result, given Water and Salt, we can transform them into Sodium Hydroxide and Hydrochloric Acid, giving them a new and interesting production method.
C₆H₆ + O -> C₆H₅OH
This recipe is theoretically possible, though has not yet been done in a real-world situation. As a result, I made this recipe EV Tier to reflect its chemical difficulty. Unfortunately I was not able to use the Oxidation of Toluene recipe since it has too many fluid outputs to put in a Chemical Reactor.
C₆H₄Cl₂ + 2NaOH -> C₆H₅OH + 2NaCl + O
I modified it from the standard process since it uses Chlorobenzene and not Dichlorobenzene, which we do not have in GTCE.
C₃H₈O₃ + CO₂ -> 2C₂H₄ + 5O
This recipe is quite significant in terms of creating Polyethylene, so I made it HV, meaning that when the player creates mass amounts of Glycerol for Epoxy, they can now also use it for Ethylene.
Outcome
Compatibility
This PR has similar potential compatibility issues as #1414, though this time only 5 existing recipes were modified, so its impact will be a lot less.