[15.35] circuit-connected inserter sometimes drops a tick early

Bugs that are actually features.
Post Reply
blueyoshi321
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Sep 29, 2017 8:20 am
Contact:

[15.35] circuit-connected inserter sometimes drops a tick early

Post by blueyoshi321 »

I set up some circuits to try to get two stack inserters to fill one side of a belt. As I understand it, a yellow belt has 32 slots, moves items one slot per tick, and can only hold items every 9 slots. Therefore, with a stack size of 12, we can have two inserters, each activating every 9 * 24 = 216 ticks, with the upstream inserter activating 9 * 12 - 32 = 76 ticks after the downstream one.

That almost works.
screenshot.png
screenshot.png (570.46 KiB) Viewed 1009 times
In the screenshot, the combinators above the belt form a 216-tick clock on signal T. The downstream (left) inserter activates on T = 0, and the other one on T = 76.

The leftmost combinator below the belt just counts up one every tick. The remaining ones record the value of the counter each time an item enters the connected belt and output the counter mod 9 to the pole. For a compressed belt, that value should be constant.

In the pictured setup, however, the upstream inserter drops every other stack one tick early -- the output is 4 instead of 5 half the time, which means there are large gaps in the output, as the downstream inserter gets stuck with an extra item and then misses its next stack.

In the first attached save, there's also an identical setup next to the pictured one that works correctly! The inserters cross a chunk boundary, which is interesting, but in the second save, there are two identical setups, both crossing chunk boundaries, where one works and one doesn't. In some brief testing, I got the impression that crossing a chunk almost always works (but sometimes doesn't), and not crossing a chunk almost never works (but sometimes does, which I saw in another save). The direction might also have something to do with it. All setups were placed with Creative Mode's instant blueprint construction.

Finally, rotating or removing the downstream inserter, or disconnecting it from the wire, seems to cause the upstream one to reliably drop at the same time every cycle. (Disconnecting the inserter also achieves the original purpose of filling the belt, but this behavior is still weird. I'm a bit paranoid that I've missed something, but I'm pretty sure that something buggy is happening.)
Attachments
inserter-tick-bug-submit.zip
first save
(1.59 MiB) Downloaded 44 times
inserter-tick-bug-submit-2.zip
second save
(2.22 MiB) Downloaded 47 times
mods.zip
(1.64 MiB) Downloaded 49 times
factorio-current.log
(9.99 KiB) Downloaded 49 times

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

Re: [15.35] circuit-connected inserter sometimes drops a tick early

Post by quyxkh »

When an inserter's waiting for a gap to drop an item it doesn't always manage to make it land absolutely perfectly behind the item in front. It's part of the game, if you want anything to behave at the absolute limits of performance you're going to need to compensate for unavoidable minor imperfections irl too. If you use the mass-produced machinery you've got as-is without that you'll get 95+% of what's theoretically achievable, or you can find or figure out some clever way to squeeze that last bit of performance out of it.

Post Reply

Return to “Not a bug”