Confused about Locked Slots

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

Post Reply
UFTimmy
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon Oct 16, 2017 7:39 pm
Contact:

Confused about Locked Slots

Post by UFTimmy »

So my understanding is that the locked slots per wagon setting is used when you have a provider that could provide more than one item. And it's designed to never fully fill a wagon, so stack inserters will always have room for their leftovers.

So my understanding is you put the signal to X slots at the provider, and LTN does something to lock the slots. But that's where my understanding ends.

Are the locked slots supposed to be locked with the red spaces like you do an X? Or does LTN just request less? In my very limited testing, I could not see any difference with setting it to 10 (for testing) vs. not setting it at all.

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

Re: Confused about Locked Slots

Post by Optera »

Locked Slots reduces the slots the dispatcher is allowed to allocate for deliveries from that provider.
For example a full load from a provider with locked slots = 2 will result in a schedule to pick up >= 3800 iron plates per wagon.

UFTimmy
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon Oct 16, 2017 7:39 pm
Contact:

Re: Confused about Locked Slots

Post by UFTimmy »

Thanks! That will help my testing, and it makes sense. I was looking for the slots on the wagon to be locked, but I am not sure why. That would not help with the left overs.

So just to make sure I am understanding correctly:

I use 8 wagon trains. Metal plates stack to 100, so my normal train full is 32,000 when carrying plates.
If I set the provider to lock 2 slots, LTN will automatically drop the request by 2 slots * 8 wagons, which is 1,600 plates. So it would request 30,400 instead of 32,000? And then I will have a train that has 30,400 plates + whatever left overs the stack inserters snuck on?

And this is the formula you should be using to figure out how many slots to lock?
[stack size] / ([inserters per wagon] * [inserter stack size])

Thanks for the mod, I am having a blast setting everything up.

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

Re: Confused about Locked Slots

Post by Optera »

Yes, the math is correct.

The formula for locked slots is a guideline that should work well for any number of inserters and stack size. In reality you can often get away with locking fewer slots by making loading more precise.
For example 10 stack inserter set to stack size 10 will load a complete stack of iron plates in exactly one rotation.

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

Re: Confused about Locked Slots

Post by mrvn »

Some thoughts about locked slots:

- LTN will request full slots so any left over needs to go into a new slot
- goods can't share slots so you need one reserved slot per good for left over
- every wagon can have left overs so every wagon needs their own reserved slots
- Every inserter can have goods left over. The sum of left over items can exceed a slot.
- with W wagons and G goods at a stations you need at least W * G reserved slots.
- with N stack inserters per wagon and W wagons and stack size S you need ceil(12 * N / S) * W reserved slots.
- A combination of the last too can require even more. E.g. 4 stack inserters, 1 wagon, 4 goods, stacksize 12 each needs 8 slots, not 4 or 5.

Maybe instead of reserved stacks LTN should be told about the number and type of inserters per wagon. So a station with 4 stack inserters per wagon sets a signal of stack inserter=4 and LTN then knows to leave space for 4*<stack inserter bonus> extra items per wagon. It would mean less space is lost especially for multi good stations when only one good is requested.

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

Re: Confused about Locked Slots

Post by Optera »

mrvn wrote:Some thoughts about locked slots:

- LTN will request full slots so any left over needs to go into a new slot
- goods can't share slots so you need one reserved slot per good for left over
- every wagon can have left overs so every wagon needs their own reserved slots
- Every inserter can have goods left over. The sum of left over items can exceed a slot.
- with W wagons and G goods at a stations you need at least W * G reserved slots.
- with N stack inserters per wagon and W wagons and stack size S you need ceil(12 * N / S) * W reserved slots.
- A combination of the last too can require even more. E.g. 4 stack inserters, 1 wagon, 4 goods, stacksize 12 each needs 8 slots, not 4 or 5.

Maybe instead of reserved stacks LTN should be told about the number and type of inserters per wagon. So a station with 4 stack inserters per wagon sets a signal of stack inserter=4 and LTN then knows to leave space for 4*<stack inserter bonus> extra items per wagon. It would mean less space is lost especially for multi good stations when only one good is requested.
Locked slots is something players need to calculate or tune themselves based on their station design and stack size bonus.
Having one chest/item instead of mixed chest will completely change the items inserterted/cycle.
Even on uniform systems an emptying chest will result in different amounts of items inserted.

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

Re: Confused about Locked Slots

Post by mrvn »

Optera wrote:
mrvn wrote:Some thoughts about locked slots:

- LTN will request full slots so any left over needs to go into a new slot
- goods can't share slots so you need one reserved slot per good for left over
- every wagon can have left overs so every wagon needs their own reserved slots
- Every inserter can have goods left over. The sum of left over items can exceed a slot.
- with W wagons and G goods at a stations you need at least W * G reserved slots.
- with N stack inserters per wagon and W wagons and stack size S you need ceil(12 * N / S) * W reserved slots.
- A combination of the last too can require even more. E.g. 4 stack inserters, 1 wagon, 4 goods, stacksize 12 each needs 8 slots, not 4 or 5.

Maybe instead of reserved stacks LTN should be told about the number and type of inserters per wagon. So a station with 4 stack inserters per wagon sets a signal of stack inserter=4 and LTN then knows to leave space for 4*<stack inserter bonus> extra items per wagon. It would mean less space is lost especially for multi good stations when only one good is requested.
Locked slots is something players need to calculate or tune themselves based on their station design and stack size bonus.
Having one chest/item instead of mixed chest will completely change the items inserterted/cycle.
Even on uniform systems an emptying chest will result in different amounts of items inserted.
Inserter bonuses change over time. And new player will not even know how much. The required slots also depend on the items stack size. So you need a different value for ores, plates, science packs, ... Most of those variables LTN could compute itself. What LTN can't know is the station design and the relevant variable there is the number and type of inserters. You can never have more goods left over than the inserters can hold in their hand. Having 6 inserters with 6 chests or 6 inserters with a common chest doesn't matter. All 6 inserters can have left over items in their hand.

Similar, assuming all goods are requested (which is the worst case) having one item per chest all 6 inserters still can have goods in their hand same as with a common mixed chest. If only on good (or less than there are provided) are requested then it makes a difference. But assuming all inserers may hold goods still ensures enough space is left. It might not all be needed but you have to plan for the worst case to make a reliable station.

I don't see a way to tell LTN about how much space to reserve depending on the number and kind of goods it will request. So you have to set the worst case and I think in general going by number and type of inserters would utilize more space on the trains than the locked slots and wouldn't have to change over the course of the game. It would be far easier to say "If you have 4 fast inserters loading each wagon then set fast inserter=4 on the lamp" instead of explaining how to compute the right locked slots amount considering the inserters, bonuses and stack size.

PS: if you have one chest per item and KNOW only one good will be requested at a time then you can set the signal to the number of inserters per chest. Just like you can set the locked slots accordingly with the same knowledge. So going by inserters doesn't change anything there. It would just factor out the other variables of bonuses and stack size.

Post Reply

Return to “Logistic Train Network”