Overview - rain9441/factorio-tls GitHub Wiki

Train Logistics System (TLS) is an advanced design to facilitate automatic distribution of resources to remote locations. The primary purpose of this system is to automate the delivery and construction of remote outposts. The mission was to allow for a player to construct any type of remote base without any need to revisit a central location to restock on personal resources. There have been dozens of revisions to this idea over the course of many playthroughs and this version is the culmination of countless lessons that have been learned.

The TLS concept was first thought up while attempting to complete a 100% speedrun in version 0.16. That idea was improved upon in a second 100% speedrun and then finalized during a casual megabase playthrough.

What does this solve?

Suppose you want to build up an outpost in a distance location. If it's a giant iron patch that is far away, you need to bring an enormous amount of supplies. It's inefficient to collect what you think you need and travel to the outpost, so you build a train to carry everything you need. This train is jam packed with miners, rails, bots, modules, beacons, walls, turrets, ammo, pipes, and just about everything you ever think you might anticipate you'd need. You get in the train and head out. You build rails, clear biters, and get to the outpost. You now have to walk from your build train to the outpost location to place all of the structures. Your Power Armor MK2 battery dwindles rapidly and your inventory is overflowing with wood. You want to do on site smelting, but your base is low on modules so you don't have enough modules to build the electric furnaces correctly. You run out of power poles so you have to send your build train back to the base to get more resources before summoning it back to your position.

This process is incredibly inefficient. How can we get to a point where all of this is automated and the only thing we have to do is build a small seed blueprint that has everything it needs to build anything you want without having to do any actions at all? What is the absolute minimum amount of entities we have to place in order to achieve this goal? How can we make this system smart?

Our ideal situation is to turn off our personal roboport, place down 20 modular blueprints, and then leave knowing that everything will be built by construction bots while we are away, regardless of how many resources we have on hand.

TLS is comprised of two major components: The Outpost Station and the Loaders. The Outpost Station has three parts: The Unloader, the Train Dispatcher, and the Trash System. The heart of TLS is the seed, which contains the Unloader and a single Train Dispatcher. The seed is the basis of TLS and streamlines outpost construction.

https://github.com/rain9441/factorio-tls/blob/master/screenshots/02-seed.png

How does it work?

The initial blueprint that is placed consists of a single train stop, a few inserters, two roboports, some chests, and a handful of combinators that drive the logic of the unloading system. A preconfigured seed train is setup to travel to any station named TLS Dropoff Seed with a depart condition of D > 0. The seed train has exactly one cargo wagon. It can be a 1-1-1 train, but in my case I prefer to have four locomotives and one cargo wagon with the cargo wagon setup in the 2nd position. The seed train arrives and unloads various items. Logistics Bots and Construction Bots are unloaded directly into a steel chest buffer and then directly inserted into roboports. Other items are unloaded based on what is on the train and what is requested by the Unloader. Constant combinators are setup to configure the amount of items that the system wants. Logic is in place to find any items that are both on the train and who have less quantity in the logistic network than what is configured by the constant combinator. Any needed items are sent via a wire to the stack inserters to have them unload specific items from the seed train. If there are no items that match this criteria, the D signal is set on the wire and transmitted to the train to tell it to depart. A second constant combinator is setup to configure what amount of items trigger the system to dispatch the train to the station. This gives the system the flexibility of configuring both if we are at least x units of y, then dispatch a train to deliver y as well as pull up to z units of y from the train. That lets us stock up on 400 rails, but only dispatch the train if we have less than 100 rails.

Once the first seed train arrives, resources are moved from the active provider chests into storage chests to ensure there is enough room for unloading large quantities of resources. The logistics network should now have construction bots, logistic bots, and enough resources to build the rest of the Unloader in its entirety. This is the basis for the system, a simple seed can dispatch a train that can deliver enough resources to build the entire Unloader, which can then dispatch the trains to deliver anything you configure it to to build anything you'd like.