LTN - Logistic Train Network - Manual
Posted: Thu Jul 20, 2017 6:26 am
Description:
Adds logistic-train-stops acting as anchor points for building a fully automated, train logistic network.It can handle all possible train configuration. Just send all trains to depots and LTN will pick the best suitable train for a job.
LTN cuts the amount of rolling stock required to run a megabase down to 30% or less.
License: private use only, no modification, no redistibution, no commercial use
Source: GitHub
Download: Mod Portal
Changelog Mod Portal
Demo Map:
Small map running 5 trains in nearly realistic fashion. Showcasing station designs from simplistic 1 combinator to depots using train compositions and a truly universal provider/requester station.Designs for stations, depots, control circuits and more can be found in the Design thread.
Video Tutorials:
https://youtu.be/U-TXRNQzL-UBasic Tutorial by Nilaus. A little aged and long winding, still mostly correct.
https://youtu.be/a3ujEdPfGHk
Basic Tutorial by Tuplex. He quickly goes into filtered providers station setup, sadly not filtered requester.
https://youtu.be/ZtcKlNous9o
Tutorial by Diablo, going more into mod settings and signals.
Note: Some things in this are wrong, see Kyoko's post for a corrected information.
Long Description:
Inspired by ideas in this thread thread I sat down and wrote this as proof of concept.Big thanks to Choumiko. Seeing how certain things work in Smarter Trains and Rail Tanker made writing this mod a whole lot easier.
This mod adds one new train stop "logistic-train-stop" acting as anchor points for building a train powered logistic network.
Stops consist of 3 entities, the stop itself and the automatic placed lamp (input) and yellow constant combinator (output).
Stop: (behaves like base stop)
- read from train enable by default
- send to train enabled by default
Constant Combinator: (signal output)
- train composition: position of wagons & locomotives in parked train (all stops)
binary encoded signal of train composition up to 31 carriages with lsb at the train stop. More information about binary encoding here - Expected train inventory after un-/loading is complete. (only Requester & Provider)
Lamp: (color coded status)
Values can only be read through green wire.
- green = 1: normal status
- blue = n: LTN Controlled Train parked at stop, n = number of trains
- yellow = n: Stop is part of a scheduled delivery, n = number of trains
- white = 1: Error - not initialized
- red = 1: Error - short circuit
- red = 2: Error - deactivated stop
- pink = 1: Error - duplicate station name (deprecated in 0.13.0)
All Stops:
Encoded Network ID - Binary coded signal assigning a stop to specific networks. (defaults to 0xFFFFFFFF = all networks)
Deliveries are only generated when between Depot, Provider, Requester within the same network. Stops can be assigned to multiple networks e.g. 6 assigns a stop to networks 2 and 4.
Depot: (ignores Requester & Provider signals)
Stop is Depot - flags this stop as depot (default=0 false)
Depot Priority (optional) - higher priority will be served first (default=0)
Requester & Provider:
provided items (positive number) and requested items (negative number)
minimum train length (optional) - minimum length of locos + wagon allowed in this station (default=0 no limit)
maximum train length (optional) - maximum length of locos + wagon allowed in this station (default=0 no limit)
limit trains (optional) - number of trains (deliveries) allowed simultaneously at this station (default=0 no limit)
Requester:
Request Threshold (optional) - Missing amount of items/fluids triggering a delivery. (global default=1000)
Request Stack Threshold (optional) - Missing amount of item stacks triggering a delivery. Takes priority over Request Threshold.
Request Priority (optional) - higher priority will be served first (default=0)
Disable Warnings (optional) - Suppresses warnings, like no station supplying x found, for this Requester. (default=0 false)
Provider:
Provide Threshold (optional) - Amount of items/fluids required to act as provider. (global default=1000)
Provide Stack Threshold (optional) - Amount of item stacks required to act as provider. Takes priority over Provide Threshold.
Provider Priority (optional) - higher priority will be used first (default=0)
Locked Slots per Wagon (optional) - number of inventory slots per wagon locked for this provider (default=0 false)
Thresholds:
Odhrean made this graph depicting what delivery size is used depending on thresholds and train size in a setup with 1 requester and 1 provider using L-4C trains.Mod Settings:
Message levelDetail level of in game messages.
0: Off No messages will be generated.
1: Errors & Warnings Print only errors and warnings.
2: Notifications (default) Print basic information like missing resources or generating deliveries.
3: Detailed Messages Print detailed information about finding providers and trains.
Message filter timeout (ticks)
Message age in ticks before filtered messages are shown again. default = 18000
Enable debug log
Write debug information to /Factorio/factorio-current.log.
Dispatcher Enabled
Deactivating Dispatcher stops delivery generation. Item levels will still be monitored.
Update frequency (ticks)
How fast stops and requests are updated. Higher numbers improve performance by spreading out updates over more ticks. When set > 1 forces Updates per tick to 1.
Updates per tick
Limits the number of stops and requests updated per tick. Lower numbers increase performance. Ignored when Update frequency > 1.
Request Threshold
Missing amount of items/fluids triggering a delivery. Can be overridden with signal at requesting stops. default = 1000
Provide Threshold
Amount of items/fluids required to act as provider. Can be overridden with signal at providing stops. default = 1000
Schedule circuit conditions
Adds circuit conditions to wait for red = 0 OR green ≥ 1 to all stops. Warning: All LTN stops require having "send to train" enabled and a circuit connection. Otherwise trains will be stuck waiting forever. default = false
Depot inactivity (sec)
Duration in seconds of inactivity before trains leave the depot. default = 5
Stop timeout (sec)
Duration in seconds before trains are forced out of a station. 0 deactivates this feature. default = 120
Delivery timeout (sec)
Duration in seconds deliveries can take before assuming the train was lost. default = 600 (10min)
Delivery completes at requester
False: (default) Delivery and schedule are reset when train arrives at depot. Changes to trains parked at requesting stops have no effect.
True: Delivery and schedule are reset when train leaves requester. Changes to trains parked at requesting stops will remove delivery and reset schedule.
Finish loading
True: (default) Prevents trains from leaving while inserters/pumps are working by adding 2s inactivity condition.
False: Trains will leave immediately when all items have been loaded. Inserters at loading stations will get stuck.
Depots reset filters
True: (default) Cargo wagons have their filters and stack limitations cleared when entering a depot.
Depot fluid removal limit
Maximum amount of fluid per wagon automatically destroyed when entering depots. default = 0 (disabled)
Default network ID
Network ID used for stops without "Encoded Network ID" signal. default = -1 (any)
Providers output existing cargo
Cargo inside train when arriving at provider is shown in LTN Output. Includes items from inserters holding items on tracks. default = true