Request: Max number of trains for stations
Re: Request: Max number of trains for stations
Have you made any progress on this?
Re: Request: Max number of trains for stations
There have been at least two threat in the ideas and suggestions subforum.
There are mods that offer help.
My current vanilla workaround: wire the rail signal at the entrance of each waiting bay lane to the train station and set the station to activate when red = [lanes -1].
There are mods that offer help.
My current vanilla workaround: wire the rail signal at the entrance of each waiting bay lane to the train station and set the station to activate when red = [lanes -1].
Re: Request: Max number of trains for stations
It seems to me that the train-with-no-destination problem can be resolved by allowing trains to go to a depot when there are no valid/reachable stops on its schedule.
Or even better: Conditional train stops, with 'next mandatory stop is disabled/unavailable' as one of the conditions which would cause a train to take an optional stop.
(Both of these solutions would probably require the train pathfinder the train scheduler to interact a bit - unless a re-positioned train with a reserved slot getting blocked by another train on the same route which is waiting for a slot is considered a fun problem to have)
Or even better: Conditional train stops, with 'next mandatory stop is disabled/unavailable' as one of the conditions which would cause a train to take an optional stop.
(Both of these solutions would probably require the train pathfinder the train scheduler to interact a bit - unless a re-positioned train with a reserved slot getting blocked by another train on the same route which is waiting for a slot is considered a fun problem to have)
Re: Request: Max number of trains for stations
I have looked through 100 pages of the mod portal yesterday, was looking for something else but found those instead, i think they deserve mentionning in this thread.
i haven't tested them quite yet but the descriptions sounds interestingly close to what this thread is about.
https://mods.factorio.com/mod/Concurren ... estriction
Restrict amount of trains trying to reach station simultaneously by circuit network.
( literaly the topic)
https://mods.factorio.com/mod/TrainSkipFulfilledStation
Changes trains behavior so they will skip a station if the "wait until" condition is already met
( may help )
https://mods.factorio.com/mod/SmartTrains
Seems like a more complex overhaul of the train system similar to what LTN or TSM would do, i just didn't know this one, in the description it is mentionned quite often "train lanes", and your ability to assign trains to them. Sounds like it could correspond.
i haven't tested them quite yet but the descriptions sounds interestingly close to what this thread is about.
https://mods.factorio.com/mod/Concurren ... estriction
Restrict amount of trains trying to reach station simultaneously by circuit network.
( literaly the topic)
https://mods.factorio.com/mod/TrainSkipFulfilledStation
Changes trains behavior so they will skip a station if the "wait until" condition is already met
( may help )
https://mods.factorio.com/mod/SmartTrains
Seems like a more complex overhaul of the train system similar to what LTN or TSM would do, i just didn't know this one, in the description it is mentionned quite often "train lanes", and your ability to assign trains to them. Sounds like it could correspond.
-
- Burner Inserter
- Posts: 11
- Joined: Fri Jul 26, 2019 11:49 am
- Contact:
Re: Request: Max number of trains for stations
Just here to show support for stopping the thundering herd in vanilla.
Re: Request: Max number of trains for stations
Likewise!P.E.T.A.R. wrote: ↑Thu May 28, 2020 10:08 am Just here to show support for stopping the thundering herd in vanilla.
-
- Fast Inserter
- Posts: 109
- Joined: Sat Apr 29, 2017 11:13 pm
- Contact:
Re: Request: Max number of trains for stations
Would also like max trains on a station.
-
- Burner Inserter
- Posts: 15
- Joined: Mon Jul 15, 2019 7:53 pm
- Contact:
Re: Request: Max number of trains for stations
Also waiting for feature like this.
Re: Request: Max number of trains for stations
Maybe some day
Re: Request: Max number of trains for stations
Looking forward to that day, boskid
Re: Request: Max number of trains for stations
I don't really see the problem here.
Suppose a train stop is set to allow 1 2-4 train to path there, with enabled condition of ore > 8000. There are 4 trains waiting in a stacker near the ore unload. The train stop opens up, and one train paths there. The other three wait, since the limit of 1. The train loads up on ore and heads to unload, and the train stop still has 10k ore left, so a second train heads there once the first leaves. After that one leaves, there is 5k ore left, so the two trains heading to unload resume after in the stacker and no additional trains leave the stacker.
No deadlocks / jams / what have you.
Why is this not already a feature? I could have really used it in my latest vanilla playthrough...
Suppose a train stop is set to allow 1 2-4 train to path there, with enabled condition of ore > 8000. There are 4 trains waiting in a stacker near the ore unload. The train stop opens up, and one train paths there. The other three wait, since the limit of 1. The train loads up on ore and heads to unload, and the train stop still has 10k ore left, so a second train heads there once the first leaves. After that one leaves, there is 5k ore left, so the two trains heading to unload resume after in the stacker and no additional trains leave the stacker.
No deadlocks / jams / what have you.
Why is this not already a feature? I could have really used it in my latest vanilla playthrough...
Re: Request: Max number of trains for stations
Just want to mention that there is also an existing suggestion thread here viewtopic.php?f=6&t=81682
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Request: Max number of trains for stations
sounds like a waste of CPU cycles.
Re: Request: Max number of trains for stations
Re: Request: Max number of trains for stations
Please keep in mind that pathfinder is implemented to search from a single train to multiple train stops, proposed part goes into "search from single train stop into multiple trains in reverse" and would require copying trains pathfinder and modifying it a lot. There would be also some amount of issues related to penalties as to when to apply them, or which ones should be applied at all.
Also what would be a benefit of finding train that has least distance to a given train stop? what if that train would not want to repath to us since it already has a train stop goal that is closer from its point of view?
Re: Request: Max number of trains for stations
The benefit specifically is so that, should a stop open up, the train that goes to it comes from, e.g., it's stacker, and not from half-way across the base. The current behaviour has both trains path, but because the one in the stacker is closer, it arrives first and so the problem doesn't arise. If they are reserving slots in a non-pathweighted fashion, i.e. by ID or some other internal ordering, then the one in the stacker might wait on a long-distance train. That's obviously undesired behaviour.
The exact implementation details I can't speak to, but I would think that since each station already knows every train that has it in its schedule there is at least some way for the game to pull 'a list of all trains that have this stop', and from there 'a list of all trains that have this stop as its current destination' -- stops might have the same name but they are presumably disambiguated within the internals of the game.
So my thought on the flow would be:
1. On a train repath, the train does its usual find-a-valid-station checks. For each pathable station it finds, it saves the pathfinding weight to get there. It presumably already does something similar to this in order to travel to the nearest open station as it currently does.
2. Each train then tries to register with its nearest station its intent to go there, and reports its pathweight. The station, up to its train limit, will take those and report back 'yes you can path to me' or 'no you can't', in order from lowest pathweight ('nearest') to highest pathweight ('furthest').
3. If a train gets a 'no' back from a station, it moves up to the next one in its list, and requests again.
The heavy load, the pathing, I don't think is any more intensive than at present. The train-limit check and pathweight checks are simple integer comparisons and even done repeatedly should be functionally instant.
There might be some additional stuff to address trains not repathing away from a station they're pathing to just because a closer train is now available to path to it and gets in first. That'll depend on desired behaviour.
Re: Request: Max number of trains for stations
Why should there be a train in the stacker that is waiting for a slot?
If your stations trainlimit is 1 then trains won't need the stacker.
If it's higher then all train waiting inside the stacker already have reserved their slot.
If your stations trainlimit is 1 then trains won't need the stacker.
If it's higher then all train waiting inside the stacker already have reserved their slot.
Re: Request: Max number of trains for stations
Even if this approach would be benefitial, i do not want it.
1/ It still needs some estimate of path cost for all trains that are heading for given station but other train stop. Extra pathfinder that would work in opposite direction.
2/ issue would happen only when a stacker has its own train stop trap (probably with limit set to reduce amount of trains heading to stacker). It would be possible to design loading/unloading in a way that trains heading to load/unload would park in stacker but with a path to the station directly. That way train in stacker would already be assigned to some train stop so would be the first one to arrive, and this would still allow changing train stop when other one would not be full
3/ It would also be possible in other way with CN magic: when an unload/load train stop is not full, by CN force some trains in stacker to repath by reducing limit of trains in stacker.
Corner case for pulling trains to a given train stop would be long rail segment with junction and 2 train stops with same name and equal penalty, both set with limit of 1. When train would repath from train stop A to train stop B, A would become non-full and would want to repath some train to it. This would force train to go to train stop A and now train stop B is non-full. I want to avoid such loops.
1/ It still needs some estimate of path cost for all trains that are heading for given station but other train stop. Extra pathfinder that would work in opposite direction.
2/ issue would happen only when a stacker has its own train stop trap (probably with limit set to reduce amount of trains heading to stacker). It would be possible to design loading/unloading in a way that trains heading to load/unload would park in stacker but with a path to the station directly. That way train in stacker would already be assigned to some train stop so would be the first one to arrive, and this would still allow changing train stop when other one would not be full
3/ It would also be possible in other way with CN magic: when an unload/load train stop is not full, by CN force some trains in stacker to repath by reducing limit of trains in stacker.
Corner case for pulling trains to a given train stop would be long rail segment with junction and 2 train stops with same name and equal penalty, both set with limit of 1. When train would repath from train stop A to train stop B, A would become non-full and would want to repath some train to it. This would force train to go to train stop A and now train stop B is non-full. I want to avoid such loops.