bcwhite-code / brians-blueprints

Brian's Blueprints for Factorio
Creative Commons Zero v1.0 Universal
74 stars 19 forks source link

Calculated train limits go higher than actual capacity for providers #22

Closed Magi3r closed 6 days ago

Magi3r commented 6 days ago

The train limit increases as the buffers fill up, sometimes exceeding the actual capacity of the station, especially stations without stackers. If something is requested using material from that station, more trains are dispatched than needed, and more problematic, than the station has capacity for. This jams the station and usually other stations too, when waiting trains block the entrance to other stations.

Is there a way to set a maximum for the calculated train limit?

As an concrete example: I want to restrict a station that may have a buffer for filling 4 trains to only accept 2 at once to not block the entrance for other trains to the neighboring stations.

davidakachaos commented 6 days ago

From the documentation of the trains:

Provider Stations

Once the provider station is placed, do the following additional setup: ● Calculate 3 * (S+2) where S is the number of stacker slots (those tracks where waiting trains "stack" behind the main station). Block off an additional slot if it's an item with a stack-size less than 50. ● In the iron chest nearest the head, block off all but that number of slots. This ensures that the maximum number of trains that can be pending will not overload the stacker and block the main rail.

So it seems you can block off the amount loaded in the station and in that way limit the amount of trains that can go to that station.

Magi3r commented 6 days ago

Thanks! I must admit that I have not read that documentation since the 2.0 update. I am glad this is possible, however, it is not exactly intuitive compared to changing the variable LTN had for this. A quick reimplementation of that could be done by setting L in the constant combinator and a comparing that to the calculated L, propagating the lower to the train station to set the train limit.

bcwhite-code commented 6 days ago

It would be two extra gates per station to implement that. If you want a limit of 1 train, you can just fix it in the train-stop config and let the station fill.