Skip to content

Commit 2a8e49b

Browse files
authored
Change electric machine overclock formula (#1038)
According to my computations, it should now take roughly `30 seconds * (1 + log(K) + log(recipe base time / 30 seconds))` time to craft `K` recipes, for large `K`. For example, to craft a recipe 128 times, it should be about `4 minutes + 30 seconds * log(recipe base time / 30 seconds)`. The maximum overclock is now about 600... Efficiency cool-down can take a while, but that's an unintended side effect. 😈
1 parent 6566dd5 commit 2a8e49b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/main/java/aztech/modern_industrialization/machines/components/CrafterComponent.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,10 @@ && putFluidOutputs(recipe, true, false) && recipe.conditionsMatch(conditionConte
385385
}
386386
}
387387

388-
public static double getEfficiencyOverclock(int efficiencyTicks) {
389-
return Math.pow(2.0, efficiencyTicks / 32.0);
390-
}
391-
392388
private long getRecipeMaxEu(long recipeEu, long totalEu, int efficiencyTicks) {
393389
long baseEu = Math.max(behavior.getBaseRecipeEu(), recipeEu);
394-
return Math.min(totalEu, Math.min((int) Math.floor(baseEu * getEfficiencyOverclock(efficiencyTicks)), behavior.getMaxRecipeEu()));
390+
long overclockedEu = baseEu + efficiencyTicks * totalEu / (20 * 30);
391+
return Math.min(totalEu, Math.min(overclockedEu, behavior.getMaxRecipeEu()));
395392
}
396393

397394
private int getRecipeMaxEfficiencyTicks(MachineRecipe recipe) {

0 commit comments

Comments
 (0)