Quick Nav


Back To Top

Overview

AutoTrainDepot (ATD) enables the use of generalized train depots without reliance on logistics bots just handling everything automatically, by adding mechanisms to prevent item deficits or surpluses from causing deadlocks, and allowing for intelligent train-specific loading. It also adds a handful of other features to make train-based logistics more flexible and powerful, without making it much more complex to use.

Depots

In a train-based factory (as opposed to, for example, one built around a "main bus"), there are one or more centralized item repositories that act as intermediate storage and/or switching points for various items. For example, one train might collect iron, copper, and steel, and return with various military products (gun turrets, red ammo, etc). Another might take iron and copper and produce green circuits, pipes, gear wheels, and red science. A third might take those pipes and circuits, plus more raw iron and steel, and make engines, green science, and mining drills.

In other words, a common storage buffer is used as both the source and the destination for various items, collected or deposited by individual trains, based on their route. There can be one master depot that stores the entire factory's buffer, or there can be local/specific depots, for example for ore, oil products, stone works, or more.

In vanilla Factorio, this is only really possible with the logistics network; because belts and inserters will generally blindly collect whatever they can from a train, and place it in the depot, it can and often will disproportionately fill with items that are produced in greater quantity, leaving no space for other items and causing a complete stoppage of production. Because the filters and conditions on the belts/inserters would need to change constantly, based on the contents of the current train and current depot state, this is not generally feasible with anything but a logistics network.

Automated Depots

AutoTrainDepot's core feature is the addition of an intelligent depot control system to prevent that deadlocking, as well as simplify the use of these "one production loop" trains. A depot is constructed by building several storages - chests, warehouses, et cetera - between two rail stations made with special train stops, such that the same storages are the output of one station and the input for the other. Then, these storages are connected with circuit wire to the depot controller, as are each of the train stations (color of wire from the storages is not important, but the stations are: red for the "filling" station and green for the unloading one).

If set up correctly, the depot controller will then monitor both stations and all connected storages and will manipulate the I/O to and from those storages to do several things: Depots have an input to select the number of item types the depot is expected to handle; the capacity for any item is thus the total available storage divided by this number (once accounting for stack size).

With an automated depot, you can dispatch any number of trains to and from it, attempting to deliver or collect any item, without any risk of an excess of, say, stone bricks preventing anything else from being delivered. This allows for massively complex train networks all sharing the same central storage, allowing you to focus on the various production outposts.

Fluid Depots

ATD also adds the ability to build fluid depots, which enable a centralized storage for up to six fluid types, and which can dynamically connect to the correct wagons for draining or filling on a train-specific basis. This allows you to have "freeform" trains; rather than needing to ensure that, for example, sulfuric acid pickup was always the third wagon in the train, so that it would be filled with the correct fluid, with a fluid depot you can bring in any train that fits in the station, and the depot controller will intelligently connect the pumps as needed, with no risk of mixing (provided you have built a proper depot with six independent pump/pipe/tank systems).

This is done by the use of a custom GUI that is opened alongside the vanilla train GUI, where you can set which of the six "fluid slots" (plus "none") each fluid wagon in that specific train is mapped to. For example, if you have train A with wagons of sulfuric acid, hydrazine, crude oil, and chlorine in that order, train B that wants to collect chlorine in its first fluid wagon, and train C that wants to deposit crude oil and collect sulfuric acid in cars one and four respectively, you would mark the four wagons of A with slots 1 through 4, then the first of B to slot 4, the first of C as slot 3, and the fourth of C as slot 1.

Technologies

All of the depots' capabilities beyond simple limit management are unlocked with dedicated technologies; depots will be unable to perform the majority of their tasks without them. Completing a technology will make it available to all depots, even pre-existing ones. These capabilities are: There are also technologies to increase the - initially small - max item/fluid type limit, max item count, and how many slots per storage and per wagon the depot can "see" and thus make use of.

Rapid Loading and Unloading

There are optional (as in can be disabled in mod settings) rapid loader and unloader devices, to improve throughput on late-game depots; these have very high throughput, but also high (multi MW) power draw. In the case of unloading, they also take far more space than inserters.
Sample depots, with and without BobMods. Both are using the rapid loaders and unloaders instead of basic inserters.

Other Features

ATD also adds a handful of other features to expand upon train logistics and prevent issues. These include the Station Bypass Beacon, which allows a train to skip a station in its route if it has no real need to go there (for example it is already mostly full of the item that stop would deliver, or that stop has nothing to supply), the smart train stop, which can intelligently handle "ingredient" vs "product" wagons, and direct trains based on whether it has product-type items available or space for ingredient-type ones (for example not allowing a train to leave a production station until "ingredients" wagons are empty), and a "deadlock detection" alert in case trains become properly stuck.

Configuration Settings

This mod contains several config options to modify values and behaviors - such as for balance or server safety concerns, or simply personal taste - to your preferences. Note that several settings may have bounds imposed on their values, either logically or explicitly; these can usually be seen in the actual settings files or ingame. These are listed in order found in the source code, which is generally the order in which they were added; They may be present in a different order ingame or in the configuration files.
The settings for the mod, when installed, can be found ingame, in the mod settings menu.

Add larger versions of Angel's Warehouses

Type: bool
Current Default Value:
true

Add Rapid Train Loader

Type: bool
Current Default Value:
false

Add Rapid Train Unloader

Type: bool
Current Default Value:
false

Rapid Train Unloader is Inserter

Type: bool
Current Default Value:
false
Whether the rapid train unloader should be implemented as an inserter rather than a loader. Improves performance but reduces flexibility.

Prevent trains from waiting forever

Type: bool
Current Default Value:
true
This will change the pathfinding weights for train routing logic to prevent trains from waiting behind other trains that are likely to never move, or only do so after a significant length of time (eg manual mode, parked at a station, lost without a path, etc).

Enable sounds for the "train deadlock" alert

Type: bool
Current Default Value:
true

Enable sounds for the "train has no valid path to station" alert

Type: bool
Current Default Value:
true

Source Code

The source code for AutoTrainDepot can be found here:GitHub

Downloads

Via Factorio Mod Portal