Need help with the new trains system
Need help with the new trains system
I started up a marathon game a while ago, back before the new train changes. I set the world to maximum production cost for everything, and resources as far apart as possible. Most things have dedicated factories attached to multi-platform train stations for import/export.
Folks, I'm having trouble with the new train system. I've read FFF-389, -395 and -403, but I still don't get how to make it work with my setup.
What I had was individually named platforms, eg "Green circuit factory 1: iron in", "Green circuit factory 2: copper wire in", "Green circuit factory 3: green circuits out", and trains individually scheduled. I have each input platform enable/disable itself based on the local stock level.
And this is where it breaks down in the new system. It used to be that disabling a stop meant it just got skipped, but now my trains won't go anywhere at all because the next stop in the schedule is disabled.
I sort of gather that what I'm meant to do is scrap the individual stop names, and have every stop that takes green circuits simply called "green circuits in". But then how can I ensure a balance between all the stops that take green circuits? I would want them to all get served equally. What I had before was sometimes individual trains for one destination, but sometimes trains serving multiple destinations. If I call them all the same thing, won't the first one with the name hog all the green circuit trains until it's completely full, starving the others?
Less importantly, the individual platform names was also a handy way to tell, on the map, which factory I was looking at. If I make them all generic names, I'll lose a lot of that at-a-glance information. Is there any way around that, other than having to look for the name of the output platform among all the others?
Folks, I'm having trouble with the new train system. I've read FFF-389, -395 and -403, but I still don't get how to make it work with my setup.
What I had was individually named platforms, eg "Green circuit factory 1: iron in", "Green circuit factory 2: copper wire in", "Green circuit factory 3: green circuits out", and trains individually scheduled. I have each input platform enable/disable itself based on the local stock level.
And this is where it breaks down in the new system. It used to be that disabling a stop meant it just got skipped, but now my trains won't go anywhere at all because the next stop in the schedule is disabled.
I sort of gather that what I'm meant to do is scrap the individual stop names, and have every stop that takes green circuits simply called "green circuits in". But then how can I ensure a balance between all the stops that take green circuits? I would want them to all get served equally. What I had before was sometimes individual trains for one destination, but sometimes trains serving multiple destinations. If I call them all the same thing, won't the first one with the name hog all the green circuit trains until it's completely full, starving the others?
Less importantly, the individual platform names was also a handy way to tell, on the map, which factory I was looking at. If I make them all generic names, I'll lose a lot of that at-a-glance information. Is there any way around that, other than having to look for the name of the output platform among all the others?
Re: Need help with the new trains system
This is essentially the same as 129639, so if you need unique station names you get the behavior you want by using interrupts.
-
- Filter Inserter
- Posts: 368
- Joined: Sat Oct 07, 2023 6:44 am
- Contact:
Re: Need help with the new trains system
Hyperlynx wrote: Tue Jul 01, 2025 1:04 pm I have each input platform enable/disable itself based on the local stock level.
Use circuits to set its train limit to 0 when full instead of disabling it.Hyperlynx wrote: Tue Jul 01, 2025 1:04 pm But then how can I ensure a balance between all the stops that take green circuits?
Add a map tagHyperlynx wrote: Tue Jul 01, 2025 1:04 pm Less importantly, the individual platform names was also a handy way to tell, on the map, which factory I was looking at. If I make them all generic names, I'll lose a lot of that at-a-glance information. Is there any way around that, other than having to look for the name of the output platform among all the others?
Re: Need help with the new trains system
That has identical behavior as disabling and will not skip the station in schedule.computeraddict wrote: Tue Jul 01, 2025 2:09 pm Use circuits to set its train limit to 0 when full instead of disabling it.
-
- Filter Inserter
- Posts: 368
- Joined: Sat Oct 07, 2023 6:44 am
- Contact:
Re: Need help with the new trains system
I was intending to point out that doing so will get the same limiting logic as he was using before, just with same-named stations instead of differently named ones. All that's lost is name-based priority.Loewchen wrote: Tue Jul 01, 2025 2:42 pmThat has identical behavior as disabling and will not skip the station in schedule.computeraddict wrote: Tue Jul 01, 2025 2:09 pm Use circuits to set its train limit to 0 when full instead of disabling it.
Re: Need help with the new trains system
It has the same problem as your solution for that thread, though: it's not going to evenly distribute resources between all the "wall" stations, one of them is going to hog all the trains until it's full, then the next one, then the next one. Unless I'm missing something?
A thought occurred to me after I posted that maybe the new priority feature is what I'm after? Maybe it would work if the destination platforms have the same name and I use logic circuitry to set the priority to the reciprocal of what percentage full they are, if that's possible...
Thanks!
Re: Need help with the new trains system
It is going to "evenly distribute" exactly as much as 1.1 allowed you to do. If a station requires a full train it will be open and a target for trains if your trains cannot handle that demand that is a supply problem.Hyperlynx wrote: Tue Jul 01, 2025 10:53 pm It has the same problem as your solution for that thread, though: it's not going to evenly distribute resources between all the "wall" stations, one of them is going to hog all the trains until it's full, then the next one, then the next one. Unless I'm missing something?
-
- Filter Inserter
- Posts: 368
- Joined: Sat Oct 07, 2023 6:44 am
- Contact:
Re: Need help with the new trains system
Assuming one train network, you can also leverage the radar circuit to coordinate and communicate how many stations are requesting/supplying.
Re: Need help with the new trains system
In 1.1 I solved the problem by having the station disable itself when local supply reached a certain level, and by calling the stops different things so that I could schedule an additional train to visit the stops in a different order.Loewchen wrote: Tue Jul 01, 2025 11:07 pmIt is going to "evenly distribute" exactly as much as 1.1 allowed you to do. If a station requires a full train it will be open and a target for trains if your trains cannot handle that demand that is a supply problem.Hyperlynx wrote: Tue Jul 01, 2025 10:53 pm It has the same problem as your solution for that thread, though: it's not going to evenly distribute resources between all the "wall" stations, one of them is going to hog all the trains until it's full, then the next one, then the next one. Unless I'm missing something?
I think priority would do what I need, provided I'm able to set that programmatically.
Re: Need help with the new trains system
In 2.0, the interrupt system replaces the skipping of deactivated stations. Your schedule should contain just 1 entry, usually the loading station, so the train will get loaded. If the train is full (or whatever waiting condition you set), interrupts are checked. Interrupts check what is loaded in the train, then assign a corresponding unloading station. For example an interrupt detects green circuits have been loaded, so it will add a temporary schedule for the green circuit unloading station.
Now about your green circuit unloading stations: They're all supposed to have the same name, so whenever a train has been loaded with green circuits, it will be assigned the global green circuit unloading station name. Now the train will leave, and it chooses one of the open green circuit unloading stations. Actually, it will choose the most near one that is not deactivated and has a free train limit of at least 1.
If you want the train not go to the nearest station, you need to make sure it doesn't have a free slot. This can be achieved in 3 different ways:
Now about your green circuit unloading stations: They're all supposed to have the same name, so whenever a train has been loaded with green circuits, it will be assigned the global green circuit unloading station name. Now the train will leave, and it chooses one of the open green circuit unloading stations. Actually, it will choose the most near one that is not deactivated and has a free train limit of at least 1.
If you want the train not go to the nearest station, you need to make sure it doesn't have a free slot. This can be achieved in 3 different ways:
- you can distribute so many trains every unloading station gets rains assigned until its slots are all reserved, so this station isn't a possible target any more
- you can dynamically set the train limit of a station to 0 with some circuit, if this circuit decides there are enough resources at the station
- if your stations have a train limit of 2 or higher, and you don't want to assign 2 trains to the nearest stations while the farther stations get none, you can dynamically set priority. If the station has 0 trains assigned, a circuit can set priority 51, and if the station has 1 or more trains assigned, the circuit can set priority 50. This way first all stations get 1 train (the ones with priority 51). As soon as a station has a train, their priority is lowered to 50 so before a 2nd train gets assigned to this station, all other stations with priority 51 are being visited. However, keep in mind this priority doesn't have a memory which station has been visited more often than others. It's not a round-robin tool. As soon as the last train left the station, the priority goes back to 51 and the station is primary target again, no matter if a station more far away didn't get a train in the meantime.
Re: Need help with the new trains system
I've got a lot of stations to get through, but it seems to be working so far!
One arithmetic combinator for resource/(capacity/100) feeding into another for P = 100 - input.
I then set the train stop to read in P for its priority. And I can even disable the stop when P <= 0, to cut down unnecessary trains.
One arithmetic combinator for resource/(capacity/100) feeding into another for P = 100 - input.
I then set the train stop to read in P for its priority. And I can even disable the stop when P <= 0, to cut down unnecessary trains.
Re: Need help with the new trains system
Well. I was just typing up an angry post complaining that it doesn't work to disable a station, even if there's another one with the same name. Then I thought to double check my station and what do you know, I'd accidentally set the train limit to zero...
So anyway, it looks like this works great! I can still disable stations when they're too full to stop trains ping-ponging around the system for no reason, and I can use the priority system to evenly balance deliveries to stations of the same name.
Nice. Now, if only the new "make trains the same colour as the destination" feature hadn't trashed my painstakingly selected train colours... Oh well, can't win em all.
https://eternalboxmirror.xyz/jukebox_go ... w5RAP&lg=1
So anyway, it looks like this works great! I can still disable stations when they're too full to stop trains ping-ponging around the system for no reason, and I can use the priority system to evenly balance deliveries to stations of the same name.
Nice. Now, if only the new "make trains the same colour as the destination" feature hadn't trashed my painstakingly selected train colours... Oh well, can't win em all.
https://eternalboxmirror.xyz/jukebox_go ... w5RAP&lg=1
Re: Need help with the new trains system
You can load an older save where the train colors are still present. Blueprint locomotives with customized colors to get all your customized colors. Load your current save. Paste the colored locomotive blueprints to a dedicated unconnected rail. Arrange these locomotives in a row. You have now a palette of colored locomotives. Blueprint it for backup purposes. Now you're able to copy+paste the colors to existing locomotives. However, you're overwriting their schedule as well, so be careful to re-set their train group to what it was before.Hyperlynx wrote: Fri Jul 04, 2025 9:25 am Now, if only the new "make trains the same colour as the destination" feature hadn't trashed my painstakingly selected train colours...
Re: Need help with the new trains system
You misunderstand - the older save *did* have train colours present. Loading it with a current version of Factorio discarded them.Tertius wrote: Fri Jul 04, 2025 11:37 amYou can load an older save where the train colors are still present. Blueprint locomotives with customized colors to get all your customized colors. Load your current save. Paste the colored locomotive blueprints to a dedicated unconnected rail. Arrange these locomotives in a row. You have now a palette of colored locomotives. Blueprint it for backup purposes. Now you're able to copy+paste the colors to existing locomotives. However, you're overwriting their schedule as well, so be careful to re-set their train group to what it was before.Hyperlynx wrote: Fri Jul 04, 2025 9:25 am Now, if only the new "make trains the same colour as the destination" feature hadn't trashed my painstakingly selected train colours...
Installing a second copy of Factorio that predates the train colour change is far harder than simply setting the colours manually again