Logistics Pipes

Logistics Pipes

13M Downloads

Crafting Logistics Pipe bug with Extra results

KollinsPlays opened this issue ยท 11 comments

commented

Crafting Logistics Pipes are getting confused by machines with "bonus" secondary results. I'll use the EnderIO SAG Mill as an example:

I set a crafting pipe (basic "MK1", MK2 and MK3 all do the same thing) to SAG Mill bones for bonemeal, The Mill gives 6 bonemeal per bone with a 10% chance to get 2 extra bonemeal. I add the Crafting Byproduct Extraction Upgrade to the pipe and set Extra to bonemeal (I tried 1 or 2 in the extra slot, same results.)

If I request more than 6 bonemeal, the crafting pipe keeps flashing after everything is pulled. It appears that it sent 2 bones in and then when it saw 12 bonemeal, it pulled 6+2 (or 6+1) bonemeal out, satisfying the 1st half of the request but leaving the second half of the request short.

It appears the logic on the crafting pipe/byproduct upgrade treats multiple requests as pull everything it can, including extra, from 1st request, then from 2nd request, etc but what it should do with bulk requests is try to satisfy primary output of all requests before looking for the "Extra" output.

Here's another possible fix, and I have no idea how big of a code change this would be, or if it would make things worse instead of better. I also hate to compare one mod to another, but this one is more stupid user friendly in some ways. Applied Energistics treats crafting requests as almost "fire and forget" and sends the appropriate ingredients to machines, but doesn't care how the results come back, as long as they show up. So instead of each crafting pipe waiting for it's results, the core LP logic could close out the request as completed once it sees the expected results show up in the system.

commented

The crafting byproduct upgrade is only useful in the cases of a 100% chance of a byproduct. It wants to extract every single byproduct. At least that's how it works. You can request a change of that behaviour in a new issue.

Your comparison to Applied Energistics is right, and I know it is more user-friendly, but that is not the point. LP works from the ground up on requests, promises and actually traveling items. Just for the last point there, I would say it's almost impossible to make that work with the current codebase. In other words: A huge huge amount of work, which is not needed in most of the crafting recipes.

commented

There is a simple change that will make this work. Make Crafter's work like a provider/extractor for the crafting byproduct, rather than taking Into account in the promises chain. Doing this for the main product also would Prevent buildup and overflow of inventory.

This behaviour was originally avoided because there was no way to do a buffer, but now that providers and suppliers for the same produce, on the same chest, is allowed, that argument may not be valid.

commented

@theZorro266 Thanks for your feedback! I see your points with the LP comparison and I understand changing to their model would be massive and complex and probably introduce more bugs if it was attempted.

With the Byproduct Extraction upgrade, I don't see the point of it's current implementation. I thought it would be useful for the TE Pulverizer and EnderIO SAG Mill to pull out the extra small % byproducts, but I can't think of any mod machines that always produce a main product and a 100% byproduct? Do I need to open a new issue to request an upgrade designed for Pulverizer type machines?

commented

Nah, I guess we can leave that discussion here. Changing the byproduct extractor would be a good thing, imo.

commented

The problem with that would be how to determine what the extra is if it is of the same type.

commented

So rather than being a new Slot inside the gui, the Byproduct extractor would be like a cleanup module which extracts everything it can from the adjecent inventory if all orders are done.

commented

I would deal with that by only extracting extras after the engine order is done.
This would also silently work well if the crafter acted like a provider for any pre-crafted ingredients, in that case the extra would be the first item in the next request.

commented

@theZorro266: I'm just not sure what the intended application for the byproduct extractor is now. If there was a specific machine in mind when it was created, would it be better to copy the code to a new module and implement changes to that?

@davboecki: From an in-game implementation standpoint, a post-craft cleanup would be best if it kept the slot and used it as a whitelist. In my world I attempted to put 2 crafting pipes on an EnderIO SAG Mill and a TE3 Pulverizer (it's expensive and bulky to have 1 machine for each crafting pipe.) If the pipe just extracted everything when it was done, that could mess up other crafting requests. If there was a slot for a whitelist then my bonemeal crafting pipe could pull bonus bonemeal when it was done and my blaze powder pipe could pull bonus sulfur, but if I request both bonemeal and blaze powder, I don't have 1 pipe stealing the results from the other.

TL DR: extractor waits for all orders to finish, then extracts everything in it's whitelist.

commented

I originally intended the upgrade for container type of items. So when there is a bucket or any other item that would remain in the crafting grid and thereby is remaining in the crafting table, those items get extracted and sorted inside the system.

I'm curreny thinking adding another new module which would be the cleanup module. It would have two modes include and exclude like the extractor and 12 slots to define which items you either want to extract or you don't.

EDIT: Or maybe make it 12 slot max and 3 per upgrade so you need 4 upgrades to reach the maximum of 12 slots.

commented

Aha! I just checked and sure enough, there are buckets in my Enderium Blend Logistics Crafting Table. I figured LP just ate the buckets like AE did last time I used it. Now I'm using a Crafting Byproduct Extraction Upgrade the way it was intended and I look forward to seeing a cleanup module. I like the 3 slots per upgrade idea.

commented

Most of the code is done. Just need to wait to get home from my vacation to be able to test it.