Fit integer number of items in transport belt

Suggestions that have been added to the game.

Moderator: ickputzdirwech

Yoyobuae
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Nov 04, 2016 11:04 pm
Contact:

Re: Fit integer number of items in transport belt

Post by Yoyobuae »

MeduSalem wrote:At least I don't think that XKnights suggestion of having a constant integer value of items on a single belt tile is possible from a hypothetical perspective even if the item distance was adjusted to be conform with a belt tile length... there'd still be the moment when there are 4 items on the tile and the moment when there are only 3 items on the tile.
9 belt tiles already contain a constant integer number of items if the belt is fully compressed, easy to confirm via circuit network. The distances/positions work out so that the same tick an item enters first belt another item exits the last belt.

XKnight's suggestion just means the same thing would happen within a single belt tile.

User avatar
MeduSalem
Smart Inserter
Smart Inserter
Posts: 1486
Joined: Sun Jun 08, 2014 8:13 pm
Contact:

Re: Fit integer number of items in transport belt

Post by MeduSalem »

Yoyobuae wrote:9 belt tiles already contain a constant integer number of items if the belt is fully compressed, easy to confirm via circuit network. The distances/positions work out so that the same tick an item enters first belt another item exits the last belt.

XKnight's suggestion just means the same thing would happen within a single belt tile.
How is that possible after 9 tiles... Rounding errors?

Because in theory if the item-distances align perfectly with the tile entrance AND exit then you get 1 item more than you'd get if the item-distances are not exactly matching up with the tile entrance AND exit... so there's at least a small window where you should get one 1 item more than what is average.

Yoyobuae
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Nov 04, 2016 11:04 pm
Contact:

Re: Fit integer number of items in transport belt

Post by Yoyobuae »

MeduSalem wrote:How is that possible after 9 tiles... Rounding errors?

Because in theory if the item-distances align perfectly with the tile entrance AND exit then you get 1 item more than you'd get if the item-distances are not exactly matching up with the tile entrance AND exit... so there's at least a small window where you should get one 1 item more than what is average.
Nope, there's not. An item is considered to enter a belt tile once it's FULLY inside the belt tile. And it's considered to exit a belt tile once it's FULLY outside the belt tile.

There's no situation where an item is not on a belt tile. Even on the situation where it's partway from belt tile A into belt tile B, it still counts as being on belt tile A.

Here's a diagram:

Code: Select all

t   slots
i   0              1               3               1               3
c   1              6               2               6               2
k   +------------------------------++------------------------------+
    |----------------------------*********-------------------------|
1   |               1              ||             0                |
    |------------------------------||------------------------------|
    +------------------------------++------------------------------+
                                                                  
                                                                  
    +------------------------------++------------------------------+
    |-----------------------------*********------------------------|
2   |               1              ||             0                |
    |------------------------------||------------------------------|
    +------------------------------++------------------------------+
                                                                  
                                                                  
    +------------------------------++------------------------------+
    |------------------------------*********-----------------------|
3   |               1              ||             0                |
    |------------------------------||------------------------------|
    +------------------------------++------------------------------+
                                                                  
                                                                  
    +------------------------------++------------------------------+
    |------------------------------|*********----------------------|
4   |               0              ||             1                |
    |------------------------------||------------------------------|
    +------------------------------++------------------------------+
There's two boxes side by side of each of width 32 representing the 32 slots of a belt. There's a item on belt which occupies 9 slots represented as 9 asterix characters. At each step the item moves forward one slot (ie. like yellow belt 1 slot/tick speed). The number on the middle of each belt tile represents the count of items on the belt.

User avatar
MeduSalem
Smart Inserter
Smart Inserter
Posts: 1486
Joined: Sun Jun 08, 2014 8:13 pm
Contact:

Re: Fit integer number of items in transport belt

Post by MeduSalem »

Yoyobuae wrote:Nope, there's not. An item is considered to enter a belt tile once it's FULLY inside the belt tile. And it's considered to exit a belt tile once it's FULLY outside the belt tile.
Ah now I get it. I thought that "which tile an item is on" is only considering the exact center point of the item... I totally forgot that Factorio actually works with bounding boxes around each item. :roll:

So yes then it makes sense that it is possible for a constant number of items to be measured once the belt is fully compressed because for each item that fully leaves the belt tile another item fully enters the belt tile in the very same tick.

Post Reply

Return to “Implemented Suggestions”