GlodBlock / ExtendedAE

add a pattern provider with 36 slots for AE2
GNU Lesser General Public License v3.0
25 stars 22 forks source link

Add an option for precise storage bus to have a general restriction for amount of items to store #196

Open MageInBlack opened 1 month ago

MageInBlack commented 1 month ago

Hi, I've seen a lot of people recently asking about having some sort of round-robin for machines working with a pattern provider. Filling things like super smelter furnaces so it smelts faster or Mekanism machines. I though that some sort of limiting of input per machine would be an interesting solution for such a problem.

I thought of the precise storage bus that this mod recently added, and while it is a really nice addition, it doesn't solve this problem fully as it needs to configure every item amount manually and doesn't account for different items (like a mekanism machines that can process several types of items at once).

So it would be a nice solution to add a general restriction on the inserted/kept items amount. For example when the precise bus either is not partitioned or partitioned and several item types can be inserted.

As said above this will help a lot with setups when high amount of parallel machines should work with pattern providers, so a distribution subnet will "evenly" distribute items across all the precise storage bus machines for higher processing speed. This won't generally help with machines that may require multiple inputs for process, but for simple one-item-per-recipe machines this would be a godsend.

Edit: I know AE2 machines like inscribers can be easily paralleled because they can have an option for a stack limit, but this could solve it for most of other machines outside of ae2

GlodBlock commented 1 month ago

i thought rr mode should be added to pattern provider in base ae2 instead of in an addon

MageInBlack commented 1 month ago

Idk much about how hard it is, but due to pattern provider getting access to network storage idk if it is possible to implement round robin on a single side when it is connected to an interface with multiple machines.

However you might know that there are ways around that. The first one I want to bring up is that pattern provider round robins its sides at least according to the guide. So it can parallel 5 machines. There are an addon that allows to create a pattern p2p, which extends the pattern provider and allows it to parallel/round robin in a way multiple machines acting each as a side of a provider (Modern AE2 Additions).

The second way to get around and implement a pseudo-round-robin is shown in the picture below. This is possible in the vanilla ae2: image

(Emitters are set as emit above 1 without specifying a block which allows it to emit if anything is in the network storage. Which also bugs a bit with applied flux and needs to filter out the RF energy so it works again but it it due to energy now actually counting as "stored" so any machine that stores energy may show energy being available which fires the emitter. If you blacklist/reverse card the rf energy out of the storage bus it will work as intended)

This setup allows to shut down the bus access as soon as the materials are pushed in the corresponding machine (example shows 4 parallel "machines"). This allows blocking pattern provider to distribute pattern inputs in a round-robin fashion across machines. The access resumes once the materials are being consumed fully.

Edit: Additionally. I was asking for additional configuration option for the precise bus out of convenience and because it made some kind of sense adding a general restriction on item amount. The applications of such option were mostly an example of how it can be utilized.

Edit 2: Even before writing this request i thought of another request adding something like "shutter/shutting storage bus" which behaves similarly to what is depicted. It stops reporting items upon items being present in the storage in front of it (also stops items from being inserted into it). But I didn't know if i should make several requests for that and thought to see where this one goes first. And also because it is mostly for convenience of not building this setup above and maybe for not recalculating small subnets used in it.

Edit 3: Also a small note. Even if rr is implemented on a single side of a pattern provider, which is kinda impossible with how it works currently I think, it would make co-processors less viable for parallelization. Something like pattern provider p2p solves this issue more elegantly which allows pattern providers to use more machines with more co-processors. There is also an issue on that on the main ae2 github for a pattern provider p2p which will improve things like round robining and much more (https://github.com/AppliedEnergistics/Applied-Energistics-2/issues/7897).