Combining, Splitting, and Balancing Large Numbers of Belts

Post your ideas and suggestions how to improve the game.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 1974
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Wide Splitter (3 belt splitter)

Post by darkfrei » Sat Jul 07, 2018 2:25 pm

And what about script-based inserter/loader?
On tick
If in this place we have item on the ground an we have place inside the chest, then insert the copied item and delete old entity.

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

Re: Wide Splitter (3 belt splitter)

Post by eradicator » Sat Jul 07, 2018 3:36 pm

Hm. Fiddling inserters into the right position is a bit tricky... but i'd say n-belt-splitters should be moddable then, even with filtering.
fiddle.jpg
fiddle.jpg (73.47 KiB) Viewed 1288 times

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2074
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Wide Splitter (3 belt splitter)

Post by Optera » Sat Jul 07, 2018 4:09 pm

darkfrei wrote:And what about script-based inserter/loader?
On tick
If in this place we have item on the ground an we have place inside the chest, then insert the copied item and delete old entity.
Scripted on-tick will be several magnitudes less efficient than anything using native entities.
You can see this when loader redux is used to fill/empty wagons.

I guess this demonstrates how optimized inserter-belt and inserter-chest interactions actually are.

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

Re: Wide Splitter (3 belt splitter)

Post by eradicator » Sat Jul 07, 2018 4:52 pm

Loaders have one benefit over inserters though. They can "bend" belts into them, which looks nicer. Inserters on the other hand could have 5 filters per lane.
(Upper is 3-wide-chest, lower is 1x1 chest)
nanoloader.jpg
nanoloader.jpg (229.41 KiB) Viewed 1276 times

User avatar
Therax
Filter Inserter
Filter Inserter
Posts: 398
Joined: Sun May 21, 2017 6:28 pm
Contact:

Re: Wide Splitter (3 belt splitter)

Post by Therax » Sat Jul 07, 2018 6:17 pm

Optera wrote:Scripted on-tick will be several magnitudes less efficient than anything using native entities.
You can see this when loader redux is used to fill/empty wagons.
Indeed, this is why I created miniloaders in the first place. :D
eradicator wrote:Loaders have one benefit over inserters though. They can "bend" belts into them, which looks nicer. Inserters on the other hand could have 5 filters per lane.
(Upper is 3-wide-chest, lower is 1x1 chest)
Note that miniloaders are actually 3 entities, 2 inserters and a loader. The loader is only present for belt connectivity, and doesn't move any items under normal circumstances. A 3-way splitter along the same lines is doable and would retain the performance, circuit control, and filtering advantages of using inserters to actually do the item movement

The downside to inserters is that they have a hard cap at 1 item/tick (60 items/second) when taking from a single belt segment. According to Twinsen this is because all inserters select an item at the beginning of the tick, and then they all chase that item, but of course only one can successfully pick that one item up in a tick. Bob's top tier belts move items at 5x yellow speed, or 66.66... items/second, which makes miniloaders just barely not able to utilize them at full throughput in the belt->chest configuration. Tyarns' Ultimate Belts are even faster, which is why miniloaders has to use actual loader entities for them, losing filtering and circuit control capability as a result.

Side note:

I frequently use a Warehouse + miniloaders to make 6x6 balancers, or 6x(3x6) splitters, etc.
Miniloader — UPS-friendly 1x1 loaders
Bulk Rail Loaders — Rapid train loading and unloading
Beltlayer & Pipelayer — Route items and fluids freely underground

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

Re: Wide Splitter (3 belt splitter)

Post by eradicator » Sat Jul 07, 2018 7:14 pm

Therax wrote: losing filtering and circuit control capability as a result.
I'm not sure about circuit control...but loaders DO have filters. Just not seperated for each belt-lane, though i doubt mini loaders have that implemented?

Btw, how do mini-loaders handle stack-bonus? In the pictures two posts above (with the four stack inserters on a chest) it only barely worked if they had a stack size of 3, wich stack-size-override = 1 it was too slow on the input.

User avatar
Therax
Filter Inserter
Filter Inserter
Posts: 398
Joined: Sun May 21, 2017 6:28 pm
Contact:

Re: Wide Splitter (3 belt splitter)

Post by Therax » Sat Jul 07, 2018 8:25 pm

eradicator wrote:I'm not sure about circuit control...but loaders DO have filters. Just not seperated for each belt-lane, though i doubt mini loaders have that implemented?
Loader entities have 5 filters, but cannot be connected to a circuit network. It would be possible to implement per-lane filtering in miniloades, with custom GUI work.
eradicator wrote:Btw, how do mini-loaders handle stack-bonus? In the pictures two posts above (with the four stack inserters on a chest) it only barely worked if they had a stack size of 3, wich stack-size-override = 1 it was too slow on the input.
Miniloader inserters are locked to stack size 1, with very high arm movement speed.
Miniloader — UPS-friendly 1x1 loaders
Bulk Rail Loaders — Rapid train loading and unloading
Beltlayer & Pipelayer — Route items and fluids freely underground

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

Re: Wide Splitter (3 belt splitter)

Post by eradicator » Sat Jul 07, 2018 8:40 pm

Ah. So they can't circuit :x.
Yea, that miniloaders "could be" per-lane filtered i said before, it was the "but does it?" part i didn't know.
Mine had speed = 0.99 (because i assumed float with max 1?), but i only tried for 5 minutes or so. Also...can you force inserters to only take from one lane? As far as i can tell you can only force one-sidedness on the output.
And those "inactive" loaders you tal about..are they simply speed = 0? Or active.false?

Zavian
Smart Inserter
Smart Inserter
Posts: 1405
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Wide Splitter (3 belt splitter)

Post by Zavian » Sat Jul 07, 2018 9:30 pm

eradicator wrote: Also...can you force inserters to only take from one lane? As far as i can tell you can only force one-sidedness on the output.
If you are loading from a chest/assembler then there is no pickup lane. If you are loading from belt, then I don't see that it matters which lane they pick up from, if they are emptying a full belt.

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

Re: Wide Splitter (3 belt splitter)

Post by eradicator » Sat Jul 07, 2018 9:42 pm

Zavian wrote:
eradicator wrote: Also...can you force inserters to only take from one lane? As far as i can tell you can only force one-sidedness on the output.
If you are loading from a chest/assembler then there is no pickup lane. If you are loading from belt, then I don't see that it matters which lane they pick up from, if they are emptying a full belt.
It matters for input filtering and fancy lane-aware splitters. Thank you. :/.

User avatar
Therax
Filter Inserter
Filter Inserter
Posts: 398
Joined: Sun May 21, 2017 6:28 pm
Contact:

Re: Wide Splitter (3 belt splitter)

Post by Therax » Mon Jul 09, 2018 5:23 am

eradicator wrote:Mine had speed = 0.99 (because i assumed float with max 1?), but i only tried for 5 minutes or so.
I haven't actually tested, but my guess is that rotation_speed is in radians/tick, while extension_speed is in map tiles/tick, same as belt speeds. Just a guess though. Express Miniloader internal inserters have rotation_speed and extension_speed of 1.5. I force stack size of 1 so that output is appropriately evenly spaced, for example when power is low and the inserters slow down and can no longer keep up with the belt.
eradicator wrote:Also...can you force inserters to only take from one lane? As far as i can tell you can only force one-sidedness on the output.
My experiments suggest the same. If someone figures out a way to do this, I'd be happy to hear about it. :)
eradicator wrote:And those "inactive" loaders you tal about..are they simply speed = 0? Or active.false?
I set container_distance to 0. This way they fail to find a container to load/unload, which lets the engine put them to sleep permanently. However, they are still "active=true" and with the correct speed so that the visible belt fragment has the correct moving animation, and when backlogged, items "flow" into or out of the miniloader for some distance before reaching the end of the internal belt and stopping.
Miniloader — UPS-friendly 1x1 loaders
Bulk Rail Loaders — Rapid train loading and unloading
Beltlayer & Pipelayer — Route items and fluids freely underground

mrvn
Smart Inserter
Smart Inserter
Posts: 3281
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Wide Splitter (3 belt splitter)

Post by mrvn » Mon Jul 09, 2018 12:27 pm

Therax wrote:
Optera wrote:Scripted on-tick will be several magnitudes less efficient than anything using native entities.
You can see this when loader redux is used to fill/empty wagons.
Indeed, this is why I created miniloaders in the first place. :D
eradicator wrote:Loaders have one benefit over inserters though. They can "bend" belts into them, which looks nicer. Inserters on the other hand could have 5 filters per lane.
(Upper is 3-wide-chest, lower is 1x1 chest)
Note that miniloaders are actually 3 entities, 2 inserters and a loader. The loader is only present for belt connectivity, and doesn't move any items under normal circumstances. A 3-way splitter along the same lines is doable and would retain the performance, circuit control, and filtering advantages of using inserters to actually do the item movement

The downside to inserters is that they have a hard cap at 1 item/tick (60 items/second) when taking from a single belt segment. According to Twinsen this is because all inserters select an item at the beginning of the tick, and then they all chase that item, but of course only one can successfully pick that one item up in a tick. Bob's top tier belts move items at 5x yellow speed, or 66.66... items/second, which makes miniloaders just barely not able to utilize them at full throughput in the belt->chest configuration. Tyarns' Ultimate Belts are even faster, which is why miniloaders has to use actual loader entities for them, losing filtering and circuit control capability as a result.

Side note:

I frequently use a Warehouse + miniloaders to make 6x6 balancers, or 6x(3x6) splitters, etc.
Unless you use the new 10/20/30/40/50/60 speed setting.

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

Re: Wide Splitter (3 belt splitter)

Post by eradicator » Mon Jul 09, 2018 1:36 pm

(In the interest of not unnessecery dilluting your interface request i'll continue discussing here...)
Therax wrote: I could use a loader to move items from a belt to a container in the same map tile as the loader, then use an inserter to transfer from the container to the target cargo wagon. Currently, it is impossible to reliably set up an inserter with the container as its pickup_target, instead of accidentally having it select the loader or other belt entity in the same tile.
I wasn't even aware inserters can pick up from loaders. And i don't know too much about inserters. But don't they select their pickup_target based on the pickup vector and collision box? If yes then you should be able to achieve 1x3 by having loaders without a collison_box. So maybe the real problem is the inserters ability to deviate from it's original drop/pickup target (does it even? or does it just look like that because collision_"boxes" are not collision_"points")?

Sidenote: Bilka posted another mysterious interface request which - depending on what he actually requested - might or might not enable inserters picking up only from one belt lane.

User avatar
Therax
Filter Inserter
Filter Inserter
Posts: 398
Joined: Sun May 21, 2017 6:28 pm
Contact:

Re: Wide Splitter (3 belt splitter)

Post by Therax » Mon Jul 09, 2018 7:59 pm

eradicator wrote:But don't they select their pickup_target based on the pickup vector and collision box? If yes then you should be able to achieve 1x3 by having loaders without a collison_box. So maybe the real problem is the inserters ability to deviate from it's original drop/pickup target (does it even? or does it just look like that because collision_"boxes" are not collision_"points")?
If you try to create a loader with no collision_box, you get the following:

Code: Select all

Error while loading entity prototype "miniloader-loader" (loader): Transport belt connectable entities must have a non-zero collision bounding box defined.
As far as I can tell from my testing, Factorio uses the collision box only to determine which tiles the entity covers. Setting a tiny collision box on one side of the tile and pointing the inserter pickup/drop_position to the opposite side of the tile will still frequently result in the loader being selected as the pickup/drop target.
Miniloader — UPS-friendly 1x1 loaders
Bulk Rail Loaders — Rapid train loading and unloading
Beltlayer & Pipelayer — Route items and fluids freely underground

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

Re: Wide Splitter (3 belt splitter)

Post by eradicator » Mon Jul 09, 2018 10:46 pm

Therax wrote:As far as I can tell from my testing, Factorio uses the collision box only to determine which tiles the entity covers. Setting a tiny collision box on one side of the tile and pointing the inserter pickup/drop_position to the opposite side of the tile will still frequently result in the loader being selected as the pickup/drop target.
This makes me very sad :|. I guess you tried spawning them in in the "right" order? Or do they reselect new targets even after being built? (And what about if the loader wasn't active when the inserter is placed...)
I think i'm down to wild guessing.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 6674
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Wide Splitter (3 belt splitter)

Post by bobingabout » Tue Jul 10, 2018 8:03 am

eradicator wrote:
bobingabout wrote:would love
would love 1x1 splitter that splits to all three sides :x.
That's good too.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.

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

Re: Wide Splitter (3 belt splitter)

Post by eradicator » Tue Jul 10, 2018 11:38 am

bobingabout wrote:
eradicator wrote:
bobingabout wrote:would love
would love 1x1 splitter that splits to all three sides :x.
That's good too.
Oh great, my :sulking: ascii-smiley gets converted into a :mad face: picture-smiley when other people quote it.
Thank you forum software for making me look like an idiot. :oops:
Let's hope Therax at least succeeds in making the splitter :).

User avatar
Therax
Filter Inserter
Filter Inserter
Posts: 398
Joined: Sun May 21, 2017 6:28 pm
Contact:

Re: Wide Splitter (3 belt splitter)

Post by Therax » Tue Jul 10, 2018 5:12 pm

eradicator wrote:
Therax wrote:As far as I can tell from my testing, Factorio uses the collision box only to determine which tiles the entity covers. Setting a tiny collision box on one side of the tile and pointing the inserter pickup/drop_position to the opposite side of the tile will still frequently result in the loader being selected as the pickup/drop target.
This makes me very sad :|. I guess you tried spawning them in in the "right" order? Or do they reselect new targets even after being built? (And what about if the loader wasn't active when the inserter is placed...)
I think i'm down to wild guessing.
So it turns out that "internal iteration order" isn't strictly build order once you start mixing building and mining. I think there are internal structures where slots are opened up when entities are destroyed, and the first empty slot is used when building, so it's not possible to reliably build things in the "right" order to get the desired behavior.
Let's hope Therax at least succeeds in making the splitter :).
If my interface request isn't implemented, your loader-based version would probably be more than sufficient for the OP's purposes. :)
Miniloader — UPS-friendly 1x1 loaders
Bulk Rail Loaders — Rapid train loading and unloading
Beltlayer & Pipelayer — Route items and fluids freely underground

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

Re: Wide Splitter (3 belt splitter)

Post by eradicator » Tue Jul 10, 2018 5:27 pm

Therax wrote:So it turns out that "internal iteration order" isn't strictly build order once you start mixing building and mining. I think there are internal structures where slots are opened up when entities are destroyed, and the first empty slot is used when building, so it's not possible to reliably build things in the "right" order to get the desired behavior.
As long as the internal order doesn't change later on you can brute-force it.
  1. Build all the things you need for the complete structure. This will "reserve" the slots you need.
  2. Destroy them all.
  3. Rebuild them in the correct order.
Though...if that approach worked it should really work in step one already.
And a slot-based system kinda doesn't sound like a good internal structure. Didn't they say it was a ring in some ancient FFF? If they only purge empty "slots" from the ring once a tick that might still behave as you observed i guess.

My loader based cross-splitter does have some benefits yea. Amongst all...it's easy to implement :p.
At least if you don't want a custom 4-way filter gui. Or multi-item support. If you use an unfiltered chest: Imagine if you have a two sided ore belt coming in. Now you filter ore1 north and ore2 south. But if ore1 isn't used at the same rate as ore2 one of them will fill up the internal buffer and eventually block all transfer.
screenshot_11620.png
screenshot_11620.png (213.85 KiB) Viewed 1052 times
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

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

Re: Wide Splitter (3 belt splitter)

Post by eradicator » Fri Jul 13, 2018 11:26 am

So. After testing many things i've come to the conclusion that 1x1, 3x1, or anything else with width Nx1 seems to be unfeasible. 3x2 or 3x3 might still be possible.
Did anyone else have more success?
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Ideas and Suggestions”

Who is online

Users browsing this forum: No registered users