Train 2.0 question

Post all other topics which do not belong to any other category.
Roflhouse42
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Nov 10, 2023 7:28 pm
Contact:

Train 2.0 question

Post by Roflhouse42 »

Hey, I am trying to wrap my head around the generic train example in the latest FFF and i can't quite get it. I get the unloading of trains with interrupts which is cool and allows for the tain to unload at any stations based on inventory. I however don't understand the loading stations. If all loading stations have the same name then how do they balance? For example, let's say i have a 10 iron ore loading stations that are close to my factory and 3 copper loading station very far away. what i want is for trains to pick up both copper and iron at roughly the same rate, however the trains in my network will heavily favor the closer item loading stations no? like the trains will only ever go to the copper stations when the iron stations are full of waiting trains.

Do you think the expected use case for the generic trains would be to have just a shitload of idle trains? or do they expect us to more carefully balance the input of items into the train network? or am i missing something?

Loewchen
Global Moderator
Global Moderator
Posts: 8969
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Train 2.0 question

Post by Loewchen »

That is my concern as well, you would need some method to globaly limit how many trains load at specific station types.

Rseding91
Factorio Staff
Factorio Staff
Posts: 14147
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Train 2.0 question

Post by Rseding91 »

It’s already possible to limit how many trains can go to a given stop.
If you want to get ahold of me I'm almost always on Discord.

astroshak
Filter Inserter
Filter Inserter
Posts: 635
Joined: Thu May 10, 2018 9:59 am
Contact:

Re: Train 2.0 question

Post by astroshak »

I don’t think it is reasonable to have all loading stations the same name. I do think (though I won’t be using interruptions this way) you could use the same unloading station and send the train to copper, iron, coal, or stone based on the amount of material on hand at the factory though.

One unloading station for various materials, with various loading stations they get sent to by interrupt.

For example, an advanced circuit making outpost could only have two train stops : loading and unloading. Loading simply loads the circuits onto the train for delivery. Unloading takes train loads of electronic circuits, plastic, and copper plate and sends them to several chests. Monitor the copper chests to know when to send the train to pick up copper; similarly monitor the plastic and electronic circuits storage areas to know when to send the one train to get one of those loads.

I don’t see myself using interrupts that way but it could be fun to do for a game or two.

Loewchen
Global Moderator
Global Moderator
Posts: 8969
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Train 2.0 question

Post by Loewchen »

Rseding91 wrote:
Sat Dec 16, 2023 5:40 pm
It’s already possible to limit how many trains can go to a given stop.
Yes, but when using generic schedules trains will now switch items. If you run out of copper or it is further away than other available cargo, no train will get copper until all iron and coal and stone mines and their unload stations are occupied, and if you run out of trains before that, then you are stuck for good. You obviously don't have to use generic schedules, but there is no good way to stabilize this if you want to use them afaik.

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Train 2.0 question

Post by FuryoftheStars »

Loewchen wrote:
Sat Dec 16, 2023 6:23 pm
Rseding91 wrote:
Sat Dec 16, 2023 5:40 pm
It’s already possible to limit how many trains can go to a given stop.
Yes, but when using generic schedules trains will now switch items. If you run out of copper or it is further away than other available cargo, no train will get copper until all iron and coal and stone mines and their unload stations are occupied, and if you run out of trains before that, then you are stuck for good. You obviously don't have to use generic schedules, but there is no good way to stabilize this if you want to use them afaik.
Couldn't circuit signals be used for this? I thought they said in the FFF that interrupts could use those, or am I wrong?
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics

Loewchen
Global Moderator
Global Moderator
Posts: 8969
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Train 2.0 question

Post by Loewchen »

FuryoftheStars wrote:
Sat Dec 16, 2023 6:38 pm
Couldn't circuit signals be used for this? I thought they said in the FFF that interrupts could use those, or am I wrong?
Maybe, but the only time for that interrupt is the departure at the unload station and I don't see how you could reasonably get access to a signal that indicates "no trains are currently going to copper but lots of trains are going to other stations" unless you literally connect every single station to a circuit network and read the current limits.

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Train 2.0 question

Post by FuryoftheStars »

Loewchen wrote:
Sat Dec 16, 2023 6:50 pm
FuryoftheStars wrote:
Sat Dec 16, 2023 6:38 pm
Couldn't circuit signals be used for this? I thought they said in the FFF that interrupts could use those, or am I wrong?
Maybe, but the only time for that interrupt is the departure at the unload station and I don't see how you could reasonably get access to a signal that indicates "no trains are currently going to copper but lots of trains are going to other stations" unless you literally connect every single station to a circuit network and read the current limits.
You can use limits for some of that... the stations that are closer or have a surplus of materials at base can have lower limits than the stations that are further away/are low on materials. But you might be able to use signals here, too, giving a signal for those materials that are low/high that causes the interrupts to favor/block accordingly.

However, as we do not yet have the full picture of it all, I feel like this is all premature.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics

Loewchen
Global Moderator
Global Moderator
Posts: 8969
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Train 2.0 question

Post by Loewchen »

FuryoftheStars wrote:
Sat Dec 16, 2023 6:56 pm
You can use limits for some of that... the stations that are closer or have a surplus of materials at base can have lower limits than the stations that are further away/are low on materials.
That would require the circuit network to all stations and I do not think generic schedules would be worth that hassle. On the other hand, it might be possible to use the Train Count signal of the input depot stops of the main stations as signal to interrupt trains departing from them and send them to mine types with low incoming train counts.

astroshak
Filter Inserter
Filter Inserter
Posts: 635
Joined: Thu May 10, 2018 9:59 am
Contact:

Re: Train 2.0 question

Post by astroshak »

That would just be a back door train stop limit adjustment.

Unless there is something else coming for trains, I do not see generic “Loading” and “Unloading” stations being reasonable. Even with interrupts you still have to send the train to a specific (group of) station(s) based on need. Iron Ore Loading works for that purpose, to distinguish it from Steel Loading. Calling them both simply Loading does not get the train to go where it needs to, only to the station the pathfinder decides is closest and open for at least one more train.

Furthermore, I don’t really see generic Unloading being all that feasible either. How would you keep a train ferrying Plastic from trying to drop it off at your Battery outpost?

No, I still see a need for specific loading and unloading station names. What I can see is e reduction in the number of regular supply stations at any given outpost.

Loewchen
Global Moderator
Global Moderator
Posts: 8969
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Train 2.0 question

Post by Loewchen »

astroshak wrote:
Sat Dec 16, 2023 8:48 pm
Furthermore, I don’t really see generic Unloading being all that feasible either. How would you keep a train ferrying Plastic from trying to drop it off at your Battery outpost?

No, I still see a need for specific loading and unloading station names. What I can see is e reduction in the number of regular supply stations at any given outpost.
You don't need generic stations names to be able to use generic schedules if you can come up with signals that you can use as interrupt condition, for unload it is obviously the trains cargo type, for inputs it has to be a signal that indicates "needed the most right now".

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Train 2.0 question

Post by FuryoftheStars »

Loewchen wrote:
Sat Dec 16, 2023 8:07 pm
FuryoftheStars wrote:
Sat Dec 16, 2023 6:56 pm
You can use limits for some of that... the stations that are closer or have a surplus of materials at base can have lower limits than the stations that are further away/are low on materials.
That would require the circuit network to all stations and I do not think generic schedules would be worth that hassle. On the other hand, it might be possible to use the Train Count signal of the input depot stops of the main stations as signal to interrupt trains departing from them and send them to mine types with low incoming train counts.
Judicial use of logistic chests can do that. There may also be something about interrupts that we're not aware of, yet.

But again, I feel like we're trying to put the cart before the horse. We may very well find out once 2.0 releases that there's a solution for that. Or, we may find that there isn't. But if there isn't, I feel like those'd be easy suggestions to make then.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics

computeraddict
Fast Inserter
Fast Inserter
Posts: 182
Joined: Sat Oct 07, 2023 6:44 am
Contact:

Re: Train 2.0 question

Post by computeraddict »

This question appears to boil down to "how do I balance trains to loading stations when I have fewer trains than the sum of all loading stations' train limits?"

The answer is obvious once you reframe the question like this.

Add more trains. Saturate your rail network. Empty trains waiting at loading stations doesn't cost much. If saturation still isn't sufficient, have a fallback interrupt that sends trains to strategically placed waiting depots or raise train limits on loading stations.

Loewchen
Global Moderator
Global Moderator
Posts: 8969
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Train 2.0 question

Post by Loewchen »

I am not building 100 more trains just so that after 99 trains block all iron mines, iron input depots, iron unload stations, coal mines, coal input depots, coal unload stations, stone mines, stone input depots and stone unload stations I still have 1 train available to transport some copper :lol:

Roflhouse42
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Nov 10, 2023 7:28 pm
Contact:

Re: Train 2.0 question

Post by Roflhouse42 »

Loewchen wrote:
Sat Dec 16, 2023 11:29 pm
I am not building 100 more trains just so that after 99 trains block all iron mines, iron input depots, iron unload stations, coal mines, coal input depots, coal unload stations, stone mines, stone input depots and stone unload stations I still have 1 train available to transport some copper :lol:
This is what i was thinking. I but i think it is even worse because you basically run the risk of breaking your factorio every time you try and expand. You create new local minimum points for trains to find and fill. Meaning you would need to almost exactly match trains to the sum of the train limits in the factory. Which is a nutty amount of trains.

Adding to my original confusion is the comments about the depots. If you had generic trains and depots like the announcement seems to suggest then you would just get a depot full of one type of resource. which would be the closes item to that depot.

computeraddict
Fast Inserter
Fast Inserter
Posts: 182
Joined: Sat Oct 07, 2023 6:44 am
Contact:

Re: Train 2.0 question

Post by computeraddict »

Loewchen wrote:
Sat Dec 16, 2023 11:29 pm
I am not building 100 more trains just so that after 99 trains block all iron mines, iron input depots, iron unload stations, coal mines, coal input depots, coal unload stations, stone mines, stone input depots and stone unload stations I still have 1 train available to transport some copper :lol:
If you have your drop off stations dynamically limited you don't have to worry about them filling up with trains doing nothing. That's why I talked about the limit of pick up stations, not all stations.

Also if all of your drop off stations are filled, you don't need any trains going to pick up in the first place because your network is supplying more than demand.

I'm not sure where your reference to resource depots is coming from.

borgiedude
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Sep 22, 2023 10:01 pm
Contact:

Re: Train 2.0 question

Post by borgiedude »

Without version 2 to play with I can't be sure, but I think this would work.

1) Have all generic loading stations disabled by circuit logic unless they have one train's worth of cargo ready to load.
2) have a depot full of trains waiting to service any stations that are ready to load a train.
3) loaded trains choose where to unload based on their cargo and interrupts.
4) keep adding trains until all sites are regularly serviced

What I can't figure out is if the station limits are going to allow this, like when a station comes online can stations with that name have the train limit increased by one? I don't think so, but I feel like I might be missing something.

Loewchen
Global Moderator
Global Moderator
Posts: 8969
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Train 2.0 question

Post by Loewchen »

borgiedude wrote:
Sun Dec 17, 2023 8:42 am
3) trains choose where to go based on their cargo and interrupts.
How to do that is the whole point of the discussion: "If you run out of copper, how do you schedule/interrupt generic trains with generic schedules so they wait for copper to become available and not go to iron, coal or stone instead?"

Solutions we have so far:
  1. don't, just build so many trains that after all iron, coal, stone mines, unload depots and unload stations are full, there are still trains left to get copper once available
  2. build a circuit network to all mines with logic that closes all iron, coal, stone mines if no trains arrive from (or go to) copper stations
  3. interrupt trains departing from unload stations based on the Train Count signal of arriving trains to send them to mine types no trains arrive from (assuming interrupts by circuits is even possible)

User avatar
Nosferatu
Filter Inserter
Filter Inserter
Posts: 251
Joined: Fri Jan 20, 2017 4:48 pm
Contact:

Re: Train 2.0 question

Post by Nosferatu »

I'll try to think trough solution "a" based on my current 1,2k Science Base:

Copper Ore Stations: 27 - 5/8
Copper Ore Deliver: 4 - 10/12
Iron Ore Stations: 24 - 5/13
Iron Ore Deliver: 5 - 9/13
Coal Stations: 8 - 1/4
Coal Deliver: 2- 2/2
Stone Station: 7- 1/3
Stone Deliver: 2 - 2/3

Trains: 35
Copper: 15
Coal: 3
Iron: 14
Stone: 3

Assumption: Ironplates are running extremely low because of a mishap - which starves down all production and I went away for several hours.
All Copper Ore Stations and Copper Deliver Stations will be saturated with trains --> 39 trains
Coal and Stone also will be saturated --> 20 trains
I think to get Iron running again we need ~ 10 trains

So in this worst case scenario a safe number of trains would be 69 - so double what i had before.
But I think the scenario is more dangerous for Coal and Stone so i would most likely not make them generic. --> -20
And being a way so long that all of the nearly depleted mines open up is a bit overkill --> -5
We can also make the Copper and Iron deliver Stations dynamic so that they only accept 2 trains when they get full (17 instead of 25) --> -8

So that brings me to 36 Copper/Iron Ores trains instead of 29.
Thats a good number - I would use that

Not sure about including Stone and Coal....
But on the other hand... I have to mess up seriously to bring on of my materials to a COMPLETE halt.
And if I do - I can solve the problem by stamping down a few more trains. I guess I will try it ;)

computeraddict
Fast Inserter
Fast Inserter
Posts: 182
Joined: Sat Oct 07, 2023 6:44 am
Contact:

Re: Train 2.0 question

Post by computeraddict »

borgiedude wrote:
Sun Dec 17, 2023 8:42 am
Without version 2 to play with I can't be sure, but I think this would work.

1) Have all generic loading stations disabled by circuit logic unless they have one train's worth of cargo ready to load.
2) have a depot full of trains waiting to service any stations that are ready to load a train.
3) loaded trains choose where to unload based on their cargo and interrupts.
4) keep adding trains until all sites are regularly serviced

What I can't figure out is if the station limits are going to allow this, like when a station comes online can stations with that name have the train limit increased by one? I don't think so, but I feel like I might be missing something.
You don't actually have to disable a station, you can just set its train limit to 0 with a local circuit network. The usual setup I use for loading stations is a decider linked to the ore field with "anything > 0, 1L" and a decider linked to the station buffer chests with "anything > trainload, 1L". (If it's not a mine, the mine contents decider is replaced with a constant combinator of 1L.) So it always calls a train if the mine has material left and calls an extra if it manages to build up an extra train of buffer.

Drop off stations usually get a constant combinator with "2L" and an arithmetic with "each / -trainload, L" so it calls up to two trains when empty and none when it has two trains worth of buffer.

At the moment I can't actually use both strategies simultaneously, as there's no good way to prevent the sum of the train limits from falling below the train count. Interrupts should allow the use of both by letting me put a depot somewhere for trains to stand empty. The most trains it will ever need when everything is halted is the number of trains that fit at all the stations of a particular type (e.g. max(coal unload, coal load) + max(stone unload, stone load) + etc.). If everything is flowing and travel times are long it would require adding additional buffering to the unload stations, whether in the form of increased maximum train limits beyond 2 or input depots for particularly laggy resources.

Post Reply

Return to “General discussion”