Skip to content
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

Apply correct EU modifier for calculating parallels in the Volcanus. #3754

Draft
wants to merge 28 commits into
base: master
Choose a base branch
from
Draft
Changes from 4 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
86611ed
Apply correct EU modifier for calculating parallels in the Volcanus.
Jan 6, 2025
21aa120
Remove star imports.
Jan 6, 2025
9647b27
Merge branch 'master' into master
Dream-Master Jan 7, 2025
7984c6a
Merge branch 'master' into master
Dream-Master Jan 8, 2025
eb7cc52
Merge branch 'master' into master
Dream-Master Jan 9, 2025
d13a3c3
Merge branch 'master' into master
Dream-Master Jan 9, 2025
3d0bd19
Merge branch 'master' into master
Dream-Master Jan 10, 2025
d830d40
Merge branch 'master' into master
Dream-Master Jan 11, 2025
049cc3e
Merge branch 'master' into master
Dream-Master Jan 11, 2025
a257506
Merge branch 'master' into master
Dream-Master Jan 12, 2025
b509398
Merge branch 'master' into master
Dream-Master Jan 12, 2025
166a060
Merge branch 'master' into master
Dream-Master Jan 15, 2025
9af0df7
Merge branch 'master' into master
Dream-Master Jan 17, 2025
1563b4f
Merge branch 'master' into master
Dream-Master Jan 18, 2025
08a6654
Merge branch 'master' into master
Dream-Master Jan 19, 2025
82baa9f
Merge branch 'master' into master
Dream-Master Jan 20, 2025
540aa49
Merge branch 'master' into master
Dream-Master Jan 22, 2025
0837e41
Merge branch 'master' into master
serenibyss Jan 22, 2025
72b3884
Merge branch 'master' into master
Dream-Master Jan 23, 2025
b3875ed
Merge branch 'master' into master
Dream-Master Jan 25, 2025
bfed2a6
Merge branch 'master' into master
Dream-Master Jan 25, 2025
cda334c
Merge branch 'master' into master
Dream-Master Jan 25, 2025
612125f
Merge branch 'master' into master
Dream-Master Jan 26, 2025
980b664
Merge branch 'master' into master
Dream-Master Jan 27, 2025
671a131
Start rework of `ProcessingLogic`
Jan 29, 2025
392c2a8
Start rework of `ProcessingLogic`
Jan 29, 2025
40cc188
Small post-merge fixes
Jan 29, 2025
0cc90da
More work
Jan 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import gregtech.api.util.GTUtility;
import gregtech.api.util.MultiblockTooltipBuilder;
import gregtech.api.util.OverclockCalculator;
import gregtech.api.util.ParallelHelper;
import gregtech.api.util.shutdown.ShutDownReasonRegistry;
import gregtech.common.pollution.PollutionConfig;
import gtPlusPlus.core.block.ModBlocks;
Expand Down Expand Up @@ -254,6 +255,25 @@ protected OverclockCalculator createOverclockCalculator(@NotNull GTRecipe recipe
.setRecipeHeat(recipe.mSpecialValue)
.setMachineHeat((int) getCoilLevel().getHeat());
}

@NotNull
@Override
protected ParallelHelper createParallelHelper(@NotNull GTRecipe recipe) {
return new ParallelHelper().setRecipe(recipe)
.setItemInputs(inputItems)
.setFluidInputs(inputFluids)
.setAvailableEUt(availableVoltage * availableAmperage)
.setMachine(machine, protectItems, protectFluids)
.setRecipeLocked(recipeLockableMachine, isRecipeLocked)
.setMaxParallel(maxParallel)
.setEUtModifier(
euModifier
* Math.pow(0.95F, Math.floor((getCoilLevel().getHeat() - recipe.mSpecialValue) / 900F)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is now applying the heat EU/t discount twice (before and after parallel). Currently it seems like every machine that does a heat EU/t discount does this discount after parallel. This isn't necessarily a "bug," but a decision we need to make whether this discount should be applied before or after. If we decide to change it to before though, it should be changed deeper down in processinglogic rather than in a machine implementation like this

Copy link
Contributor Author

@Vlamonster Vlamonster Jan 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This behavior exists in all other machines afaik, and we only noticed a difference in the Volcanus because we use a spreadsheet to calculate overclocks for all machines up to UMV.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the behavior of other machines with heat discounts, MEBF, EBF, Vacuum Furnace, Gorge EBF modules all use similar heat discount mechanics but do not double apply like this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by double apply? It doesn't provide a double discount if that's what you're referring to. It just makes it so that it uses all available energy for parallels, i.e. if it can do another parallel then it will.

Copy link
Member

@serenibyss serenibyss Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The heat discount is applied during overclock calculation, here

double heatDiscountMultiplier = calculateHeatDiscountMultiplier();

As said in the Java docs of OverclockCalculator#setHeatDiscount, "Sets if we should add a heat discount at the end of calculating an overclock, just like the EBF." Volcanus does this discount after parallels during overclock, like EBF, MEBF, etc. so by adding this discount here you are doing this heat discount twice, once before parallel and once after.

Furthermore, if this change is to be accepted, the heat discount should be applied before parallel internally, instead of needing to do a hack like this PR. Though this needs discussion

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Vlamonster After some discussion I think this change should be made, but done in the lower down processing logic so it applies to all multis with this issue rather than just volcanus. Then implementers don't need to work around it either

.enableBatchMode(batchSize)
.setConsumption(true)
.setOutputCalculation(true);
}

}.setSpeedBonus(1F / 2.2F)
.setEuModifier(0.9F)
.setMaxParallelSupplier(this::getMaxParallelRecipes);
Expand Down
Loading