Request: Max number of trains for stations

Post all other topics which do not belong to any other category.
Molay
Fast Inserter
Fast Inserter
Posts: 203
Joined: Thu May 01, 2014 8:01 am
Contact:

Re: Request: Max number of trains for stations

Post by Molay »

Huh, I never looked at TSM. I kept going for LTN ever since I discovered, which was not exactly working the way I want.

LTN works like calling a taxi. It's a neat idea but approaches the problem in such a way that it's no longer looking like the current train system. It also has the obligatory overhead of requiring depot stations. It's crazy powerful and very convenient though, don't get me wrong. It's just an obvious departure from the vanilla feel.

TSM sounds like it already does pretty much what I want. Will have a look at it. Thanks for bringing it up!

I maintain that allowing trains to repath to other stations while in transit is not the optimal way to go. It can create weird situations and deadlocks, with stackers especially, that are hard to figure out for the player. Ultimately it boils down to the player using incompatible designs with the maxTrain system resulting in errors. But I think it's a nice noob-safety feature that introduces reliability to the system. I'm sure many deadlocks will be had with the repath feature, and that it's not worth the hassle and computations. If more trains are sent than are required, and if that's highly offending to the player, he could always set up an advanced system with a timer to prevent modification of maxTrains to occur rapidly in succession; or some other CN based solution.

If currentTrains property can be read on stations, the player could read that to force maxTrains back to 0 after a train departed towards it to prevent additional departures too. Or to activate the timer. Or do whatever system he sees fit, really. There's plenty of options, some more and some less complex.

I maintain that the system should not become a fully-automated-luxury-space-rail. Simple rules, predictable behavior and the tools to achieve the desired outcome. Having 3 trains incoming if only 2 are needed is not an issue with the system itself, but with the player's circuit network setting the request. It's the player's choice to optimize or eat the inefficiency. This strikes me as being in line with current factorio design overall. A 100% optimal system is not something available even with belts out-of-the-box. You may need to do priority splitting or using the CN to achieve what you need for your particular factory, if it does anything remotely advanced. I think maxTrains should similarly offer the tools only, not implement a foolproof way to use them without player consideration; coming with foolproof out-of-the-box solutions (like LTN) is the domain of mods. Though opinions may differ on that.
Freddie Chopin
Inserter
Inserter
Posts: 30
Joined: Fri Jan 24, 2020 4:32 pm
Contact:

Re: Request: Max number of trains for stations

Post by Freddie Chopin »

Molay wrote: Fri Jan 31, 2020 9:34 am Huh, I never looked at TSM. I kept going for LTN ever since I discovered, which was not exactly working the way I want.

LTN works like calling a taxi. It's a neat idea but approaches the problem in such a way that it's no longer looking like the current train system. It also has the obligatory overhead of requiring depot stations. It's crazy powerful and very convenient though, don't get me wrong. It's just an obvious departure from the vanilla feel.

TSM sounds like it already does pretty much what I want. Will have a look at it. Thanks for bringing it up!
Yes, TSM is different than LTN in many basic aspects. First of all you have to use dedicated trains, so you have to say that these 4 trains are for iron ore, these 4 for iron plates and these 3 for red circuits - there's no concept of "generic trains" as in LTN. The downside is that you (probably) will have to use more trains. The upside is that the "latency" is very low, as the trains are almost always fully loaded, waiting for a request to drop the cargo somewhere. However TSM also requires something like a depot(s). You have to have some place for the loaded (and empty if you use N-to-M scenario) trains to wait for the request. But these can be "decentralized" or sometimes integrated into loading/unloading stations. It's a pity TSM has no dedicated forum topic here as other mods (;

I brought this up, because the idea for "max trains" - as discussed in this topic - is very similar to the way TSM works. If this "max trains" gets implemented, I guess some of the solutions/constraints/mechanics can be taken from the TSM mod. Also people willing to see how such "max trains" idea would work in practice can check it out right now (;
seltha
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Jul 23, 2019 8:38 am
Contact:

Re: Request: Max number of trains for stations

Post by seltha »

boskid wrote: Thu Jan 30, 2020 4:51 pm From my point of view this concept is showing its limitations and has low chance of getting into release. Implementation is possible but code wise, it is shotgun surgery.
Sadface... the second .gif you did looked pretty solid (even if not perfect, still much better than status quo), though I'm not a fan of desyncs... mebbe less shotguns required? ;)


mmmPI wrote: Thu Jan 30, 2020 11:20 am 1) what kind of network do you use: 2 tracks, each one way ? ( what i have)
2) what kind of trains ? ( Loco Wagon Loco for me, making my station not shaped as a loop but as dead end )
3) what are the general throuput order ?
1) yes, I haven't worked out how to do quad tracks yet, so just 1 each way, but it's in quite a big grid, so multiple routes a train could go about the base... using roundabouts for intersections, they can bottleneck with trains turning 270 degrees, so I'm wondering about doing some kind of 90 degree turns only to see if that increases flow... per mythbusters testing of efficiency of "3 right turns vs 1 left turn"
2) LCC - I'm a fan of RO-RO stations, so I don't use the LCL format and wanted to keep things compact in this map (usually I would 2L4C or 3L6C)
3) current green chips has escalated a bit... http://www.seltha.net/images/20200131213544_1.jpg ... does about 600k chips/hour, at about half capacity -- having trouble keeping it fed, need to optimize my iron smelters! (always something to do :D)

warehouse looks like this: http://www.seltha.net/images/20200131213618_1.jpg
mini-factories like this: http://www.seltha.net/images/20200131213859_1.jpg (green chip used to look like that too, before I scaled up)
whole map looks bit like a circuit diagram: http://www.seltha.net/images/20200131213929_1.jpg
metacreamy
Manual Inserter
Manual Inserter
Posts: 4
Joined: Mon Feb 06, 2017 8:36 pm
Contact:

Re: Request: Max number of trains for stations

Post by metacreamy »

This request arises quite times

viewtopic.php?t=40919 Let us restrict the number of trains a train stop can accept
viewtopic.php?t=44716 [0.15] Preventing train rerouting when disabling a stop
viewtopic.php?t=56375 Toggle option for train to reserve a train stop
viewtopic.php?t=63127 Number of trains on route to single station limit.
viewtopic.php?t=70248 Add "Only 1 inbound train allowed at a time" checkbox for train stops

I am sure there are more.

There are even proof of concept mods:
DLL injection by GrayMage https://github.com/GrayMage/GrayMod (@boskid have you seen it?)
Messy LUA mod by me ConcurrentTrainRestriction

It would be great to have it implemented in vanilla
And I hope shotgun surgery will not scare you away
Draba
Burner Inserter
Burner Inserter
Posts: 11
Joined: Thu May 02, 2019 9:50 am
Contact:

Re: Request: Max number of trains for stations

Post by Draba »

Just piling on, I also think this would be a very nice addition.
Without something to mitigate swarming trains using RESOURCE_LOAD/RESOURCE_UNLOAD type schedules are a pain, and the tools to address the problem are clunky.
Molay
Fast Inserter
Fast Inserter
Posts: 203
Joined: Thu May 01, 2014 8:01 am
Contact:

Re: Request: Max number of trains for stations

Post by Molay »

Any news on the shotgun surgery? ;)
quyxkh
Smart Inserter
Smart Inserter
Posts: 1031
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Request: Max number of trains for stations

Post by quyxkh »

Can someone explain again why "not painting yourself into a corner" as a strategy is bad? If you have a thundering herd of trains, you've got a lot of trains waiting to pick up demanded resources, which means the resources weren't available earlier, which means you don't have enough supplies to meet demand, which is totally under your control, or you've got far more trains and supply than you need, also totally under your control.
Molay
Fast Inserter
Fast Inserter
Posts: 203
Joined: Thu May 01, 2014 8:01 am
Contact:

Re: Request: Max number of trains for stations

Post by Molay »

Because the thundering horde of trains fails to properly function even if you can properly meet demands, their behavior just gets in the way. They fail to properly interact with far away stations, and getting into a good efficient flow is not possible due to the herd behavior.
netmand
Filter Inserter
Filter Inserter
Posts: 302
Joined: Wed Feb 22, 2017 1:20 am
Contact:

Re: Request: Max number of trains for stations

Post by netmand »

I have some questions about this:

- Can you walk me through an actual scenario in detail please? It seems any reliance on these counters overrides the scheduling and causes problems linking stations for delivery: In other words, whenever I step through a scenario where two trains are needed to pick iron plate and then have one deliver to circuit production and the other to deliver to steel production will it instead yield two trains loaded with iron plate and two other empty trains sent to unload stations? Or maybe it'll instead send two trains for iron plate then only send one to both cirucuit and steel production unload? What other overhead is required to make this work? How does the game know when a certain train needs to be chosen for the unload station? How does a station know if it's a load station or unload station then? Do we need to keep a list of trains with paths? If a repath causes a train to drop its load station (if there is such a thing), how does it scrub its unload station? What about multiple load stations and one unload?

- What do you mean by, "trains waiting to depart"? Technically there's no such thing, except where a train is either in manual mode, has a blank schedule, or every station on its schedule is disabled. What I'm asking, is if this is a special condition that these station counters look for? If 20 trains all have the same schedule, they're all "waiting" for all stations on their schedule, in other words, what's stopping from the first train (as you say procedural processing) from accepting the all first requests from any station on its schedule? In today's game when-ever a station opens all trains waiting for it immediately depart. Are you now asking for an interrupt in path calculation for each train so they can then be evaluated invidually?

- Are you asking to measure distances? What about mega bases where it makes sense to have multiple stackers in different parts of the map? What is going to stop station east bumblefk calling a train that's on the west edge of the map?

- There's a chance that a train may not be in a place that can path to certain stations. You all are assuming that all of your rails are connected in one big system? What if all trains don't have the same schedule but some of the same stations? How does this work under multiple systems on one map i.e. multiplayer?
astroshak
Filter Inserter
Filter Inserter
Posts: 637
Joined: Thu May 10, 2018 9:59 am
Contact:

Re: Request: Max number of trains for stations

Post by astroshak »

Ok. How’s this?

You want to make a centralized smelter for your Iron Plates. You want your Iron Ore delivered by train at one side, and you want the Iron Plates to be picked up by train on the other side.

How many things want Iron Plates? A lot. So, you need to set up enough Iron Ore coming in. And you decide to name all the mines for this Iron Mine. Two trains per mine should suffice, right? But you out-pace your Iron Ore mining. Several mines are disabled due to insufficient ore to fill a train. So out of three to five mines, only one or two is turned on. Six to ten trains, once they are done unloading their Iron Ore into the smelter, are all rushing off to the nearest “on” Iron Mine. The first one there, however, takes enough Ore to disable the mine. What do the rest do?
netmand
Filter Inserter
Filter Inserter
Posts: 302
Joined: Wed Feb 22, 2017 1:20 am
Contact:

Re: Request: Max number of trains for stations

Post by netmand »

astroshak wrote: Tue Feb 11, 2020 8:59 pm Six to ten trains, once they are done unloading their Iron Ore into the smelter, are all rushing off to the nearest “on” Iron Mine. The first one there, however, takes enough Ore to disable the mine. What do the rest do?
They proceed to their next station in their schedules. This may result in empty trains sitting and queuing at the unload station in your smelter area if those train's schedules only have the mining stations (load) and smelter area station (unload) in their list.
astroshak
Filter Inserter
Filter Inserter
Posts: 637
Joined: Thu May 10, 2018 9:59 am
Contact:

Re: Request: Max number of trains for stations

Post by astroshak »

Yup. The “Thundering Herd” ...
Zealot
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Feb 14, 2020 4:58 pm
Contact:

Re: Request: Max number of trains for stations

Post by Zealot »

TL;DR
Show and limit how many trains destination to the station
What ?
Provides 2 more options to a train stop related to circuit signal:
  • Output a circuit signal showing how many trains are going to the station, including one which is stopping at the station if exist
  • Set a limit of how many trains are able to destination to the station, can be a const number set by player or a circuit signal. Basically it is the number of on going trains to the station.
Both of the number is per specific station, if there are multiple station with same names, each one can be set on each station independently.

When all station is full, the train will stay at previous station until any station is available. When a station becomes unavailable when a train is on its way to the station, the train search for another one, if none is applicable, the train will skip the station, go to next station on its schedule. If all of its scheduled station is unavailable, it stucks on the road, and a warning sign may displayed in the player UI interface.
Why ?
Lots of people love LTN, but LTN also have some problems:
LTN is too complicate, especially for new players.
People like solving puzzles, not given answers. But LTN gives you solutions, not puzzle pieces.
The proposed feature is very simple, and easy to understand, very friendly to new players. And also highly customization, combined with circuit network, people can build train networks as complex as LTN provided.

And also lots of people try to build LTN like train network in vanilla, I think the proposed feature is the last key piece to enable people build LTN train network in vanilla. The main concept of LTN is lots of stations share a single station name, and trains are dispatched automatically to fill the station request. Current in vanilla toggle enable/disable of a station can be used to request resources from train network, but the problem is once a station is enabled, there may be lots of trains being called to the station on a very large train network, but the station may only need 1 or 2 trains to fill its buffer. With the proposed feature, the station can fully control how many trains are requested.

The feature is unable or very hard to implement by modding, since the path finding algorithm is not tweak-able by mods, and there are no method to half-disable (no schedule new trains, but keep scheduled train going) stations,
Blacky007
Fast Inserter
Fast Inserter
Posts: 180
Joined: Fri Dec 29, 2017 8:05 pm
Contact:

Re: Request: Max number of trains for stations

Post by Blacky007 »

@Boskid
If you want testing Trainstacker systems try my 7000 SPM megabase and see what is happening
https://www.dropbox.com/s/g5oja0l7he564 ... 5.zip?dl=0

I have 3 giant smelter with nearly 20-30 stackerplaces for ore and about 20-30 trains for the finished plates on each one.
even giant 6 x 6 way railcrossings with including roundabouts.

it would be great to have some first in-first out system in that giant stackers without any signal controlling stuff

Greetings Blacky007
My color birthday was May 2nd 2020 - Thank you Enchroma
User avatar
Nosferatu
Filter Inserter
Filter Inserter
Posts: 251
Joined: Fri Jan 20, 2017 4:48 pm
Contact:

Re: Request: Max number of trains for stations

Post by Nosferatu »

metacreamy wrote: Sun Feb 02, 2020 12:48 am Messy LUA mod by me ConcurrentTrainRestriction
Thanks. That works exactly as i want. And apart from the station names the solution is not messy in my opinion.
User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: Request: Max number of trains for stations

Post by ptx0 »

People like solving puzzles, not given answers. But LTN gives you solutions, not puzzle pieces.
LTN is quite the puzzle.
Draba
Burner Inserter
Burner Inserter
Posts: 11
Joined: Thu May 02, 2019 9:50 am
Contact:

Re: Request: Max number of trains for stations

Post by Draba »

ptx0 wrote: Thu Feb 20, 2020 5:55 pm LTN is quite the puzzle.
LTN is nice but also drastically changes the way trains are used.
This problem is relatively simple (more accurately, looks simple to me with no knowledge about internals :) ), a caveman-level solution would be great.
Last edited by Draba on Tue Feb 25, 2020 1:23 pm, edited 1 time in total.
Molay
Fast Inserter
Fast Inserter
Posts: 203
Joined: Thu May 01, 2014 8:01 am
Contact:

Re: Request: Max number of trains for stations

Post by Molay »

I'm starting to think the shotgun surgery went poorly, and Boskid may not have survived.

Are there any news regarding Boskid's coding adventures? Is he still among us?
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3017
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Request: Max number of trains for stations

Post by boskid »

Molay wrote: Tue Feb 25, 2020 12:29 pm I'm starting to think the shotgun surgery went poorly, and Boskid may not have survived.

Are there any news regarding Boskid's coding adventures? Is he still among us?
Lets say i was busy with other stuff and before continuing with trains limit feature, i have to sort one other thing with trains that i am still not happy with.
Molay
Fast Inserter
Fast Inserter
Posts: 203
Joined: Thu May 01, 2014 8:01 am
Contact:

Re: Request: Max number of trains for stations

Post by Molay »

He's alive! ;)

Well I'm happy to hear the train limit has not been discarded, but merely postponed! I wonder what that other thing you speak of might be?

Thanks for dropping by and keeping the hope alive!

Cheers
Post Reply

Return to “General discussion”