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.
Mods introducing new content into the game.
I'm afraid that this request might break your code structure too much, but I'll ask it, anyway... :)
I really love the way that you have provider and receivers and a set of classes and item definitions. But, I don't much like having to configure it using "throughput", "delivery size" and "latency". It just seems to make it harder for me to think about and balance my factories.
Perhaps it's the way that I play?
I do think that I understand the reasoning behind the "Throughput" system and using a factory calculator, but I don't play Factorio that way.
I tend to spend all of my time in the early development stages, laying everything out and hunting down resources and stuff. When I get to the end game, I want to start a new one with slightly different settings.
This playstyle means that the track layout is constantly changing, as competing requesters and providers are added and the layout is reworked to cope with other changes. So, there is never a correct value for "Throughput", "Delivery Time", etc; they are always changing and I just set them all to some value that doesn't obviously fail. I haven't, yet, encountered a problem that would be cured by being able to change the latency.
Instead of this, I think that I would much prefer to be able to set "minimum" and "maximum" thresholds for the amount of an item (in stacks) that I want the target to have in its storage. And for SSSP to try to keep the stations within these limits as best it can, using a "priority" value to control the order in which it allocates any resources that are in short supply.
Would it be hard to code this "min" / "max" mode, or does it break too much of the code?
Delivery time, throughput, and latency in reality are all just used to calculate that "required storage" value, which is effectively the maximum value you are talking about. I do think that you are overthinking how important getting the values exactly right actually is. It is perfectly reasonable to just pick some high values for things and be fine with that.
For delivery time, I use 150 seconds on everything, but that is for a very large base. For normal sized bases you could probably just pick something like 90 seconds and be fine forever. This value is not intended to change frequently, if ever - just pick some large value and leave it. The only downside is you might buffer a few more items than needed. You CAN try to get it exact for every item, but you really shouldn't.
Latency is, as you guessed, also is not something you really need to worry about most of the time. That is why it has a default value of 30 seconds. It is there mostly for doing weird things (one of which I explain below).
As such, the only values that you really need to think about 99% of the time are delivery size and throughput. Delivery size is really quite similar to delivery time in that it is rarely going to change. Just set it to the number of items that can fit in whatever kind of train you are using. Or, if you want to transport fewer items at time (for example with very expensive items), then use a smaller value.
So, the only value you really need to worry about is throughput. And IMO that is the simplest value of all. Do you want to draw 2 yellow belts from a requester? Set it to 30. One belt? 15. And so on.
All of that said, you can effectively set a minimum item count using a simple trick if you really want to. If you set throughput to 1, then latency becomes a minimum count. So if latency is 2000, you're saying "keep enough items to draw 1 item per second for 2000 seconds". And that "enough items" value happens to be 2000. Replace 2000 with any other value you want and it will still be a minimum count. I don't think you should do this everywhere though. I only use this for advanced stations where I'm doing funky things with requesting spoilable items.
Thanks for the extra explanation!
However, while I have been changing the values mid-game, I have hit two issues:
I find that the Network dialog is rather fragile. You have to edit it without any values becoming temporarily invalid, e.g. zero or empty, even for a fraction of a second. Otherwise, all of the linked trains will instantly switch to manual and effectively "disable" themselves.
For example, if the value is "100", and you highlight it and type "200", it works (because the mod sees "100", then "2", then "20", then "200". If you delete the whole value by hitting backspace and then type "200", the mod stops all of the trains, apparently because it sees "200", then "" (ouch!), then "2", then "20", then "200".
It's fixable, by searching for "Empty" trains and switching back to automatic, but it's a bit of a pain to do this and it took me a while to work out how. If you would add a "Confirm" button to the dialog, that would be very helpful and avoid this problem for me.
In making all of the changes, I have somehow got my factory into a state where some trains just sit with full wagons, occasionally going in circles before returning to the same provider. They appear to be unwilling to supply receivers that are starved, and my factory has "stopped".
If you look at this game: https://drive.google.com/file/d/1RmzVpOPg1OGeseNUQw4Fyh0SPnbKpxW6/view?usp=drive_link
The train that you're seeing is full, but the "red circuit" assemblers are not being supplied. For example, zoom out the map until you see the tags and and scan right about a screen-width to the block that is tagged with a red circuit icon; then zoom back in and look at the receiver station towards the top of the square "block" of rails. It is waiting with a deficit of ~2k for copper circuits (and has been waiting for a couple of hours at the time of the save). Why is that "full" copper-cable train not supplying it? There are many examples of this all over the factory and the depot is now empty, so that nothing is flowing properly.
Can you take a quick look at it and see if something else is going wrong, before I give up? Some of the network settings may be weird now, because I've been trying different things to kick it into working properly. :)
Thanks
1: I absolutely agree here. There are a few potential solutions, but I think that the simplest would be adding a button to quickly switch all trains in a class to automatic. Sort of like the /sspp-reboot command, but without affecting things that are already working. There's also the option of making the network GUI only apply changes with a confirm button, though that would need a huge amount of work, and would introduce other usability issues.
2: That doesn't sound good! I'd have a look but it seems that you didn't make the google drive link public, so I can't access it. I will have a look if you can give me access or make it public.
I tried my best to explain what is happening, with pictures. From what I can tell, it is the same issue everywhere, but I go into detail with one item. Let me know if the explanation helps!
EDIT: because editing on imgur isn't working, here's some extra points:
30 seconds is really low for delivery time. I expect that it takes a train significantly longer than that to make a delivery. Your base is actually quite large, my guess is a value around 100 seconds should be large enough to never need to increase it. As you can see from what I said before, you actually have plenty of space at your stations, so using a safe, large value for delivery time won't cause any issues.
Basically, to avoid having to change things, do things in this order whenever you set up a new item:
1. Decide on a delivery size. If you are using 1-1s everywhere (like I do, they are great!), then this should probably always be a full train load (2000 for stack size 50, 4000 for stack size 100). The only reason to use less is if you are transporting very expensive items (items where even producing a full train load would take a VERY long time).
2. Come up with a safe estimate for delivery time. It might be somewhat counterintuitive, but you actually want to set this value really high to start with. You can work this out yourself if you want to by riding a train around and coming up with a good number based on the size of your base, but you don't need to. Just set it to 100 or more and then don't worry about it.
3. Set up your stations. Don't touch the network settings for this item unless you really need to. Now, for every new station for this item that you add, you only need to worry about one value - throughput.
Edit2: There is one more issue, that you won't need to worry about if you set delivery size to be a full train load, but you do need to worry about if you want to do smaller deliveries. Your providers aren't making use of the output of the provide combinator to control loading. This means that your stations will just keep loading until the wagon is completely full, which would mean it would be possible for things to get stuck because too many items get delivered.
Here's how you can set up your providers to not do that, if using loaders https://imgur.com/a/aHOZ57R
You would also need to make use of the granularity setting, but honestly I'm pretty sure trying to explain that would be a mistake since really you should just set delivery size to a full load for the way your system is set up, but let me know if you'd like me to explain it in detail!
Edit3: Aaaaaand I just noticed you are using a mod that increases the stack sizes of various items to extremely high numbers. For those, yeah, you're going to need to do partial train loads.
Thanks for that; a very helpful and detailed response, indeed!
I'll make the changes that you say and hopefully everything will unlock itself. It all comes from the fact that I have found it hard to think in terms of the "throughput" system. Everything it was working well until I just got confused and desperately starting changing things to work out what was wrong!
Switching all trains to automatic would be fine for me as a solution to the first problem with keyboard input on the Network dialog. I understand the reasons why it happens; immediate GUIs are much better than passive ones in almost every way, but they can introduce some timing hazards when dealing with a stateful thing like user input.
another thought ...
Would it be a good idea to have a "default" checkbox that sets the text boxes to your sensible values based on the item stack size etc? That should give new users a rough idea of what sort of values should work in most cases.
I'm not sure that having a default for delivery size would be a good idea, I think that it is an important setting that the user does need to understand. I think it would be a good idea to add more information into the tooltip though. It should say something like "For most items and fluids, you should set this to the maximum amount that can fit in one train. If it would take a very long time to produce a full train load of a particular item or fluid, then you can use a smaller value instead."
Also for delivery time. It should have a note like "It is much better to set this value too high than too low. If you are unsure, most bases will want to use a value between 100 (a vanilla or space age base) and 200 (a huge py base). You may want larger values for resources that have to travel much further, like ores."
Personally, I understood it when you told me how to calculate it. I think in terms of numbers and descriptions (it takes me ages to work out what the screenshots are telling me). But maybe I'm unusual in that?
This would be a useful tooltip for people like me:
"A good starting value for basic items like ore is the capacity of the train in items (not stacks), e.g. 2,000 for a wagon with 40 slots and an item stack size of 50"
Once I read that part of your description earlier, I knew what it was doing and how to set the values that I want. To me, the universe is mathematical. :)