Best way to reliably alternate multiple items on one lane?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
User avatar
Oktokolo
Filter Inserter
Filter Inserter
Posts: 883
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Best way to reliably alternate multiple items on one lane?

Post by Oktokolo »

My use case is optimizing away belts for production that needs more than two ingredients in small and fixed quantities without using bots.
For this i need a reliable and compact way to fill a single lane with two or more items, so that the products are placed in sequence on that single lane without ever leaving out one product or placing items multiple times in a row. If any item is unavailable, no item should be placed to avoid clogging the lane.
I am experienced with rainbow sushi belts but want to avoid the sushi loop to reduce the overall footprint.

After trying different approaches i had the following that seems to work:
reliable item alternator.png
reliable item alternator.png (84.63 KiB) Viewed 7298 times
Availability detection outoputs E = 1 if both items are available. Item selection loops through hand placed items on its belt loop and stops if E != 1. The arithmethic combinator next to the inserter multiplies the selected item with E, so the inserter does not see the selected item if any item is unavailable.

It needs a lot of space for the logic. Also, the item-selection loop and the availablility-detection logic don't scale too well for more ingredients.
Are there more space-efficient designs?

As the two-on-a-lane case is rather common due to a lot of recipes using three or four ingredients, i am interested in optimizations usable only for that case too.

quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Best way to reliably alternate multiple items on one lane?

Post by quyxkh »

Easier once circuit-speak starts virally taking over your mind: don't bother with the single-lane requirement, make a loop and set the filter for loading it by absence, feed the read-hold from some loop segment(s) and a constant -1 for the ingredients you want through an Each<0⇒1 Each to the set-filter input, the more segments you wire for detection the less full the belt will be, wiring just one segment is enough to leave room for two ingredients, even if one of them's temporarily unavailable there'll be room left for it when it arrives:
snap@T150905=586x636+21.484375-8.3984375,z2.jpg
snap@T150905=586x636+21.484375-8.3984375,z2.jpg (25.87 KiB) Viewed 7277 times
(I made that by just shutting off the iron-plate signal in the constant combinator).

Here's a single-lane variant if you really want that,
snap@T219256=546x457+21.1875-6.54296875,z2.jpg
snap@T219256=546x457+21.1875-6.54296875,z2.jpg (18.47 KiB) Viewed 7277 times
it needs two read-hold segments to avoid flooding with the 16.16 splitters.

User avatar
Oktokolo
Filter Inserter
Filter Inserter
Posts: 883
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Re: Best way to reliably alternate multiple items on one lane?

Post by Oktokolo »

I try to avoid the sushi loop here. I know, that it simplyfies avoiding the clogging in case of missing ingredients. But it also needs routing the ingredients belt back to the input.

Caine
Fast Inserter
Fast Inserter
Posts: 213
Joined: Sun Dec 17, 2017 1:46 pm
Contact:

Re: Best way to reliably alternate multiple items on one lane?

Post by Caine »

I found this video a while back which showcases a nice solution:
https://www.youtube.com/watch?v=8Lp-UJYwclA

Too bad the channel is in Russian, but the video material is easy to follow and some comments are translated.

User avatar
Oktokolo
Filter Inserter
Filter Inserter
Posts: 883
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Re: Best way to reliably alternate multiple items on one lane?

Post by Oktokolo »

Caine wrote:I found this video a while back which showcases a nice solution:
https://www.youtube.com/watch?v=8Lp-UJYwclA
Thank you! This does exactly, what i want. And it does not even need power.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Best way to reliably alternate multiple items on one lane?

Post by DaveMcW »

Yes, you can easily do 2 and 3 items with yellow/red or yellow/blue belts.

Here is an infinitely expandable design for more items. Multiply the items you want by -2 and put them in the constant combinator.


Blueprint

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Best way to reliably alternate multiple items on one lane?

Post by eradicator »

I've tried using something almost identical to the russian video before, but it was very prone to clogging up slowly, as the inserters in front grab one type of item and the assemblers further down the line are clogged with the other types. I suspect in the video it only seems to work so seemlessly because they use slow inserters, slow belts and probably have no stack bonus. That said if someone can show that it works with bluebelt + stackserters just fine i'll be very happy :D.

(Btw, because the video doesn't really explain it: The mechanic used is that you can fit exactly 2 yellow belts on a red belt when sideloading, and 3 yellow on a blue. As long as all belts move at full speed this gives perfect ratios even without any circuitry.)
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
Oktokolo
Filter Inserter
Filter Inserter
Posts: 883
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Re: Best way to reliably alternate multiple items on one lane?

Post by Oktokolo »

eradicator wrote:I've tried using something almost identical to the russian video before, but it was very prone to clogging up slowly, as the inserters in front grab one type of item and the assemblers further down the line are clogged with the other types.
You have to have the last assemblers of the line grab from multiple tiles of the belt. Statistically with only one recipe beeing made, equal quantities of each ingredient should reach the tail of the belt when observed over large enough a time frame. This limits the length of the assembling line, but with 10 assemblers grabbing ingredients on each side it worked for me when letting the last assemblers grab from two tiles of the belt. You could even split the belt on the end and let the last assemblers grab from five tiles...
I am not going for higher belt speeds on this because merging multiple yellow outputs to a red or blue is easy enough and beltwork generally is incredibly beautifull to look at since the HD overhaul.

Post Reply

Return to “Gameplay Help”