Page 1 of 1

Allow rail to be connected to the circuit/logistic network

Posted: Wed Jul 27, 2016 3:53 pm
by cogwheel
Currently you can connect signals to the circuit network. This is OK for keeping trains from moving, but it doesn't help when you want to disable a path entirely. Making signals disable paths is not an option, since that would mean trains couldn't follow each other through blocks along the same path.

I propose treating rail much in the same way as transport belt.

You connect a rail tile to a circuit/logistic network. It has the option to enable/disable the tile give a signal, which removes the tile from the pathing algorithm.

It would also have a read function to detect the kind of rolling stock currently on it (locomotive, cargo wagon, oil tanker, etc), and give red/green/blue values for the color of a locomotive

Re: Allow rail to be connected to the circuit/logistic network

Posted: Wed Jul 27, 2016 6:21 pm
by terror_gnom
I thought about this too, but the problem will be, what happens if a train is in the deadend? Youll deadlock your train traffic pretty often :(

Re: Allow rail to be connected to the circuit/logistic network

Posted: Wed Jul 27, 2016 10:01 pm
by atloomis
Why can't you just use a signal?

Re: Allow rail to be connected to the circuit/logistic network

Posted: Wed Jul 27, 2016 10:15 pm
by cogwheel
Signals block movement, not pathfinding. If you turn a signal red, trains will line up behind it until it changes.

Re: Allow rail to be connected to the circuit/logistic network

Posted: Thu Jul 28, 2016 12:44 am
by siggboy
I'd like to be able to connect to rails, but not for disabling it or anything, but in order to get a signal FROM the rail, that would tell me what's on it.

If there's a wagon on it, output a signal
If there's something IN the wagon, output the contents of the wagon as signals (like from a chest) <-- this one is huge, and commonly requested
If there's a locomotive on it, output a signal for the loco, and signals for the fuel in the loco and if there's a player in it
Output a signal if the train on the rail is moving or not

Maybe a variation could be to output the "wagon" and "locomotive" signals in pulse and hold modes, that way you can detect if the train is moving or not, and also make train counters and train detectors in whatever fashion you desire. The cargo content should always be output in "hold" mode, no matter what.

Re: Allow rail to be connected to the circuit/logistic network

Posted: Thu Jul 28, 2016 6:57 am
by cogwheel
siggboy wrote:I'd like to be able to connect to rails, but not for disabling it or anything, but in order to get a signal FROM the rail, that would tell me what's on it.

If there's a wagon on it, output a signal
If there's something IN the wagon, output the contents of the wagon as signals (like from a chest) <-- this one is huge, and commonly requested
If there's a locomotive on it, output a signal for the loco, and signals for the fuel in the loco and if there's a player in it
What if there's a wagon in the wagon? I think the simple case of a circuit wire attached to a rail should only be able to read what's riding on the track. Something else could be used to read read cargo, maybe helping flesh out the rail tech tree.

I'm imagining something like a few tiers of "Rail Platform" or some such tile that can be placed in a valid car position relative to a train stop. Or maybe something like a Train Stop Mk 2 that has something you can hook up to for each car.

Maybe something like the loader could see a resurrection?

Re: Allow rail to be connected to the circuit/logistic network

Posted: Thu Jul 28, 2016 8:18 am
by siggboy
cogwheel wrote:What if there's a wagon in the wagon?
Well, obviously the rail does not output the "Cargo wagon" signal to signify a wagon on the rail. There would be a special virtual signal, that is not the same as "Cargo wagon". Or maybe just the "W" signal.
I think the simple case of a circuit wire attached to a rail should only be able to read what's riding on the track. Something else could be used to read read cargo, maybe helping flesh out the rail tech tree.
The train stations will be able to read the cargo. But if you have it "per rail", then you don't even need a train station, and you could also read the cargo wagons individually (which would be very useful for processing mixed cargo trains and balancers loaders and these sorts of things). You could also put a wagon on a rail like a large chest (a common trick), and still be able to read the contents.

Re: Allow rail to be connected to the circuit/logistic network

Posted: Thu Jul 28, 2016 1:09 pm
by atloomis
If in a case like this the train were able to choose anothe path, and if tracks could detect the presence of trains, that would be handy, but having the tracks do anything more than that seems excessive.

Image

Re: Allow rail to be connected to the circuit/logistic network

Posted: Thu Jul 28, 2016 7:29 pm
by mattj256
Here's a mod:

[MOD 0.12.X][0.0.8] Rail logic system
viewtopic.php?f=93&t=14105

It has a rail switch that can be used to physically place or remove a rail based on a circuit condition.
Also it has a train detector, cargo inventory reader, and some other stuff.

Unfortunately as far as I can tell it hasn't been ported to 0.13 yet.

Re: Allow rail to be connected to the circuit/logistic network

Posted: Sat Jul 30, 2016 10:45 pm
by ssilk
Added to viewtopic.php?f=80&t=30189 Ideas Around Conncetion of Railway and Circuits