Quality Down-Binning


Allow down-binning of quality items by putting them in a bin with a different quality label on it. Complete overhaul for 2.1, full support for modded quality levels.

Content
13 days ago
2.0 - 2.1
6.62K
Manufacturing
Owner:
AssaultRaven
Source:
N/A
Homepage:
https://forums.factorio.com/viewtopic...
License:
MIT
Created:
1 year, 8 months ago
Latest Version:
0.10.3 (13 days ago)
Factorio version:
2.0 - 2.1
Downloaded by:
6.62K users

Trying for Rares but getting your smelters clogged up with Uncommons, that you can't even throw into infinite technologies because you don't have an entire duplicate factory for Uncommon inputs?

Then this mod is the solution for you! Take after the example of real-world manufacturers with too many, too good items, and down-bin them by choosing to forget about their original quality and just treat them like lower-quality versions of themselves.

Factorio 2.1

Only accepts items that can be used as ingredients.

Dynamically generates down-bins based on all quality levels present. If there are more than 7 total, a new tab will be created to avoid cluttering the Logistics tab.

Consistent with their theme as "just a bin with a different label on it", down-bins operate fast enough to handle a fully-stacked turbo belt loader.

Items with equipment grids that are also ingredients will be accepted (such as Power Armor MK2), but if they contain items, those items will be spilled rather than destroyed.

Under the Hood

Using new quality-related elements of the recipe API introduced in 2.1, it is now possible to dynamically generate recycling-like recipes for quality reduction for all items and all target quality levels and use them in the appropriate down-bin type. By then rewriting the down-bins as furnaces rather than script-based containers, this also resolves the race condition that allowed prematurely removing an item before it had been down-binned, as well as the need for per-tick runtime scripting.

Because this mod generates a hidden recipe for every combination of ingredients and target quality levels, it is necessary to more aggressively filter items, hence why only ingredients are accepted. This is the main purpose of down-binning, and so should not be an issue.

One may wonder if this large number of recipes risks hitting the hard-coded engine limit for prototypes of 65,536. In the base game, not even close. With mods, maybe, if you combine mods with large amounts of items and use a quality mod with a very high number of quality levels, such as Unlimited Quality. I found the following values for down-binning recipes / total prototypes:

  • Space Age, base quality levels: 568 / 5,776
  • Space Age, 98 quality levels: 13,774 / 19,447
  • Krastorio 2 Spaced Out, base quality levels: 2,260 / 9,421
  • Krastorio 2 Spaced Out, 98 quality levels: 54,805 / 62,431

That last test is actually close! But even so, it only got close with 98 quality levels. So if you actually run into an issue while running all of Pyanodons or something combined with 98 quality levels, my recommendation would be to use fewer quality levels.

Factorio 2.0

Unfortunately, because the quality recipe API needed to produce quality-affecting recipes was only introduced in 2.1, it will not be possible to introduce the new functionality to 2.0. I did get a set of bug-fixes in before the migration, but be mindful of the following if you're still on 2.0:

  • It is possible to grab an item before it has been down-binned. Use quality filters on output inserters and loaders to prevent this.
  • Unlike the 2.1 version, almost every possible item can be down-binned, and item data will be preserved, including modded items with tags or blueprints. The only things it will refuse are items with a non-empty equipment grid or inventory.

Contributors