Logistics Pipes

Logistics Pipes

13M Downloads

Probabilistic crafting

TheLoneWolfling opened this issue ยท 10 comments

commented

There are some recipes, such as Thermal Expansion's "1 sandstone in a pulverizer turns to 2 sand and 1/4 chance of 1 niter", that are probabilistic, in the sense that outputs only occur some of the time.

If you want a recipe to turn sandstone into sand, that's fine. Put a byproduct upgrade pulling out niter and set the recipe to 1 sandstone -> 2 sand, and you're done. But if you're trying to craft niter on demand, it's not so simple.

Currently, there's no good way to handle such recipes on demand. If you put a crafting pipe crafting, say, 4 sandstone -> 1 niter (with a byproduct upgrade pulling out sand), you'll often end up with your crafting system stalling because you're a niter short. If you have a buffer (where you supply the pulverizer with sandstone until you have enough niter in the system), you have other problems. (Namely: that you cannot craft things that require more niter than you currently have in the system, even if you have plenty of sandstone/sand/etc. With certain items (not sandstone), you're also suffering from not crafting on demand.)

It gets worse when the probability isn't "nice". (For example, if you have a 5/7 chance of an output.)

It would be nice to have a crafting pipe / upgrade that would work as expected with these sort of recipes. In other words, a crafting pipe / upgrade that checks a bit after the non-probabilistic output appear, and requests more if the probabilistic output were below what was expected.

commented

My issue wasnt that I wanted to craft the byproduct, but to simply not have the Crafting Byproduct Extraction module expect it. I use TE Pulverizers to process my ores in bulk which generates secondary output. Now that TE allows in and out on one side I thought I would be able to clean it up by having the crafting pipe take everything out, which it does, and not continue to send a request for materials because I assume that it having a pipe continue to request things isn't good for a server. Correct me on this if I am wrong.

In the end I just removed the upgrades and put extraction pipes on the secondary output.

commented

@Zetharion btw, you do not need an extraction pipe for TE machines since they have a long-term compatibility with BC pipes and they sending their product/byproduct automagically, without needing any suction.

commented

It just process a shitload of sandstone every once and a while like I Do

commented

davboecki, that doesn't work either, because then you have the opposite problem, namely that then it won't complain if you don't have enough sandstone. Also, it still means you have to keep a buffer, which for more expensive things gets expensive.

commented

The calculation won't work either way because exactly calculation isn't possible with probability. That's the drawback of using it. No way to fix that. And if you want to automate something expensive it should be expensive and something for the late-game. So I don't see a problem in requiring people to keep a buffer of the item, even if it gets expensive. You could also use a gate to only activate the machine when there is a crafting task inside the pipe.

commented

Can Supplier pipes configurable with gates and/or redstone signal? Because I can imagine an idea: put your niter into a single-slot storage (such as a DirtChest 9000) - i don't think you need more than one stack niter at once - and a provider pipe to the chest, and a gate on it. If the stored items < 75% then enable a redstone/pipe signal that enables the niter-producing machine (pulverizer) and the supplier pipe. This system can keep up the niter around 48 item and does not overcraft sandstone.

The other probability outputs are pretty same. As I know currently there is no probability item that you have to request a bunch of stacks because they are very precious (dustPlatinum for example) or they can requested other way (dustSulfur in TE for example has an 50% chance with blaze rods, so we can assume 4 blaze rod can produce 1 sulfur at least). The main problem is usually the < 50% chance but it can be worked around like this.

commented

this would help a lot i think #526

commented

Use a supplier pipe set to sandstone and automaticly extract the sand. Then to access your niter buffer don't use a provider pipe use a crafting pipe which only has niter as output and nothing set as input. Then you don't have the limit of your buffersize and only need to make sure you always have enought sandstone.

commented

It never really should be intended that you are "short on byproducts" by their meaning.
Of course I see the problem here and yeah, you cannot rely on the recipes with byproducts, so you either need to program your problem away with ComputerCraft or Open Computers or live with the fact that you sometimes run out of byproducts.
If you have a recipe with a byproduct, set it at a higher priority on the crafting pipe using that byproduct. Then make a second version of a crafting setup for that recipe, which does not use the byproduct, so that this recipe will be used, if there the first cannot be crafted. That would be my solution to the problem.

Fact is, that I do not think having an item especially for "byproduct crafting" really pays off and it also sounds weird. If there is no further discussion to do on this topic, I would like to close the issue in a week or so.

commented

Meh, I obviously have the minority opinion here in seeing it as a problem. As such, do what you will.