Trains still route to closest station (with limits set)
Trains still route to closest station (with limits set)
i never used the same station names because of this issue, but figured I'd give it a shot with these limits. It's better than it was, but it still happens. Farthest stations see the least use while closer stations are overused. I was going to go into a lot more detail, but I lost motivation on the topic. At least for outposting this isn't the solution I was hoping for.
Re: Trains still route to closest station (with limits set)
Of course they do, limiting the trains allowed at a station at the same times does does exactly that and nothing more. If you have multiple stations available the train will always take the one it believes it can reach the fastest, that is why you need to deactivate stations that do not need a train right now.
Re: Trains still route to closest station (with limits set)
You got to put a limit of say 1 train on each oupost, this way, when a train is already going to one outpost ( the closest ) the second train will try to reach another outpost ( the second closest), then third train, if there is a limit of 1 for the 2 outpost, will go to the third outpost and so on.
This way you avoid that all 3 trains try to reach the 1rst outpost. Hence you can avoid train always routing to the closest outpost.
Re: Trains still route to closest station (with limits set)
Right...or I could just give them different names like i've done for like 3 years now.
Re: Trains still route to closest station (with limits set)
Limiting the # of trains doesn't do a whole lot if the station is deactivated.
Re: Trains still route to closest station (with limits set)
Yes , but if you have 10 trains for 7 outpost, you can't really dispatch the same amount to all outpost if they have unique name.
Or 7 train for 10 outpost .
The train limit allow you to name all outpost the same without running the risk of all 10 trains arriving and queueing at the closest. ( the "herd" effect ).
If the station gets activated BUT with a limit of 1, you mitigate this.
Limiting the #of train doesn't do a whole lot when it's deactivated, it's when it activate that it shine
Re: Trains still route to closest station (with limits set)
I take your point, I guess it's just a solution to a problem I've not encountered or found other ways to solve.
- 5thHorseman
- Smart Inserter
- Posts: 1193
- Joined: Fri Jun 10, 2016 11:21 pm
- Contact:
Re: Trains still route to closest station (with limits set)
You can, but by limiting the stations to 1 (or 2 if you want one always waiting in the wings) and having exactly (stations * 2) trains means that all of your trains are active (unloading, loading, or queued) and when you make a new station, all you need to do is copy an existing station and create 2 more trains.
...barring the problem that you frequently have more of one type (loading/unloading) than the other and you'll need to tweak that. But it's still better than having to create "Iron mine 7" and then figuring out to which of your 4 smelting arrays you want to send them.
Re: Trains still route to closest station (with limits set)
You can also dynamically set the train limit on the stops instead of deactivating them. If you set the train limit >0 whenever a stop is in need of a train you can pretty much distribute trains as you like.
Re: Trains still route to closest station (with limits set)
In a save I've got that was started before the transition, what I've wound up doing is, on one hand, naming my mines individually, but using train limiters on their dropoff points. If you have more trains than slots in the dropoffs you'll always have a train wanting to go to a station, but with the train limits you don't have all your trains trying to go to the same station any more. It forces them to spread out amongst your network.
If you want to avoid queueing back at the pickup areas and/or allow trains to re-route, there's some circuit network/dummy stop shenanigans I think can be done, but so far I haven't felt the need.
If you want to avoid queueing back at the pickup areas and/or allow trains to re-route, there's some circuit network/dummy stop shenanigans I think can be done, but so far I haven't felt the need.
Re: Trains still route to closest station (with limits set)
Although I suspect there is a simpler way to do it, my plan is to allow the train count dynamically.
Each Cargo Wagon can hold 2000 ore. Each gets fed by 6 Stack Inserters taking from Steel Chests, each of which can hold 2400 ore. With a balancer before the ore reaches the chests, I should have a fairly even distribution of ore for each cargo wagon. So, in theory, summing the ore in all the chests, dividing by the total number of Cargo Wagons, then dividing by 2000 should give me the number of trains the station is ready to accept.
I’d like to do it per Cargo Wagon and then get the lowest result, so if one set of six chests is running low for some strange reason the station does not allow that last train, but I’m not sure how to go about doing that without a ton of combinators.
Each Cargo Wagon can hold 2000 ore. Each gets fed by 6 Stack Inserters taking from Steel Chests, each of which can hold 2400 ore. With a balancer before the ore reaches the chests, I should have a fairly even distribution of ore for each cargo wagon. So, in theory, summing the ore in all the chests, dividing by the total number of Cargo Wagons, then dividing by 2000 should give me the number of trains the station is ready to accept.
I’d like to do it per Cargo Wagon and then get the lowest result, so if one set of six chests is running low for some strange reason the station does not allow that last train, but I’m not sure how to go about doing that without a ton of combinators.
Re: Trains still route to closest station (with limits set)
When the closer stations get "overused", the train limit on the stations is probably set too high._Shin_ wrote: ↑Thu Dec 03, 2020 1:07 ami never used the same station names because of this issue, but figured I'd give it a shot with these limits. It's better than it was, but it still happens. Farthest stations see the least use while closer stations are overused. I was going to go into a lot more detail, but I lost motivation on the topic. At least for outposting this isn't the solution I was hoping for.
It's also important to have enough trains in the network, f.e. if you have 5 stations with train limit=2 you should have at least 10 trains running to satisfy them all.
I just did switch from 1:N to N:N yesterday and it took me a while to find the right amounts for train-limit and trains, but it operates really smooth now, even the farthest outposts are served as intended.
Re: Trains still route to closest station (with limits set)
I have all my stations set to 1 (unless I have a stacker for that station, then I add the number of trains that will fit in the stacker) and then add the limits of all the stations and subtract one for a particular cargo to determine how many trains. For example, I have 2 copper plate shipping stations and 5 copper plate receiving stations (no stackers for either), so I have 6 copper plate trains running. I do one less train than station limits so that there is always a free station for a train to move to.
Tired of manually backing up your saves? Check this out! -> Factorio Backup
Re: Trains still route to closest station (with limits set)
I used to total the cargo wagon’s chests together to ensure that there was at least 2000 ore before sending a Green signal saying there was enough for a load.
I think, now, that just averaging the total in the chests (to ensure that no chest gets too far ahead of any other) then just dividing the total in the chests by (2000 * number of cargo wagons) and outputting that as a signal T (or L) can then be used for both turning the station on/off (on when T >= 1), and for setting the train limit (limit = T).
You still need to ensure that you have enough mines set up though.
I think, now, that just averaging the total in the chests (to ensure that no chest gets too far ahead of any other) then just dividing the total in the chests by (2000 * number of cargo wagons) and outputting that as a signal T (or L) can then be used for both turning the station on/off (on when T >= 1), and for setting the train limit (limit = T).
You still need to ensure that you have enough mines set up though.
Re: Trains still route to closest station (with limits set)
IMO, the train limit setting is not meant to solve all train problems. You still need those solutions that existed before (train path penalties, train parking areas, etc) to complement train limits.
Re: Trains still route to closest station (with limits set)
I was just saying this wasn't the solution I was hoping for. Never said it was useless or not a good new addition, just not what I had hoped for.
Perhaps it would be possible to add an additional option, that being round robin. Instead of the AI always selecting the closest open/available station, it would take all 6, or 10 or whatever, and select them in sequence as first priority. if that one is busy, it goes to the next. It could also go to the longest unused station first. This is similar to how phone banks work to ensure every worker is getting calls.
Perhaps it would be possible to add an additional option, that being round robin. Instead of the AI always selecting the closest open/available station, it would take all 6, or 10 or whatever, and select them in sequence as first priority. if that one is busy, it goes to the next. It could also go to the longest unused station first. This is similar to how phone banks work to ensure every worker is getting calls.
Re: Trains still route to closest station (with limits set)
In combination with some relatively simple circuits to close a station's entry signal it's not really possible to have an 'overused' station any more. Build as many trains as you have your train limits set and you'll never encounter it again: your trains will distribute themselves among the network, and a station will only allow a train in -- and therefore free up a slot when it departs -- when it requires more material. Alternatively, if you unload direct to machine or belt, I don't think you even need that. The train'll just sit there until it is unloaded, with however many extra you've set the limit to queued in behind it.
I guess if you have a platform with, like, uncontrolled chests, you could have issues, but...?
Like I wouldn't mind more precision in how I can control train routing, but with limits I think the game now gives you the needed tools to do what you want.
I guess if you have a platform with, like, uncontrolled chests, you could have issues, but...?
Like I wouldn't mind more precision in how I can control train routing, but with limits I think the game now gives you the needed tools to do what you want.
Re: Trains still route to closest station (with limits set)
Trains don’t pick a station then find a route to it. Rather they search all the available routes ahead of it in a tree, adding up the path length as it evaluates them, always evaluating the next possible branches from the current shortest path. As soon as the next path branch to be evaluated contains a station that matches the next destination in the schedule, pathfinding can immediately stop, as that is the shortest route to the destination._Shin_ wrote: ↑Fri Dec 04, 2020 11:49 pmI was just saying this wasn't the solution I was hoping for. Never said it was useless or not a good new addition, just not what I had hoped for.
Perhaps it would be possible to add an additional option, that being round robin. Instead of the AI always selecting the closest open/available station, it would take all 6, or 10 or whatever, and select them in sequence as first priority. if that one is busy, it goes to the next. It could also go to the longest unused station first. This is similar to how phone banks work to ensure every worker is getting calls.
If you want trains to better distribute among the various stations, you could use combinator logic. You could for example have an SR latch at each station that sets the trains limit to 0 or 1.
1) A constant combinator at each station sends a signal with a value of 1 into the network on a select signal, such as A to allow a dynamic count of the stations.
2) When the number of trains heading to or at the staton is 1, set a latch indicating the station has been visited this cycle. This sets the trains limit to 0 (but still allows the train currently pathing to the station to arrive), and also send a value of 1 on another signal such as B.
3) When B=A, all stations have been served this cycle. If both B=A and the station can service a train, reset the latch, and set trains limit to 1, and stop sending the B signal on the network.
Re: Trains still route to closest station (with limits set)
I think people are overcomplicating things when it comes to train stations.
I have a lot of stations running without any circuit, took some time to get right amounts of train limits per station and trains, but it's really working like a charme without any circuit logic.
Except for special cases, I guess you're not using the train station limit right if it's not working as you want.
I have a lot of stations running without any circuit, took some time to get right amounts of train limits per station and trains, but it's really working like a charme without any circuit logic.
Except for special cases, I guess you're not using the train station limit right if it's not working as you want.
Re: Trains still route to closest station (with limits set)
You could. Train limits solve some problems, but can create new ones.
I always send an artillery train around to keep things clean at my outposts.
With train limits, I've named all my iron mines the same, all my copper mines the same, etc. For the artillery train, this causes two problems:
- I can't send it to individual mines anymore, because it randomly picks from among the same-named stations. It'll go to an iron mine to shoot, but I can't know which one.
- If I have very low train limits on a set of stations, the artillery train can even get stuck and not go anywhere because no stations are free for it.