SSPP Logistics Train Mod

by jagoly

A logistics train mod that aims to be as pleasant to use as possible, even when knee-deep in byproducts. SSPP stands for Source-Sink-Push-Pull.

Content
10 days ago
2.0
584
Logistics Trains

g Multi-provider: Leftovers stuck in loaders

a month ago

Hi! I've been testing your great mod and i find it very user-friendly and convient to use. Yet I'm stuck with one problem i don't know how to solve. I have a station that provides multiple items (4 to be exact) and sometimes after a pick-up some leftovers are left in loaders so the next train gets them loaded into its' wagon and gets stuck. I played with the settings so now I always have some extra space in wagons, but the problem is still there. I think the issue is because the train leaves instantaneosly after it stops sending the signal to loaders filters.
Can you please add a little delay between the moment a train stops its' signal and the moment it starts moving?
Thanks for the mod!

a month ago
(updated a month ago)

Hi! The mod does actually have a feature to deal with this exact problem, the "granularity" setting on providers. Basically, this should be set to however many items are loaded at once. If you're using inserters, then this is the sum of the hand sizes. So, if you have 6 inserters with a capacity of 12 each, then granularity would be 6*12=72. This will adjust the load target automatically so that items will stop loading before the train has too many items. There's no need to wait, because if set correctly the inserter filters will be cleared at the same time as the train reaches it's target, so the inserters won't pick up any extra items in the first place.

Edit: like this https://imgur.com/a/agMwM8G

a month ago

Yes, I guessed that. The problem is that i'm using a quite popular 'loaders' mod and a typical station setup includes 2 loaders (one that unloads from container and one that loads onto wagon) so the leftovers are in that second loader. In CS it's not a problem because they put a 1 sec inactivity condition on every station in train routines. Please check images:

https://imgbox.com/Rv83KMML - typical setup
https://imgbox.com/o5Y7jhhM - leftovers in loaders after a train leaves
https://imgbox.com/vbO26CuZ - next train stuck

a month ago
(updated a month ago)

The reason that the mod doesn't have an option for an inactivity condition is that relying on one means that a train will load more than it should. This is in general not a good idea, as this can result in deadlocks at requesters if they become full at the same time that demand stops for that item.

Currently, making use of granularity with loaders requires adding a segment of belt between the loaders set to read contents, setting granularity to (loaders * 4 + belts * 8), and connecting that to the input of the provide combinator. This way, filters will get cleared before the train actually meets it's condition. None of that is needed with inserters (or cranes, which I use).

I could however add a "loaders" toggle to stations, which would change the way granularity behaves. It would make it so that an extra instance of granularity is subtracted from the provide output (filters), but not the schedule condition. This way, at the moment the schedule condition is met, the loaders are empty. Would that be suitable?

a month ago
(updated a month ago)

Yes it would be great.
I managed to make it work with an arithmetic combinator. I just substract some constant number from the provider output signal. The problem is to calculate that number right because it depends on the number of loaders and loaders speed. For my example I used 6x2 red loaders (30 pcs/sec), granularity 180, delivery size 1800 and I needed to substract 48 from the input to meet the condition of amount of items with extra 8 items loaded into the wagon. Granularity and delivery size seems not too important as you just need to have some space in the wagon after the condition is met (it also works with granularity 190, delivery size 1900, but it's not working if i set 200/2000 respectively).
As you mentioned, in this workaround some extra items (8 in my example) are loaded and there's a possibility of a deadlock on a requester side.

a month ago
(updated a month ago)

You should also be able to work around it by feeding a constant combinator with the value of what would be granularity (so, assuming your loaders hold 2 items each, and you have 6*2 of them, granularity would be 6 * 2 * 4 = 48) into the input of the provide combinator, then in the station GUI just setting granularity to 1. That's basically what the option I proposed would do, but without needing an extra combinator. It doesn't matter if the provide comb gets signals for all items all the time.

I'll still look into adding that as a built in option though, one goal of SSPP is that 99% of stations shouldn't need to worry about extra combinators :)

Edit: Regarding getting exact loads, the important thing is that delivery size is some multiple of however many loaders you have. So if you have six pairs of loaders, they can move up to 12 items per tick (6 * 2 lanes). So if you set delivery size to 1992 (1992 / 12 = 166), then you should be able to load exactly.

30 days ago

I'll post images of a setup that works perfect for me in case someone else needs it. So as you said delivery size should be divisible by loaders count.
I still don't get it how you do it without arithmetic combinator.

Here's my settings for 6 lane loaders provide multi-item station setup:
[Network]
delivery size = 1992 (for stacks 50) and 3984 (for stacks 100)
[Station]
Granularity = 6 * 2 * 4 = 48
[Arithmetic Combinator]
each - 48

This way wagons are loaded exactly the requested amount with no leftovers in the loaders.

https://imgbox.com/ZGKUp4TG
https://imgbox.com/OGlAnfWw
https://imgbox.com/yhtf2ulG

19 days ago

Hey again, new version is up! It changes the way granularity works to subtract rather than round down (this still works with cranes, but also works with loaders). It also has a new station option to add an inactivity condition for items. You should now be able to just set granularity to 48, enable the inactivity condition, and everything should just work. No need for extra combinators!

17 days ago

Thanks for the update! I tested it and it works as expected. It's much easier to setup now.

Since you added inactivity condition to provider maybe you can add it to refuel station as well? That way i can load any type of fuel and the train won't stuck if there's not enough of one particular type.

16 days ago

Ah yeah, I see what you mean, different fuel in each slot. I don't think just adding an inactivity condition is a good idea though. What should happen if the fueller has run out of all kinds of fuel? How much fuel is "enough" fuel for the train to leave? I'll have a think about it, but I can't guarantee that this will be implemented. If it is, it'll be as a global mod setting with a big warning on it 😅

New response