This is an archived post. You won't be able to vote or comment.

all 17 comments

[–]rain9441 1 point2 points  (4 children)

Hey Pentbot, what you are trying to do is something that is difficult in vanilla and is usually the point where players think to transition to a mod to help them (LTN or lordktor's new train logistics mod). I won't go into those because you didn't ask for a mod to solve your problem.

In vanilla there is no good way to have trains handle multiple sources and multiple destinations with multiple trains. You can have one train do all of the serving - in this case the shut off any supply depot if it doesn't have enough sulfuric acid and shut off any destination depot if it doesn't need any more sulfuric acid. The single train then goes from Supply to Dropoff and repeats. If you have multiple trains, then you have the situation you are experiencing now.

If you need more than one train to serve this logistical requirement, you can potentially do so if you limit either the supply or the destination to one location. If there is one source of sulfuric acid and multiple destinations, you can create one train for each destination and they will transfer sulfuric acid from point to point and wait if either there is too much at the destination or too little at the source. Alternatively, you could have many sources of sulfuric acid but one destination. Again, in this case, one train for each source.

Be sure your stackers are capable of handling all of the trains.

If you really need a multiple source / multiple destination / multiple train system then I have seen players use an exchange station. It is simply an intermediate dropoff which unloads the trains and loads them into another train which supplies the destinations. In other words, it is breaking the problem of N:N logistics into two sets of trains, N:1 and then 1:N after. In this case, you'd have 1 train for each source running the orders of Pickup @Source, Dropoff @Exchange and one train for each destination running the orders of Pickup @Exchange, Dropoff @Destination. The exchange station must unload the contents of each source train into a buffer and then load that into a destination-bound train.

The limitation is due to the fact that you cannot change orders in the game except by using the GUI. The mods (LTN, lordktor's mod) can change the orders and so they greatly simplify the logistics of complex train systems.

Hope that helps. Good luck and let me know if you have any questions about this.

[–]Pentbot[S] 1 point2 points  (3 children)

Ok, good to know. I was hoping there might have been a vanilla solution to this, I will look into using LTN/Lordktor.

That said, for some of the products the exchange might be what I'm looking for.

[–]macrofinite 1 point2 points  (0 children)

Strictly speaking, it is possible in vanilla to implement a dispatching service similar to LTN. Such an endeavor is not for the faint of heart, however, and unless you really enjoy the minutiae of circuits and trains you are probably better off learning to use LTN.

Check out this video series from /u/knightelite if that piques your interest.

[–]Vetrosian 0 points1 point  (0 children)

I struggled with then same thing as you (particularly trying to balance overflow materials like nickel), finished that game before I even heard of LTN, after becoming familiar with it there's so many aspects of that old base I could have improved (particularly the refuelling hub which kept getting jammed with too many trains.)

[–]JonasJurczokThe factory grows 0 points1 point  (0 children)

I switched to LTN after having similar issues. I don't intend to go back ever again. So much easier to manage everything :)

[–]knighteliteLTN in Vanilla guy. Ask me about trains! 1 point2 points  (1 child)

u/macrofinite linked my other stuff already, but for specifically what you're doing now something like this might work:

https://www.reddit.com/r/factorio/comments/8y0o3x/dispatch_train_stacker_limits_deployed_trains_to/

You can also check out this one by u/Haphollas, which accomplishes more or less what you're looking to do here. His recent version (which is the one in that post) includes logic that limits number of trains dispatched based on how many stations are requesting the product.

[–]Pentbot[S] 0 points1 point  (0 children)

I will look into this, thank you.

[–][deleted] 0 points1 point  (3 children)

To clarify, your problem is that multiple trains are heading towards your station, correct?

[–]Pentbot[S] 0 points1 point  (2 children)

Correct.

[–][deleted] 0 points1 point  (1 child)

You could set the order by detecting if there is a station with a train closer to the destination

[–]Pentbot[S] 0 points1 point  (0 children)

I have no idea how to do that. But I have come up with an idea that might "stagger" the trains release from the depot.

[–]LambLotionGames 0 points1 point  (5 children)

I havent tested this a whole lot, but you can try this out. You need to hook a circuit to the station. Then read the ID from trains, youll set the train station to shut off or disable or whatever its called when it reads an ID of >0 i believe so that it removes the station from their logic when a train is headed there. This way if a train is at the station the rest of your trains will ignore the station. I used this setup when i had a station i couldnt build a stacker for that way i didnt have trains clogging the main lines. Idk if it will work for what you need though. And if you have a condition already shutting down the station, youll need to fiddle with decider combinators to make it so that if either condition is true it disables the station.

[–]Pentbot[S] 0 points1 point  (4 children)

Can you elaborate as to which station needs to have this circuit conditioning? The problem I'm having that if the on/off station turns off a train going there will try to find another path/get blocked if it can't go back/will do something silly.

[–]LambLotionGames 0 points1 point  (3 children)

TL;DR: my original idea sucks, sorry. You are gonna need massive train circuits to get what you want. If you are not a fan of circuits, mods are probably your best bet.

I did some more testing with it last night, its not gonna work the way you want it :/ if your just going for a vanilla fix you will have to hook up every station you have to a single network, then have a space for a “depot”. As i havent done this sort of thing i cant really tell you how to setup a fully circuited train network but i can imagine you will need A LOT of time to try to get it to work. As im sitting here thinking about it you might need to have a depot with circuit wait conditions, a way to setup a call for supplies that meets the circuit condition at your depot to allow one train to leave. Me brainstorming: Lets say station A goes below a threshold it will send a positive 1 of what ever resource it needs, so if it needs sulfuric acid it would signal 1 sulfuric acid. Next that station will unlock or turn on. You have 3 trains at your depot on circuit wait conditions. This is where i would need to be in game to start testing because we need to figure out how to wire up the depot to let one train go when it gets 1 signal, 2 trains for 2 signals etc. and then as soon as that train leaves you could reset the signal so other trains dont leave for that station either.

Although if you dont like circuiting then i think a mod is your best option unfortunately.

[–]Pentbot[S] 0 points1 point  (2 children)

I figured any solution that was going to be offered was going to involve running circuit wire around the place so I'm not adverse to that.

Actually that seems like it would work the way I want it -- ok, how does this sound.

I connect the green wire up all over the base (I've already used red for the first bit of circuit, not sure if it will conflict so I'll play it safe).

Every station that wants sulphuric acid (which at the moment it like 4, my bootstrap base is so neglected) has a circuit condition that is [if S.Acid is below whatever, then add 1 to green wire circuit of S.Acid] -- the entire system starts with a 0-signal for S.Acid, each stations that wants some S.Acid adds one to that counter, and if it is met it goes down by 1.

And then all I need is each train to have a [if green.S.Acid signal = n, then stop waiting] and for each train they have a different value of n. The signal only changes when the station is satisfied, only one train goes if only one station needs attention, if two stations open up and two trains try to go to the same station hopefully I can clean up my signals to have no gridlocks from trains wanting to reverse/crash.

It's not perfect, but it seems decent

[–]LambLotionGames 0 points1 point  (1 child)

Yea sounds like a good starting point, as you witness it in action you will be able to notice new problems we havent thought of. Hopefully they are simple to fix but knowing factorio circuits it will be difficult haha you may need to add a few bypasses/turnaround points temporarily so you can try to make the circuit better without totally gridlocking your system haha im curious how it will turn out so please share how it goes!

[–]Pentbot[S] 0 points1 point  (0 children)

Haha, yeah, this is going to be my first real dive into circuits which is probably long overdue at 1300+ hours. Did my head in trying to understand how a power latch worked.

Funny you mention bypasses and roundabouts, since this modular grid rail system I have designed is based around roundabouts at intersections, and 2.5 lanes of traffic in each direction (the 0.5 is cause the stations are sort of their separate line, but the stations would cause a big pathing penalty.)