Controlling the trains with circuit network (currently)?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
User avatar
MalcolmCooks
Filter Inserter
Filter Inserter
Posts: 253
Joined: Mon Apr 06, 2015 8:32 pm
Contact:

Controlling the trains with circuit network (currently)?

Post by MalcolmCooks »

Is there any possible way to control trains using the current 1.12 circuit network? I am starting to implement oil in a new game and my oil feild is far away from any convenient site for a refinery/chemical plant, so I want to use trains to move the oil. my standard train size, 4 cargo wagons, can hold 30,000 units of oil. Clearly I won't be able to use up all of that straight away, so if I set up a fixed-time train I will have it running around not being loaded/unloaded and wasting fuel. The ideal situation would be:

-The train would only load oil at the pumpjack station when there is enough in reserve to fill the train
-The train would only unload oil at the refinery station when there is enough space in storage tanks to empty the train
(these two are simple to implement at the moment since storage tanks can connect to the circuit network)
-The train would wait at the pumpjack station (or a holding station) until there is space in storage tanks at the refinery to empty the train. Extra buffer tanks would make sure I don't run out of oil by the time the train gets there.
-The train would wait at the refinery station (or a holding station) until there is enough oil in storage tanks at the pumpjacks to fill the train

I have noticed that inserters will remove fuel from a locomotive (this caused problems with non-standard sized trains at my refuelling yards) so my idea to implement this is to keep the trains starved of fuel. When the train arrives at a holding station, all the fuel will be removed. Only when the inserters recieve the appropriate signal, they will allow the train a limited amount of fuel so it can get to its next destination.

my questions are: Is there anything I have overlooked that will cause problems? Has anyone else tried to do this, or has set up a different system to control trains? How can I use the combinators to emit a pulse signal instead of a constant signal, to only let the trains have a small amount of fuel each time?

P.S I am using double-headed trains with four cargo wagons mainly for aesthetic reasons :) One of my goals in this game is to have a realistic and extensive rail network.

Boogieman14
Filter Inserter
Filter Inserter
Posts: 770
Joined: Sun Sep 07, 2014 12:59 pm
Contact:

Re: Controlling the trains with circuit network (currently)?

Post by Boogieman14 »

In the vanilla game there's currently very limited options to control train flow (I believe most of this is planned for 0.13). If you're open to using mods, you could check out SmartTrains, which allows you to read train contents and make decisions based on that.
I don't have OCD, I have CDO. It's the same, but with the letters in the correct order.

XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Re: Controlling the trains with circuit network (currently)?

Post by XKnight »

MalcolmCooks wrote: my questions are: Is there anything I have overlooked that will cause problems?
Yes, you missed next thing:
Even if you take all fuel from train, the last fuel entity always will be inside, because this entity is already partially consumed.
Overall result will be next:
1) train arrive to the station
2) all fuel are taken outside
3) train start moving (because it has last fuel entity)
4) train runs out of fuel
5) and it will stop somewhere between stations.

The only way to handle this problem is to create some loop, where train will be able to spend last fuel entity completely.
For example:
1) train arrive to the station
2) all fuel are taken outside
3) put one fuel item in train (at this moment train has about 1..2 fuel inside)
4) fuel-waste cycle
5) completely empty train at station.

It is important to realise that train is accelerating only if it has fuel. But without fuel it moves by interia.

User avatar
MalcolmCooks
Filter Inserter
Filter Inserter
Posts: 253
Joined: Mon Apr 06, 2015 8:32 pm
Contact:

Re: Controlling the trains with circuit network (currently)?

Post by MalcolmCooks »

XKnight wrote:
MalcolmCooks wrote: my questions are: Is there anything I have overlooked that will cause problems?
Even if you take all fuel from train, the last fuel entity always will be inside, because this entity is already partially consumed.
Of course, that should have been obvious, thank you :(
Boogieman14 wrote:In the vanilla game there's currently very limited options to control train flow (I believe most of this is planned for 0.13). If you're open to using mods, you could check out SmartTrains, which allows you to read train contents and make decisions based on that.
Thanks the mod seems perfect! That's a much simpler solution

waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: Controlling the trains with circuit network (currently)?

Post by waduk »

Smarter circuitry mod is also capable managing trains.
https://forums.factorio.com/forum/vie ... 91&t=14824

Post Reply

Return to “Gameplay Help”