Storage Drawers

Storage Drawers

151M Downloads

[Request] Smarter search order for Drawer Controller

codewarrior0 opened this issue ยท 7 comments

commented

When inserting items via hoppers, it would be super cool if the controller preferred to insert items into a drawer already containing that item, instead of inserting into the first drawer it finds. I understand this may not be possible, as the controller just exposes a large number of item slots and whatever is inserting the items is responsible for the search order, but maybe you know something I don't. Maybe listing all of the empty slots last would make this happen.

commented

Ah alright, that's completely fine. Manual sorting at the start is not an issue, I thought there was an issue with logistics pipes so started using the hopper. But the hopper has horrible throughput. Guess I hit one of these network calibration times.

commented

LP integration was written a while ago. I THINK it's included in current LP builds, but I haven't tested it since then. The original LP issues were specific to LP's special functions, like maintaining a minimum inventory amount greater than 64.

commented

I wonder how much it would hurt to put the slot reordering on a different timer from the network rebuilding. Or for that matter, is it possible to trigger a reordering when a drawer becomes occupied/empty, locked/unlocked, or voided?

commented

I guess the recommended way to use Storage drawers is not as general storage "dump all contents of your adventure trip into the drawer system". But rather as manual pre-sorted storage? "I want cobble to be here and iron to be there"

I have two banks of drawers with items inserted with a hopper to the controller. But items show up in the drawers using the shortest path, the closest empty drawer. So four different drawers have token amounts of the same item.

commented

Initially you will have to do some sorting, but over time that need should go down. Once a drawer has held an item for 5 seconds, the network should have rebuilt and then that drawer will always be preferred for that item, rather than filling another empty one.

If you're manually putting the items into the controller, the double-right click will dump everything that already has a home in the drawers, and then you're left with the items that need to be inserted into an empty space.

commented

Incidentally, it's the periodic network rebuilding that I hate which made this idea possible. Each time the network rebuilds, I'm sorting the inventory slots to prefer populated drawers. I'm not positive all transport networks will respect this, but there's definitely nothing to be done in that case.

Support for this is in 1.4.0-alpha2. It would be great if you could do some testing on it.

commented

It looks to be working brilliantly. Great job!

As you might have noted elsewhere, the delay between the controller updating its sort order makes it impossible to try to move an item to a different drawer while a hopper is inserting that same item. But that's honestly not a problem. This is already a huge improvement to the controller.