Skip to content
Connected RailsConnected Rails

Shunting

A train is not only driven, it is made up. Insert calls the shunter to couple to whatever the train stands up against; Home uncouples behind the vehicle the driver sits in, which is a locomotive running round its train. Both are held down while he works: the order goes on the lever, and the answer — coupled, uncoupled, or which condition was not met — comes back on the line the train protection interrupts on.

The refusals are the point. Nothing is ever half done: both parts have to be standing still, the two ends have to be within reach of the gear along the track (a turnout lying the other way puts them out of reach however near they are through the air), and the coupling gear has to match — a Scharfenberg head does not meet a screw coupling, and a bar inside a fixed unit is undone in the works, not on the ground. What parts is the brake pipe too: the part that keeps the driver keeps its air, the other part’s hose is left hanging, its pipe drops and its control valves apply. Nobody rolls away.

Somewhere to shunt to is line content. A line names its stabling roads — sidings a unit can be left on — and its portals, the edge of the modelled world where trains appear and disappear (a fiddle yard, a junction beyond the last signal). The route editor’s rule check refuses a portal that is not actually at the edge of the line, because a train appearing in the middle of a running road is not a train, it is a collision. Stabling roads and portals documents the format; mods/example/lines/beispielstrecke.ron has a turnout, a stabling siding and a portal at each end.

The AI shunts too. A driver can be given a shunt job instead of, or after, a timetable: draw forward to a point, set back onto a road, couple to what stands there, uncouple at a coupler, finish at a stand. It is the same driver as ever — it writes the cab controls and nothing else — and it holds itself to the German shunting speed of 25 km/h, creeping the last few metres onto the buffers. A move ends when the buffers are met, whatever the mark said.

Shunting tasks are scripts. There is no shunting format and no hard-coded shunting scenario: what a shunting task asks of the driver, how it is checked and what it scores is a scenario script (Scenario scripting). A shunt job for the AI can be a file of its own (jobs/*.ron) that the script hands to a driver by name, or a table the script writes; mods/example/scripts/rangierfahrt.lua is a complete shunting task.

Over the network none of this needs a message of its own: the order is a setpoint in the cab like every other lever, and every peer works out the same consists from it.