Refined Storage

Refined Storage

77M Downloads

Enhancement: Allow Crafter Internal Storage to "Steal" from Storage Network

codydg opened this issue ยท 2 comments

commented

Feature

Allow the internal storage of a crafter to "steal" from the storage network at times. This would allow multiple things to happen that currently cannot:

You could manually help the crafters.

For example, the crafter has filled a furnace with cobblestone, so you smelt a pile yourself in a separate furnace to speed things up. In particular, what I have done a couple of times is take resources from the crafter's furnace and smelt it elsewhere, but because player-provided items can't be seen by the crafter after it starts, this actually locks up the order and I have to cancel it.

You could initiate an auto-craft request without having the required materials.

This is incredibly useful when you know how much of something you need before having the required resources. E.g. start an order for 1000 cobblestone -> stone having only 600 cobble. It can begin smelting, while I go mine another 400. When I come back, I place the 400 cobblestone back in the system and it begins smelting again.

Implementations

1. In the Crafting Monitor, next to "Cancel", add a "Restart" button. The "Restart" functionality should be equivalent to cancelling, then re-submitting the request with the remaining quantity.

  • Pros
    • Likely a pretty small code change, since it has already-existing equivalent functionality
    • Doesn't surprise user when materials disappear since they initiated the action
  • Cons
    • Materials currently being processed aren't tracked properly. E.g. Tell system to smelt 100 of our 200 cobble. When 10 are done, 64 are processing (in furnace), and 26 have not started, click Restart. Now those 64 aren't seen by the system, so the order will smelt 90 cobble, even though 64 are already in the furnace, ending with 164 cobble smelted.
    • While the con above may sound bad, when I get a broken order I end up just doing this restart functionality myself anyways so the current workaround has the con below anyways.

2. Occasionally check if ingredients exist in the storage network that could progress the current order

  • Pros
    • Effective at crafting quickly.
    • Fixes the issue with manually helping the crafters. If I steal the furnace's cobble and smelt it myself, the crafter will pick up the storage network's added stone and it will resolve itself. If I smelt my own, then put it in the system it will accept that as well (though it may end with extra smelted like in implementation 1, this would be expected by the user since they smelted stone themselves)
  • Cons
    • Notable code requirement, with an extra consideration: What if I have 2 orders to smelt 1000 cobble? The orders would see each others' output and count that as their own unless further data is stored to prevent this.
    • If a user puts items in the network that unknowingly help a crafter, they may be surprised to find their items missing.

3. Add support for a "pending" order - one that has been submitted, but not started (also meaning it has not reserved ANY resources), and can be started from the crafting monitor.

  • Pros
    • Simple/compatible
    • Has none of the issues with the other implementations
    • Allows the user to set up a list of orders while they make plans, regardless of resource availability, then begin crafting when resources allow.
  • Cons
    • Doesn't allow the user to manually assist the crafters
    • Still doesn't begin processing materials until all ingredients are in the system

Implementation 3, to my knowledge causes no issues. It is an added feature to the mod that has no known drawbacks. It doesn't fully fix the issues I've had with the crafting system, but it does help.

commented

but because player-provided items can't be seen by the crafter after it starts, this actually locks up the order and I have to cancel it.

Whether items will be counted for autocrafting depends on how they enter the system. So if you instead of inserting them directly into a grid, put them into an interface somewhere that imports them, they will count.

  1. Not a terrible idea. However, the crafting monitor should only ever get stuck if there is an error in your setup. And if that happens it is impossible for the system to know what items have been successfully crafted which would result in items being recrafted (most likely ending in the same issue). It would also encourage keeping broken systems around which both will continuously annoy the player and increase the severity of any issues that appear due to the error (item spills etc.)

  2. This is already a thing. You can just not start autocrafting without having all items available. If the system for whatever reason is unable to extract all the items it used to calculate it will extract more from storage afterwards.

If a user puts items in the network that unknowingly help a crafter, they may be surprised to find their items missing.

That is exactly the reason why. There are enough potential bugs in other mods that could cause this. We don't need to make it more frequent.

  1. What does this allow for? I'm not sure I understand what the point of this is.
commented

the crafting monitor should only ever get stuck if there is an error in your setup.

"...or if the user assists" was the idea here. Yes, I could insert items into the system via chest/importer and it would work. I was avoiding this as it seemed like a workaround but to be fair, if you're manually helping the automatic system that makes sense to me.

You can just not start autocrafting without having all items available
...
3. What does this allow for?

I may be misunderstanding you here but currently, you MUST have all ingredients to start an order, and that's part of the 'issue'. If I need 5000 stone bricks and 800 glass, I don't really care if I have enough sand and cobble to complete the order now, but I want to submit the request to my RS system now while I have the numbers. This allows me to use the crafting monitor to see how much I have left, without having to attempt to resubmit the order (This matters much more in more complex recipes). Right now, I can't submit an order for something which I don't have the materials for.

Number 3 was possibly the most trivial/non-breaking way to fix this: allow the user to submit the pending order where NO autocrafting will be done until you have enough resources, then the user can go to the crafting monitor and click a "Start" button. Ideally I'd prefer a solution where the system can start autocrafting before I have all of the ingredients but I understand that there may be hurdles to that since the system can't necessarily make a specific plan.