Building a line
This guide walks through one line module from an empty mod to a test drive. It assumes
you already have a mod folder under mods/<id>/ with a mod.ron (see
Your first mod). The individual tools are described on the
route editor page and the file format on Lines;
this page only puts them in order.
A line in Connected Rails is a module: one lines/*.ron file (a LineSource) that
knows where on Earth it lies and how far it reaches. Several modules can later be chained
into one long line, see Chaining modules into a composition.
Before you start
Section titled “Before you start”Start the route editor:
cargo run -p route-editorWithout a file it opens the example line. Every edit can be undone with Ctrl+Z and redone
with Ctrl+Y or Ctrl+Shift+Z. The tool sidebar on the left is grouped into workspaces
(track, lineside equipment, landscape, terrain, people, module, imagery); 1 is always
Select, and the workspace’s other tools carry their number key beside their name. The
Properties inspector on the right has the pages Tool, Selection and Sections.
Fly the view with the right mouse button held and WASD (Q/E down and up), pan with the
middle button, and press F to frame the selection.
1. Create the module
Section titled “1. Create the module”- Choose File ▸ New module (
Ctrl+N). - Enter a Name.
- Set the anchor: type a place into the search field (for example a station name), pick the hit and click the exact spot on the small map. Latitude and Longitude fill in by themselves.
- Set the Initial size of the envelope (4 km by default), the Depicted year and whether the module is a Real rebuild or Fictional.
- Click Create module.
The module now has an anchor and a square envelope around it. Everything the module
owns has to lie inside the envelope, so reshape it to follow your line: pick the Envelope
tool in the Module workspace, drag a corner, click a side to add a corner, and press
Delete to remove the selected one. The anchor, envelope, year and fictional fields are
explained under Modules and compositions.
2. Save into your mod
Section titled “2. Save into your mod”Save right away with File ▸ Save as… into mods/<id>/lines/<name>.ron. The file name
without .ron becomes the line’s name, so mods/mymod/lines/talbahn.ron is addressed as
mymod:talbahn.
Saving early matters: height data is written next to the module, inside its mod, and the
height import refuses to run until the module is saved inside one. After that, Ctrl+S
saves in place.
3. Turn on the aerial imagery
Section titled “3. Turn on the aerial imagery”The aerial imagery is what you trace the track from. Press O (or the Imagery button on
the viewport bar) to show or hide it, P to switch the provider and [ / ] to change its
opacity. If the image sits slightly off the real track position, shift it with numpad
4/6/8/2 (5 resets).
The providers, the cache and how to add your own service (for example a state orthophoto
WMS) are configured in imagery.ron; see the route editor page.
Check the terms of use of each service before you use it.
4. Lay the track
Section titled “4. Lay the track”All of this happens in the Track workspace. The Tool page sets what the next piece is laid as: Track type, Permitted speed, Gradient, Electrification, and Tracks per lay with a Track spacing for several parallel tracks at once.
- Pick a track type. Every track has to name one, otherwise the module does not compile.
Open the Library (
Ctrl+Space), choose Track types and click a card; that arms Lay track with it. The types themselves are described under Track types. - Lay track. With Lay track, press and drag to set the standing end and its heading.
Every further click appends an arc that leaves the track tangentially and ends at the
click; hold
Ctrlfor a straight. Length and radius are shown beside the cursor.Enteror a right-click finishes,Esccancels. The tool options below the tools control Snap to standard radii, Easements & cant (curves as clothoid – arc – clothoid with the rulebook’s cant for the piece’s speed) and Snap to terrain. - Turnouts. Start a lay on the middle of an existing track: dragging along the track makes a facing turnout, against it a trailing one. Choose a standard Turnout in the Tool page (for example EW 190-1:9), or Free to draw the branch as clicked. The track is split and wired when you finish.
- Join ends. With Join ends, click one open end and then another. Ends on the same spot are welded; ends apart are staked out with transitions, an arc and a compensating straight. Design speed, radius, transition length and cant are set on the Tool page.
- Parallel track and crossover. Parallel track lays a parallel at the set spacing on the side you click. Crossover takes two clicks: the track it leaves, then the parallel track it reaches.
- Gradient. Gradient puts a break point on a track. Take hold of a break point and move the mouse up or down the screen to lift or lower it; the selection panel edits the figures and shows the climb.
- Check the alignment. With Select, click a track to bend it by its round support points, and to edit its gradient, track type and electrification sections on the Selection page. Red squares on the map are loose ends.
To set speed, cant, gradient, track type or electrification for a whole stretch at once (a station, a slow section), use Mark area and paint along the tracks; see Track areas.
5. Add height data and shape the terrain
Section titled “5. Add height data and shape the terrain”Until heights are imported the ground is flat.
- In the Terrain workspace, open the Height data (DGM) page under Sections.
- Click Download… to fetch the state survey office’s DGM1 sheets the module needs (eight states hand them out by URL), or Choose delivery… to point at a folder you already have. Set the UTM zone (32 west, 33 east of 12° E) and the Grid spacing.
- Click Import whole module, or pick single tiles with the DGM tiles tool and use Import picked tiles.
The Terrain tiles tool attaches more ground beyond the track corridor, one tile per
click. After the import, the brush tools Raise ground, Lower ground, Flatten and
Level to rail shape the details (a forecourt, a depot). Press T to see the terrain as
the run builds it. The supported formats, the states and their licences are listed under
Height data (DGM); the brush is described under
Terrain brush.
6. Place the lineside equipment
Section titled “6. Place the lineside equipment”Switch to the Lineside equipment workspace. Place device puts the chosen device kind on the clicked track; the Selection page then edits its position, facing, lateral offset and payload. Kinds that need a payload (magnet, line conductor, block marker, platform) offer a starting template there.
Signals
Section titled “Signals”- Open the Library, choose Signal kits and click a base form. This arms Place device with the naked signal.
- Click the track where the signal stands. The kit dialog opens with the placement; fit the heads and boards there. It can be opened again later with Construction kit….
- Select the signal. Its Signal table entry (designation, interlocking, kind, system, the signal it announces, guarded sections, signal type, model) is edited on the Selection page. A signal placed from the library gets its entry automatically; for a bare device, click Create signal entry.
- Below the entry are the routes that start at this signal. Find routes runs out over the track and offers one route per turnout leg ahead, each ending at the next signal.
How a signal is built and what its aspects mean is covered in Adding a signal and the Signals reference.
PZB magnets
Section titled “PZB magnets”Place a device of kind PZB magnet and set its Construction and Frequency on the Selection page. Use Link PZB magnet: click the magnet, then the signal it belongs to. A distant signal without a linked 1000 Hz magnet is flagged by the rule check.
Platforms
Section titled “Platforms”A Platform device sits at the platform’s start. Its payload gives the station name,
the length and optionally the height of the platform surface above the railhead; the
sign of the lateral offset says which side it is on. See the platform example in
Lines.
Stabling roads and portals
Section titled “Stabling roads and portals”Portals (where trains appear and disappear) and stabling roads are not placed with a tool
yet. Add them by hand to the yards: list of the saved file:
yards: [ (name: "Portal West", kind: Portal, edge: 0, s: 300.0, facing: Forward, length: 300.0), (name: "Abstellgleis 1", kind: Stabling, edge: 2, s: 120.0, facing: Backward, length: 170.0),],A portal’s track has to run out to a buffer stop or a module boundary. The fields are explained under Stabling roads and portals.
Lineside objects
Section titled “Lineside objects”Place object puts a mod’s 3D object (a catenary mast, a board, a hut) beside the track. Repeat in a row on a selected object stamps copies along the track, 65 m apart by default. See Track objects.
7. Set up the interlocking
Section titled “7. Set up the interlocking”The interlocking tables are edited in the editor; none of them has to be typed as RON. In the Track workspace, open the Interlocking page under Sections.
- Sections. Click Add section and add the tracks that count as occupied together (+ track). A signal’s guarded sections refer to these.
- Routes. Routes come from Find routes on a signal (see above) or from Add route here. Each route has an Entry signal, an Exit signal and a Kind (Train route or Shunting route).
- Derive path. Click Derive path on a route. It follows the track from the entry to the exit signal and fills in the sections, the turnout positions and the overlap. Where the route trails a turnout, it also fills in the Flank protection.
- Point at a section or a route in the list to see it on the map: its tracks in green, the overlap in orange, the flank protection in violet.
Overlap lengths, the two kinds of flank protection and track locks are explained in Lines.
8. Electrification and overhead lines
Section titled “8. Electrification and overhead lines”The wire over the track belongs to each track. Set it with Electrification on the
Tool page before laying, or afterwards on the selected track’s Selection page with
Add electrification section. Use "none" for a stretch under no wire, for example
between two systems. The system ids are listed under
Electrification.
High-voltage power lines across the country are scenery, not track equipment: File ▸ Import overhead lines… fetches them from OpenStreetMap for the module envelope. See Overhead lines.
9. Fix what the checks find
Section titled “9. Fix what the checks find”The rule check runs continuously and flags what will fail on the line: a track without a track type, a distant signal without its 1000 Hz magnet, a device beyond its track, a portal that is not at the edge of the line, anything outside the envelope. The number of findings is shown in the status bar; a click on it opens the Checks page of the Module workspace. Work through the list until it says No findings., then save.
10. Drive it
Section titled “10. Drive it”Start the simulator on your line:
cargo run -p app -- --line <mod>:<name>For the file from step 2 that is --line mymod:talbahn. The example line starts the same
way: cargo run -p app -- --line example:beispielstrecke.
Alternative start: import the track from OSM
Section titled “Alternative start: import the track from OSM”Instead of tracing every track by hand you can import the geometry of the railway=rail
ways from OpenStreetMap:
-
Export the track from Overpass Turbo as JSON (the query is on Example lines and import).
-
Convert it into a line file, naming the track type the imported track gets:
Terminal window cargo run -p content --bin import-line -- line.json --track-type example:b70 --name "Talbahn" --out mods/mymod/lines/talbahn.ron--dgm <dir> --epsg <code>adds heights from a DGM delivery in the same run. Without--track-typethe import usesexample:b70. A track type from another mod is a dependency: name that mod in yourmod.ron’sdepends:. -
Open the file with File ▸ Open module… (
Ctrl+O).
The import produces a single strand with speeds and cant from the rulebook. Turnouts, signals, platforms and level crossings are not carried over, so continue with steps 4 to 9. An imported file has no envelope yet; Reset under the envelope on the Module boundaries page puts one around it.
Chaining modules into a composition
Section titled “Chaining modules into a composition”A long line is several modules, joined at boundaries:
-
In the first module, select the track that ends at the module edge and open the Module boundaries page. Click Boundary at track start or Boundary at track end. The end has to be an open end (a buffer node).
-
In the neighbouring module, click Load ghost… and pick the first module. Its track is drawn as a grey ghost, and its boundary circles are snap targets, so the new track starts exactly on the agreed coordinates. Add a boundary there as well.
-
Write a composition,
mods/<id>/compositions/<name>.ron:(name: "Gesamtstrecke",modules: ["example:modul_west", "example:modul_ost"],signal_links: [(("example:modul_west", 0), ("example:modul_ost", 0))],)Boundaries at the same position (within a metre) connect by themselves.
signal_linkslets the last signal of one module announce the first signal of the next. -
Drive it like a line:
cargo run -p app -- --line example:gesamtstrecke.
modul_west.ron, modul_ost.ron and gesamtstrecke.ron are a working pair to copy from; beispielstrecke.ron is a single module with a turnout, a stabling siding and two portals. The details are under Modules and compositions.
Next steps
Section titled “Next steps”- Placing scenery: trees, fields, roads, buildings and objects along the line.
- Writing a scenario: put trains on the line and give the player a job.