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

Change to MultiBlockBase drainEnergy #3872

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WaterOtter86
Copy link

Allows them to use all power in all hatches instead of trying to use single hatch and on fail trying to use next one.

Allows them to use all power in all hatches
@FourIsTheNumber FourIsTheNumber added the Affects Balance Change affecting balance. Requires admin approval before merging. label Jan 30, 2025
@FourIsTheNumber
Copy link
Contributor

FourIsTheNumber commented Jan 30, 2025

This is better, more consistent behavior... but implementing this pr will allow double and triple tierskipping to work for all recipes guaranteed. This has potentially major balance impact! IMO this change needs to come with a formal change to tierskipping where machines universally limit tierskips to 1 (perhaps with exceptions for e.g megas)

For instance, you will now be able to double tierskip assembler with LSAA, which usually did not work due to eu numbers and the old implementation. That's a lot of recipes to check to ensure this is not gamebreaking.

EDIT: Bad example as HoleFish explained. But there are still many machines not using ExtendedPower logic.

@HoleFish
Copy link
Contributor

you will now be able to double tierskip assembler with LSAA, which usually did not work

LSAA inherits from MTEExtendedPowerMultiBlockBase so it probably works like AL does

@FourIsTheNumber
Copy link
Contributor

LSAA inherits from MTEExtendedPowerMultiBlockBase so it probably works like AL does

I did not realize ExtendedPower had different drain logic. That means a lot of new and old machines can multi-tierskip consistently, so I guess this is not as large a change as I would have thought. I still think the tierskip limit should be formalized though.

@WaterOtter86
Copy link
Author

WaterOtter86 commented Jan 30, 2025

For instance, you will now be able to double tierskip assembler with LSAA, which usually did not work due to eu numbers and the old implementation. That's a lot of recipes to check to ensure this is not gamebreaking.

Hm, this is an interesting issue. I thought it wouldn't affect tiering that much since materials were blocking enough. Perhaps we could limit which machines can use this? Like all assemblers are disabled from skipping that much?
Tho power cost alone on this might be enough to limit skipping mostly.

@FourIsTheNumber
Copy link
Contributor

Hm, this is an interesting issue. I thought it wouldn't affect tiering that much since materials were blocking enough. Perhaps we could limit which machines can use this? Like all assemblers are disabled from skipping that much? Tho power cost alone on this might be enough to limit skipping mostly.

Materials might block in most cases but likely not all, the problem is that there are so, so, so many recipes that could potentially be affected. Power cost will never be a meaningful limit on tierskipping because anyone is going to be willing to spend 16A for a minute to get some qol item a tier ahead or some other valuable skip.

This is why I say tierskipping should be formalized as a mechanic - instead of this very confusing current approach where double tierskip works sometimes but powerfails on other recipes depending on cost and machine and discount... this pr is definitely a step in that direction but I think it's dangerous to allow so many tierskips to work consistently (and with too many recipes for anyone to practically check) without doing more to limit tierskips.

For instance, default tierskip could be 1 for most machines - if you use 8 energy hatches, it can use that power to overclock or parallel, but cannot use it to perform recipes with base cost 2 tiers above the hatch tier.

@WaterOtter86
Copy link
Author

I would have to check how exactly overclocks and parralerls work here but it shouldn't be hard, tho machine doesn't get directly the power tier right? Just EU ammout.

@Ruling-0
Copy link
Contributor

If you want a good major example of double tierskip: PBI in LCR.

I would have to check how exactly overclocks and parralerls work here but it shouldn't be hard, tho machine doesn't get directly the power tier right? Just EU ammout.

Yes my understanding of the functions is you can pull the voltage and the amperage of the hatches. For the multis I've worked with, tier for parallels is a function that takes the EU and returns the tier number - that probably does not need changes. OCing (to reduce recipe time) also works fine. It's just whatever determines tierskipping/valid recipes may require extra logic.

@WaterOtter86
Copy link
Author

WaterOtter86 commented Jan 30, 2025

For now nothing decides on tierskipping, as far as I am aware it just looks if it can pull the power for recipe, not the voltage it is, at first it thought about checking buffer of my hatches but unfortunately i have nothing better comapre them to bc recipes for have multiple amps

@Dream-Master Dream-Master requested a review from a team January 30, 2025 21:04
@nshepperd
Copy link
Contributor

I think this should probably come with a default recipe check logic similar to that of the Advanced Assembly Line.
This compares the recipe EU/t to the minimum voltage among all energy hatches to prevent tierskipping (see MTEAdvAssLine.checkProcessing):

            if (recipe.mEUt > inputVoltage) {
                result = CheckRecipeResultRegistry.insufficientPower(recipe.mEUt);
                continue;
            }

Here inputVoltage is computed during machine check with the minimum hatch.maxEUInput() of all available hatches.

In our case, we want to allow 1 tierskip for most machines and account correctly for multi-amp recipes (eg. thermal centrifuge - most recipes are 48 EU/t but are LV; processing these with one or more LV energy hatches wouldn't be tier skipping), so the check should be recipe.mEUt > 4 * inputVoltage * recipe.amperage.

Where exactly to put this check so that it works correctly for all multiblocks by default I'm not sure. Maybe in checkProcessing(), same as AAL does it...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Affects Balance Change affecting balance. Requires admin approval before merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants