Railway Styleguide

From LinuxWorks Minetest Server Wiki
Jump to navigation Jump to search

There are some pieces of advice for track builders. Please, don't build any new Shittles!

Hume2's styleguide

If it is possible, place the track on the same level as the default terrain. Don't build any tunnels/ridges/dams/bridges if you don't need to. Also the turns should be as fluent as possible and the tracks don't have to be axis-aligned.

If the track is slightly above the default terrain (less than 4 blocks), put it on a dam. A dam should consist of dirt (or other surface material) and should have a 45-degrees slope on both sides. If the dam needs to be too wide, you can make the slope steeper but then you should reinforce it by building a wall. If the track is too high, make a nice bridge instead.

If the track is slightly bellow the default terrain, make a walley. There should be a 45-degree slope on both sides. If you need to subtract too much material to make the slope, make it steeper but reinforce it by building a wall. If there is a naturally-generated cliff next to the track, you can keep it as is. If the track is too deep, build a tunnel instead. A tunnel should be 4 blocks tall. If there is going to be only one-block thick layer above the tunnel, destroy it and make a ridge as described above.

Use digtrons or worldedit only if you are aware of all side-effects. Also keep in mind that such tools usually don't do all the job, you still need to look at the result and fix the issues.


Given that interlocking is now largely a popular enterprise, it would make sense to establish a certain standard allowing for interoperability.

Mode of Operation for regular signals

With junctions, there isn't much of a choice — signals around a junction must be using ARS, otherwise the junction will not be usable. However, regular block signals can be arranged in the following ways, each of which has its pros and cons:

Type Meaning of red signal Meaning of green signal Advantage Disadvantage Use cases
Manual Routesetting
  • No route is set
  • No information about whether a route can be set
Route is set
  • Trains will not set a route that might block a mainline while they are stopped for an extended period
  • The driver won't forget to set the right routing code or line number and go the wrong way
  • Driver has to remember to set a route
  • Not possible for automatic trains
  • It takes time to set the route, worse with lag
  • Irregular freight service
  • Testing interlocking
  • Manually managed depots
Automatic Working
  • Track is not clear
Track is clear
  • Warning when driving backwards
  • No need to set rules - but they should be set anyway
  • Good for troubleshooting
  • When driving backwards, route needs to be set manually
  • Not usable for single-track lines or junctions
  • Simple block signals for double-tracked lines
ARS (Automatic Routesetting)
  • Track is not clear
  • Route is not set
Route is set
  • Route don't have to be set manually
  • Route selection by rules
  • Shared sections/single-track sections possible
  • No warning given when driving backwards - mitigated by best practice to use a signal on both ends of a platform.
  • Without rear-facing signals, users can drive backwards unpredictably long without authority
  • Rules required (default: "*")
  • Railway junctions
  • Single-track lines
  • Route is not set
  • Route can not be set
Route is set
  • Can do jobs that can't be done with ARS or Automatic Working
  • Can be programmed for easier troubleshooting and/or external display
  • Hard to set up and maintain
  • Requires atlatc privilege
  • Automatic depots (e.g. for on-demand trains)

Regardless of what system of route setting is used, a best practice is to put rear-facing signals to prevent reversing a train without authority. Automatic Working sections will warn if a train is reversed into a section reserved for a route and cancel the automatic working. ARS sections would only warn if a train were present in the section being reversed into. In either case, there is no prevention of collision. The only proper solution is to make rear-facing signals with an influence point set (no route or event TCB assignment is necessary) so that trains cannot make an illegal reversing move,.

Interlocking Tips

  1. End the route through a junction in the first straight (non-diverging, only two tcbs, one on each end) piece of track following the junction in the direction of travel. This way, trains will proceed through the junction only when they can fully pass it through.
  2. The entrance signal at the "receiving end" from the point above is not needed. However, if you place a signal facing in the opposite direction (i.e. toward the junction), it will stop trains driving "against the fur" from entering the junction and causing trouble.
  3. Make all possible routes in advance, leaving them with empty rules (white) and named aptly (see below), so that anybody could use them later. If you made a complex junction, you're probably the only person who knows exactly how it works, and even then you'll probably forget in a month or so.
  4. Place all TCBs first and assign them to the tracks. Only create sections when you have placed all the TCBs you planned, and when you're completely satisfied with their locations. And don't create a section if you're unsure how the track ends (or if it's very long).
  5. The train frequency is dependent on the section length. The shorter it is, the more frequent can the service be. It makes sense to make shorter sections on the busiest lengths of tracks.
  6. Nature abhors vacuum, but interlocking — not so much. If you pack the elements too tightly (e.g.: a platform barely long to fit the train, with TCBs and signals on either end), it's possible the system will fail, for example, to register the train as having left the previous block. Same with influence points placed too close to actual track segment border. Leave some space!

Route names

There are currently many problems with route naming, because of:

  • Routes that are named after trains
  • Non-descriptive route names
  • "Ad hoc" names ("*","A", etc) that carry no meaning
  • Abbreviations that nobody except the author can understand ("PzKmpfWgn1", "ПРМ/вЖП", etc)
  • Non-English route names ("Gleis 3", "yat hou dzam toi", etc)

The most optimal solution would be to have properly descriptive route name schemes that would allow anyone to understand the purpose of a route. Then, one could either select a route manually, or add the required RC/LN to the route's ARS rules to associate it with a new train service.

Proposed scheme is as follows:

[Qualifier] Action ([Direction] [---> Destination])


  • Qualifier is e.g. "Default" (for routes that are meant to be the default for most trains) or things like train name/class for which this route is intended (E.g. "Freight" or "Short Pax"). This can come in handy later, when tracks/routes are re-arranged, and it's good to know which route is to be prioritized.
  • Action (used here in broad sense) is a proper description of an action that this route is performing. It should not be confusing. E.g.: "Direct", "Go Straight", "Turn Left", "Turn Right", "Merge", "Overtake", "To Side Track" and such. For stations, additional actions can be used, e.g. "Inbound to Track X", "Outbound". In that cases the direction/destination can be omitted, unless the station is so large that this information is relevant again.
  • Direction should reflect the direction where the train will go on the map in short to mid-term perspective when using this route. E.g. "East" or "North". It will remove any ambiguity about the immediate direction of travel.
  • Destination is a list of well-known (or obvious, like "Depot", if the junction is literally near one) places which the train will be able to reach using this route. E.g. "---> South Forest", "---> Spawn, Origin".

Example: "Default Direct (North ---> Riverside, Origin)", "Merge (East)", "Turn Left (---> Depot)".

The simplest auto-working routes on straight tracks can be just called "Direct" or "Go Straight".

orwell's route name scheme

Most of the setups created by ⚖️ orwell use the following scheme:

  • Route when only one route is possible or useful, and it is obvious where it goes (e.g. block signal): 'A'
  • Routes into a station platform/track: 'Tn', where n is the track number
  • Routes at junctions or out of stations: Station code of a major station in this direction
  • Access to sidings: Name or verbose description of siding


The following ways are possible to let the train stop at a station and continue:

Type Requirement(s) Advantage Disadvantage Example usage case
Manual operation train_operator privilege
  • Employment for the driver
  • Passengers get to meet and thank the driver, more social
  • Driver only needs to stop at requested stops
  • Driver can take passengers anywhere if authority is given
  • Train only runs when the driver is online and wants to drive
  • Driving with lag is not easy or fun
  • Driver can miss stations if speeding; this is related to the previous point about lag
  • Irregular freight trains
  • On-request passenger service 'rail taxi'
  • In the event of ATC and/or station track breakdown to continue service
Regular ATC None
  • Easy to learn and use
  • Does not require additional privileges
  • Settings can be copied
  • Train may overshoot platforms
  • Can not set train display
  • Braking before entering a station
  • For users with basic access to advtrains features
Station/stop tracks
  • interlocking privilege
  • Easy to use
  • Train never overshoots platforms
  • Has autocomplete feature for station names
  • ARS rules has a lack of features
  • Setup cannot be copied
  • Stations with regular signage
  • Stations that not all lines stop at
  • atlatc privilege
  • At least basic programming knowledge
  • Can complete tasks that cannot be done with Regular ATC or station/stop tracks
  • Settings can be copied
  • Train may overshoot platform
  • Can cause problems
  • Stations that show departure information
  • Showing transfer information when entering a railway interchange
  • On-demand passenger service

Surface track

Good surface track on the ground should usually sit on gravel, analogous to real-world railway ballast, which allows prroper drainage. Hard surfaces like stone are also acceptable. Wood should only be used on bridges. Dirt, grass and sand are completely unacceptable. Rails should be at least 2 metres apart, with an exception for subways, which can be 1 metre apart. Tracks 3 metres apart is a good size to allow breathing room. The sleepers should not overhang the edges of the terrain.


Slope blocks come in 3 varieties: straight 1:2 slopes (called 2-slopes), straight 1:3 slopes (called 3-slopes), and 45 degree 2-diagonal-node slopes. 2-slopes should be avoided in any new construction except for Mountain Railways. You should also try to use diagonal slopes to your advantage to eliminate having a sharp curve radius. Finally, for best results, use the gravel 3a/b/c and 2a/b nodes that can be crafted out of gravel so that all of the ballast appears to slope, rather than just the track nodes' ballast. You can use a nice arrangement of these nodes to approximate nice slopes even on the diagonal slope nodes.


A good cutting should be either have a nice shallow gradient of 1:1, cutting blocks away to reach the desired height; or in difficult terrain it should have a retaining wall to keep the soil out. Leaving dirt, snow etc. walls that are any higher than 1 metre above the train is not very realistic.


Tunnels need to be a minimum of 3 wide and 3 high. Expect in the future higher trains with a minimum tunnel height of 4m. They should be lined with a solid material like stone and for best results any visible ores should be removed. The best-looking tunnels use curved edges like they were made by a tunnel boring machine; you can use a digtron to achieve this.


Bridges need to look as if they would realistically stand up. They should be made of structurally sound materials like stone, metal or wood. Either they should have supports that continue all the way to the ground, even if the ground is in water; or they should rely on the terrain on either end for their support. You can use the extrusion feature of digtron builders to help you build supports downwards.


Viaducts are basically a special case of bridges that are a self-supporting structure along their whole length rather than relying on the terrain on either end for support. They should always have vertical supports.


A good station lets you know

  • What line you're on.
  • What station you are at.
  • Which line and direction trains at each platform will go.
  • How to get to different platforms and services.

A good station:

  • Is not cramped with small tunnels.
  • Has proper length platforms for its trains.
  • Is easy to navigate with good signage and layout.
Platform length

Platform Length

The official lengths for platforms are

  • for subways (with 3 wagon long trains): 15m
  • for express trains (for 4-5 wagons long japanese express trains): 30m

There are also shorter platforms on official line station, when the train is eg. only 1 wagon long. For the length should also be considered that a building should look nice, so a platform with 35m could be better, to have in that case a middle part of 5m and two sides with 15m, which can be split up to two 5m parts and a middle 3m part.

Och_Noe's personal recommendation is to use 20m / 40m for platform, so that even a bit longer trains have enough space and the trains can be nicely placed in the middle of the platform with some space to both ends. A long platform could also be used to have two short train stopping at the same time at the platform, which can be used to show that two different subway lines allow changing trains without the need to wait for the other train. A japanese express train with 8 parts are about 40m long, so that even so long trains don't need longer platforms.


  • See Linetrack for style guidance about construction related to Linetrack.