TL;DR
Where a splitter has a filter applied, provide an option to tell the filtered side of the output to stack items up to the current level of belt stacking research.What?
Add a "Stack Filtered Output" option to splitters that is linked to the Filter option. The "Stack Filtered Output" option is only active when a filter is applied and has no effect otherwise. This option would be limited to the current belt stacking size, so would have no effect until the relevant research had been done.When the "Stack Filtered Output" option is turned off, splitters behave as they currently do, passing items straight though at whatever stack size they currently have.
When the "Stack Filtered Output" option is turned on, the filtered output of the splitter would behave somewhat like a stack inserter and only output full stacks of the item being filtered for. If too few items enter the splitter to form a full stack, they will be held inside the splitter until sufficient items arrive to make a full stack. As with other belt mechanics, this would operate on a per-lane basis, so items would be held and released per lane. Items would not be combined between lanes to achieve a full stack.
The non-filtered output of the splitter would not be affected by this option and would behave as it currently does, passing through items at whatever stack size they currently have.
Changes to the splitter settings (e.g. changing the filtered item type) would be handled similarly to how the stack inserter handles them i.e. releasing any partial stacks that no longer match the filter.
Why?
Currently, the only way to achieve stacking on belts is to use stack inserters when adding items to the belt. Tasks like combining multiple unstacked belts into a single stacked belt require a number of stack inserters to effectively unload and re-load the belts. Some way of stacking belts in a more in-line way would be useful, and more efficient than using inserters to unload and re-load the belts.Limiting this option to the filtered side of a splitter gets around the potential for causing jamming of the belt if multiple item types are present. Initially I was going to propose a simple "Belt Stacker" item that would sit on a single belt and just stack items as they passed through it. However, I then realised this would easily jam if there were more than one item type on the belt (e.g. sushi belts), similar to how stack inserters can jam when trying to load multiple item types into the same machine. By definition, the filtered side of a splitter will only ever be outputting one item type, so while it might hold up items until it can form a full stack, it would never become completely stuck.
This would allow a single-item belt to be fully stacked at full belt speed using a single splitter, instead of the current solution requiring multiple belts and stack inserters. While it would still potentially hold up 1-3 items per lane waiting for enough to make a full stack, this is much less than would be held up in all the stack inserter hands for the current solution. This could be particularly effective on Gleba where using stack inserters to output spoilable items from individual machines (e.g Agricultural Towers) can lead to items waiting a significant amount of time in the hand of a stack inserter, wasting spoilage time. Consolidating the output of multiple machines onto an unstacked belt and then putting it through this filtered stacking splitter would mean new items are arriving much more frequently so the potential time items would be spent held up waiting to make a full stack would be much lower, and negligible for full input belts.
A single filtered splitter could take 2 unstacked single-item belts in and through stacking output all the items from both input belts onto the filtered output (and the output belt would still only be half-full with full stacking research). Two of these, with a third unfiltered splitter to merge the two filtered outputs would then provide a neat and efficient way to combine 4 unstacked belts into a single fully stacked belt.
Sushi belts could be stacked using a series of filtered stacking splitters one after the other (one for each item type) - with both outputs of the first filtered splitter fed into the second, the second splitter would simultaneously stack the second item type while merging the stacked first item back onto the sushi belt. You'd then end it with a final unfiltered splitter to merge the final item back into the sushi belt.