SANDBOX — this is a test environment. No servers are actually deployed and no real payments are charged.
Back to NxLabs

NxLabs / Factorio

Railway Tunnel (Alpha)

MBy muppet9010

A railway tunnel so trains can cross under each other. An ALPHA release to demonstrate the concepts and completed functionality so far.

Description

Usage Demo
Usage Demo

Does not work with other mods that add or change train carriages, locomotives or any other track related entity. ==========


ALPHA MOD =========

Early release of the mod that should be fully functional. It's still got some key features missing and isn't compatible with any other mods that add new train or carriage types. Intended for demonstration, testing and experimenting purposes.

At present there are no plans to continue significant development of the mod, however, any very small bugs may be addressed. This demonstration version is being released to show the concept and what has been achieved to date. See the Mod Design History section at the end of the file for further details on this decision.

All references to curves/corners/bends seen in-game and in this readme relate to an incomplete feature development. This WIP feature can be enabled with the mod's startup setting, but these curved tunnels are non functional and are just provided as a demonstration of the building system. Any tunnel built with curves will fail to complete and thus not be usable. This is also why the underground parts of the tunnel have curves and the tunnel portal parts don't. Straight tunnels will complete and work.

Mod Features ============

  • Trains will natively use tunnels just like any other track, no need to specially path via them. Just order a train to go to a station on a far side of a tunnel and the train will use it.
  • Tunnels are built by placing the entrance and exit tunnel portal parts and building underground tunnel parts between them. Special pieces of underground tunnel allow for rail tracks on the surface to cross the tunnel. This module design allows for maximum design flexibility.
  • Tunnels support "bendy" parts for both portal segments and underground types in the form of corner, curve and diagonal parts. They give flexibility when building more complicated designs and so its easier to build tunnel portals long enough for trains to fit within. These do unfortunately have some usage considerations and limitations as detailed under the Usage Notes section.
  • The mod has been designed and optimised to be UPS efficient considering what it is trying to do.
  • Tunnels can be used in both directions, however, the mod is designed on the basis that most tunnels will be either used in a single direction as part of dual tracks or bi-directional on a very low usage rail track. There is a documented limitation around a rare issue with high frequency bi-directional tunnel usage later in this readme.
  • Tunnel/Portal GUI shown when a portal part is clicked on. Shows key information about it including the size of train it supports and the current usage state. It has features to help the player handle any odd situations, with options to distribute fuel to the train using the tunnel, and an option to mine all train carriages on the tunnel portal's tracks.
  • Tunnels can not be entered by players, they are purely for trains to go under one another. Players riding in trains through tunnels stay on the surface to enjoy the view.
  • A train must fully fit within the tunnel's entrance and exit portal to be able to use the tunnel. If the train is too long it will be prevented access upon entry and a GUI alert raised to the player for them to manually correct the issue. Some consideration in tunnel/rail network designing is thus required.

Usage Notes ===========

  • Tunnels are composed of 2 complete portals with underground parts connecting them.
Tunnel Setup
Tunnel Setup
  • A complete portal is made of 2 portal End parts with a number of portal Segments between them. Each portal's segment’s length (end parts not counted) must be long enough for the train when it tries to use the tunnel.
  • When a complete portal is made a tunnel portal graphic will appear with both ends of the portal closed to trains.
  • The underground of the tunnel is made up of a series of underground parts.
  • When 2 valid portals are connected by underground parts a tunnel is formed. This can be seen as the outside ends of each portal facing the wider rail network will have their graphics show an opening, with rail and signals appearing on them. At this point trains can path through the tunnel and use it.
  • Too long a train trying to use a tunnel will be prevented, but unfortunately I can't stop a train that is too long trying to path through the tunnel so some consideration by the player when building their rail network is required. The max length train a tunnel can accept is the minimum length of either portal's segments (non end parts). A train's length for vanilla Factorio carriages is 6 tiles, plus 1 tile per carriage connection. This will match the length of a train on a regular track. i.e. 1 carriage is 6 tiles, 2 carriages are 13 tiles (6+1+6). This limitation was introduced as it massively saves on UPS and with large bases this is very important.
  • The tunnel parts can only be validly placed on the rail grid, however, it isn't possible to snap these like a regular rail track. So if the tunnel part is misplaced the nearby rail grid locations will be highlighted, a green square for buildable locations and a red square for blocked locations, based on ghost type placement.
  • The tunnel is a single block of rail and so only 1 train can use a tunnel at a time. Trains do slightly prefer empty normal tracks over tunnels, but will use a tunnel over congested track.
  • Bendy tunnel parts of corner, curve and diagonal parts are a bit special all around, but it is the best overall compromise I could find.
  • The 3 types of bendy parts are:
  • Corner parts are the inner part of a 90 degree bend with their 2 ends being on the diagonal.

Ratings & reviews

No ratings yet

Sign in to leave a rating or comment.