Yet another train manager


A mod to manage a network of train and station. Some stations provide products (item or fluid) to the network, others stations request products. The mod allocate trains to carry product from provider to requester. This mod is highly inspired from the great mod LTN but with a completly different implementaton.

Content
11 days ago
2.0
184
Trains
Owner:
Telkine2018
Source:
https://github.com/Telkine2018/yet_an...
Homepage:
N/A
License:
MIT
Created:
2 months ago
Latest Version:
1.0.8 (11 days ago)
Factorio version:
2.0
Downloaded by:
184 users

Features

  • The mod Yatm (Yet another train manager) manages a network of train based on the principle of provider/requester as the great LTN do.
  • It can combine pickup from many different stations for the same delivery (option in requester stations)
  • It can manage different drop off with the same pickup using buffer station
  • It support partial deliveries from buffered trains
  • Train are filtered at each station depending on train composition
  • It use the last factorio train API to compute travel distance (with internal caching). No need to set different networks for unconnected rail parts.
  • It has Builder station to automatically add / remove train depending on the need of the network
  • It has endgame teleport station to help improve traffic flow (require a lot of energy)

General behavior

Some stations publish the items/fluids they produce.
Some other stations request some items/fluids.
A station can request some items/fluids and provide others.
Yatm pick trains from a pool of depot to transport the item/fluid from the producer station to the requester station.

Combinator

YATM adds a new type of combinator which must be put near a trainstop (2 tiles).

A YATM combinator may work in different modes:

  1. Depot: a station that keep a train not involved in a delivery
  2. Provider: a station that provides some items or/and some fluids to other stations of the network
  3. Requester: a station that requests some items/fluids from the network
  4. Provider & Requester: a station that provides some items/fluids to the network and also requests other items/fluids
  5. Buffer: a station that holds a train which can request its contents from the network and performs multiple deliveries aferward. Acts as a provider for requester station.
  6. Refueler: a station that can automatically refuel locomotives when they becomes low in fuel.
  7. Builder: a station that can build / dismantle train depending on the need of the network. You have to provide all the items and fuel necessary to build the train in a chest near the Yatm combinator (1 tile).
  8. Feeder: A provider station that contains a single train that has to be filled by the player. The content of the train is made available to the network.
  9. Teleporter: A end game station that can teleport a train to another teleport station. Each teleport station has range (default 300 tiles). Any train starting from a start station can automatically use a teleport station in range to another destination teleport station in range of the destination station.

Each mode has its own set of parameters.

Simple setup

  1. Place a trainstop with a Yatn combinator near. Select depot mode for combinator. Add a train and route it to station.

  2. Place a trainstop with a Yatn combinator in mode provider. Connect the container with provided items to the input of the combinator with a RED wire. Place some inserter to load items into trains (for automatic train layout).

  3. Place a trainstop with a Yatn combinator in mode requester. Place some inserter to unload items from trains. In the parameter dialog, select the request item(s), the quantity to request and the minimum quantity for a delivery.

This should work. When hovering the mouse over a combinator, you can see the state of the trains and deliveries.

Layouts

Each station has a train layout that list the trains that are allowed at this station. There are two kinds of layout:

  • Generic layout can have only 3 different elements, locomotive, cargo wagon, fluid wagon. Any train entity matching the type of the element will be accepted

  • Specific layout contains exact train element class.

Yatn try to find a default layout from the inserter/pump/loader connected to the station. This configuration can be changed in the configuration dialog. Clearing the configuration restores the default layout.

Combinator configuration

The configuration of a combinator can be done either by the configuration dialog or by signals (signals overrides configuration dialog). Specific signal are defined most of the parameters of the combinator.

Any signals from the RED wire with a negative will be recognized as additional request.

Any signals from the GREEN wire with a negative value will be recognized as threshold definition. If the checkbox "Use green signal for priority" is checked, the values are recognized as a priority value by product.

Combinator output on green wire

During a load/unload session, the combinator output the invert value of the content of the train after the session.

So to test the end of the loading of an item/fluid:

Condition: (output of the combinator) + (content of the train) < 0

To test the unloading of an item/fluid:

Condition: (output of the combinator) + (content of the train) > 0

This will work even for partial loading and unloading.

For station that can provide/request item/fluid, there is a signal to contains the type of operation (1 loading , 2 unloading)

Then red wire in output is available to have additional information:
- Same a green wire
- Global stock that contains all items/fluid available in the network (filtered with the network mask)
- Current delivery (partial)
- Current delivery (full)

Combinator colors

  1. Black: not connected
  2. Grey: provider, nothing provided
  3. Green: provider idle
  4. Yellow: delivery ongoing
  5. Orange: requester idle
  6. Red: requester, missing item/fluid
  7. Blue: depot, train assigned
  8. Cyan: depot, free
  9. Pink: inactive station

Buffer station

A buffer station acts as a request station and a provider station at the same time. A train is hired from a depot and the request are processed. Then the content of the train is dispatched to other requester station. The stations should be properly setup to handle partial deliveries.

A train can be locked to the depot. Otherwise if a train is scheduled to be empty after a delivery, it will be released to the depot. A new train is hired for the station.

Refueler station

If present, train low in fuel will be redirected to a refueler station. Otherwise it will be stuck to its depot. The default time before a train need refueling in the settings

Builder station

A builder station is a kind of depot station that can add / remove train depending on the need of the network. The train layout is done in the configuration of the station. A chest with the items (included fuel) required to build the train should be placed need the Yatn combinator. When building a train, the items are removed from the chest. When removing a train, the items are put back to the chest. A builder station cannot remove more train than added.

To have a functional station, don't forget to put a signal at the entrance of the station and leave a straight rail long enough for a single carriage behind it.

Feeder station

A feeder station is a kind of provider station where the provider content is the content of the train.

Teleporter station

An end-game station that can teleport train. When there is journey from a source station to a destination, Yatn check the existence of a teleport station in the range of the source station, and another teleport station in the range of the destination station. In this case, the train is sent to first teleport station, is teleported to the second teleport station and then route to the destination station.

A teleport event cost 1GJ of energy. A teleport can draw up to 200MW from the power grid.

A teleporter station output a signal contains the count of trains using the station. May be used for control flow.

It mays happen that teleportation fails (rarely). The train is destroyed.

Teleportation cannot take place if there is not a route from the source station to the target station.

The station have a "Planet teleporter" checkbox. When checked, the teleporter can route to any teleporter station which have also the flag set. Only stations that are in the range of the teleporter stations can be routed. For example, a provider station on one surface can supply a requester station on another surface. The two stations must be in the range of a teleporter station with "Planet teleporter". It works with depot/requester/provider/buffer stations.

Train limit

Train limit will work properly with Yatn only if the station name is unique for a network. If a train limit is set for a station and the limit is reached, the train is routed to the nearest depot and will wait until the station become available.

Disable signal

A station can be disabled either by configuration or by signal. A disabled station proceed all current operations (delivery, teleport, ...) but does not initiate new ones. When copy/paste a station, it is automatically disabled.

Precise loading

It is possible to use a transfer controller in order to have a precise control of the loading process.

  1. Place a transfer controller near each wagon site
  2. On the first controller, select this option "Direct connection to YATN"
  3. If necessary, connect the output of the transfer controller to set the filter of the loading filtered inserters

Actions:

  • Analyze current delivery and set filters on each wagon
  • Output missing items to the filtered inserters

Troubleshootings

If something goes wrong, switch train with problems to manual mode. The train can be safely send to any YATM stations for unloading (they are ignored by YATN). Then send train to depot again.

Basic station setup blueprints

0eNrtHNuOmzj0V0Y8rpJZbG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ThMtAt7A3KmEWSpFZ0/IIUdAe92sZBp7VOArgrgJN8p8THEdO3vj7UImfEWoZl2HWkMlv1q17W541x1no2263zIGN6tttpV22yxjxOVZq32IpmftDhX3bJyqn6SpJ2fWO/CUipvFXu/J0/L97Rx83IvyWRekakJPfVQmK+z6X/hOkurx2s71B3iO71eYXQGXmdP51adN+gQjfPIJjc5XEzgQDl6DJqbHC7mcKAeegyaGxwuJghBBegxaG50uBghKcRwMUJUiDM0tLK67br+qL9ulL9yvk9/pRkF/4k2d8g4I9ovB+7t4P1efdDWDg8O08EadKNnTBA4UBdt0E2eMUEQYvLRBt3kGRMEISiE7UVICmF7EaJC2F6ErMAbO4Lnpp8YFlA6w/Z1+OaPmHBs4BETZk+UoCeW/jpRAnmihLkmMrnM7I5wyoBzZ4cE6EAKGF18TLrAQ/RXnewbBZMG+ri9/T54vxFwDKqhIGYPH/Egm0hgsnbHlDV4HxUFNksa6OM47EEPH6Ho9gjxxmRpAD7jAzj+1EAf13+ywRuM0JtSSDAiSw1uSiH+mHgT05tSGujjVIE+dCDFLUyCBzHh94cMZEScFispwflJOomUqS6WbeyKNHBemtsOmdCnX0yfdjLyiwvxlGRhpAY8IGUP3rfKtDo+emLVoez8vNXmBrzj/zQOfww=

Demonstration bases

A small base showing the basic setup

A medium sized base, initialy from factorio 1.1, showing the performance and stability
About 3000 SPM
Use builder stations, teleporter stations