Page 1 of 1

Need description of inserter pick-up algorithm

Posted: Sat Aug 22, 2020 3:50 pm
by uukgoblin
Hi, I'm looking for a comprehensive explanation of the pick-up algorithm (i.e. how do inserters decide which lanes to pick things up from, when do they switch the lane during pick-up and why, and what's causing them to slow down and why). I think the current behaviour is slightly crazy: when a belt has both lanes full, picking from it should be faster than from one that has just one lane full. If the far lane pick up throughput is faster, why "prefer" the near lane?

Also, the wiki at https://wiki.factorio.com/Inserters#Ins ... port_belts is slightly misleading:
If the belt is perpendicular to the inserter, inserters prefer taking items from the nearest lane.
After reading this, someone could think that if both lanes are full of items, by "prefering" to take items from the nearest lane, the inserter should only pick items on that lane. That's not the case, at it seems to only pick up about 80% of items from the nearest lane in some cases, and the other 20% come from the farther one. So "prefer" here means "it will pick up more items from the nearest lane" rather than "all items". Here's a blueprint illustrating the issue (please read the description):


Re: Need description of inserter pick-up algorithm

Posted: Sat Aug 22, 2020 4:22 pm
by Serenity
uukgoblin wrote: Sat Aug 22, 2020 3:50 pm If the far lane pick up throughput is faster, why "prefer" the near lane?
Optimization. Inserters are belts are already some of the most computationally intensive things in the game