RFC: New Train Interface (mix vanilla, LTN, Train Routes, ...)

This is the place to request new mods or give ideas about what could be done.
Post Reply
mrvn
Smart Inserter
Smart Inserter
Posts: 5710
Joined: Mon Sep 05, 2016 9:10 am
Contact:

RFC: New Train Interface (mix vanilla, LTN, Train Routes, ...)

Post by mrvn »

I'm thinking of making a mod for a new train interface that's a mix of existing ideas. So far it's just a collection of ideas how I would like to control my trains. If you have any ideas or comments feel free to add them.

First and foremost I think trains should not be limited to a fixed schedule. While sometimes you just want a train to blindly go from A to B to C this seriously limits trains when playing with Angels, Bobs, Py or other big mods. More flexibility is needed. I think some meta programming is needed so you don't control trains individual but can
  • control how many trains go to each station so they don't overflow the stacker
  • avoid the thundering herd problem
  • create a Route and assign trains to it in some form
  • create a Logistic Networks with producers and consumer
  • create a fueling station / fuel network
  • have rest stops where trains can idle
So lets go into specifics:
Tains
A train can be assigned to a Route or a Logistic Network. I think everything else follows from that. Although it should be possible to divert a train, to borrow it to go for a joy ride for example. Or to transport a one-time load of stuff from A to B.
Stations
Stations need a new interface to configure more options and have a number of add-ons. They are either built-in as hidden entities and just provide extra wire connections or as separate entities that can be placed next to the station. Probably the former. Every time a train enters (Rest Stops and Logistic Depots only) or leaves a station it can be redirected to a fueling station if it is low on fuel (global setting).

Generic options GUI tab:
  • The number of trains allowed to the station.
  • Acceptable train configurations. E.g. LCCC, LFFFL, LCCCLFFF
  • Storage configuration: e.g. 4 wooden chest per wagon, 1 warehouse per wagon. Used to compute remaining free space.
  • Inserter configuration: Type and number of inserters per wagon, e.g. 6x Fast Inserter. Used to compute loading times to detect stuck trains.
  • Previous (waypoint) station. Any train scheduled to go here would first go to the waypoint and limits of the waypoint station apply. Multiple stations can share a waypoint station allowing to build a shared stacker.
Fuel Station add-on / GUI tab:
  • The amount of available fuel must be set.
    Signals send to the Fuel Station add-on are taken as fuel amounts. When a train needs fuel this amount is checked and if the station has enough fuel to fill the train it becomes a viable fuel station.
  • A priority can be set. That way a refueling station with rocket fuel can be set as first choice and coal as second.
  • A number of tags can be set. A train can only refuel at a station if it has matching tags (from the Route or Logistic Network). Default, no tags, allows any train to refuel.
Storage add-on:
  • Stored item counts must be send to this via signal, i.e. connect the storage chests to this with a wire.
Manifest add-on:
  • Outputs the item counts expected on the train. Compare with train content to get item counts to load or unload. Used with arithmetic or comparator combinator to program (filter) inserters.
Logistic Station GUI tab: A list of entries each containing:
  • List of logistic networks (empty meaning all, default) this entry applies to.
  • Request, Provide
  • List of items with amount
  • Min/Max amount: e.g. 5-10 stacks, full fluid wagon. Used so a train isn't send for 5 coal. Or to limit how much of an expensive item a train can grab at once.
  • Priority. So "waste" byproducts can be used up first before falling back to produced items (e.g. slag in Angels).
or

Logistic Depot GUI tab:
  • Name of logistic network that can park it's trains here
  • List of items with count to preload
Routes
Routes are not bound to any entity and need their own global GUI. Each route has a schedule, a color (used for all trains in the route) and a list of trains assigned to the route.

Schedule: A list of stations with cargo manifest:
  • List of stations (usually just one)
  • List of items to have (or delta) with count or Min/Max
  • Rest stop?
  • Repeat?
This might look odd at first so let me give some examples. First the very basic and most common A-B transport:

Coal Mine: 10 stacks coal
Steam Plant: 0 <everything>, rest stop

A train is send to any station named Coal Mine when the station can fill 10 stacks. The train is then send to any station named Steam Plant till it is empty. Because it is a rest stop the train is send there regardless weather it can unload or not.

A more complex example with more stations:

Iron Smelter: + 2-10 stacks Iron Plate
Copper Smelter: + 4-20 stacks Copper Plate
Green Circuit: 0 <anything> (empty everything till one item runs out), Rest stop

A train with less than 8 stacks Iron Plates (minimum amount to load is 2) is send to the Iron Smelter to bring the train up to 10 stacks, otherwise that is skipped. If the train has less than 16 Copper Plates it is send to the Copper Smelter otherwise that is skipped. The train is then send to the Green Circuit station waiting for either Iron Plate or Copper Plate to run out. Because it is a rest stop the train is send there regardless weather it can unload or not.

And last an example for repeat:

Coal Mine: 100% coal
Copper Smelter, Iron Smelter, Steel Smelter: - 5-20 stacks Coal, repeat
Depot: Rest stop

A train is send to any Coal Mine that can fill it up to full. It then goes to any smelter that can unload at least 5 stacks but unloads at most 20 stacks and then repeats with another smelter if possible. When it can't repeat any more it goes to the Depot and waits for a Coal Mine to have enough coal again (it can skip the Rest stop).

Note: A stations in a route is skipped if the exit condition already applies. Except rest stops are not skipped if the train can't yet continue to any station after the rest stop. This ensures non-rest stop stations are always promptly vacated.
Logistic Networks
Logistic networks have a color, a list of trains assigned to that network, a list of rest stops and a list of stations that request or provide items. There should be a global GUI but that's just for monitoring. All the config is in the stations. Trains are assigned to a Logistic network by sending them to a Depot. The color can be set in any of the Depot stations and is copied to trains (and other stations when a delivery is scheduled?).

A Depot will halt a train till it has unloaded any extra items and starts loading if preload items are configured. Preload items makes a Depot a simple Rest Stop + Provider station. When a station requests goods that another station provides and all the constraints are matched an idle train is picked from one of the Depot stations and given a schedule to deliver said goods. After that it gets assigned a specific Depot station, not necessarily the one it left from but the same logistic network, honoring the station stacker and waypoint station settings (so each Depot station doesn't get more trains than it can hold). If the train has items left the Depot station picked will have enough storage space for the items.

Post Reply

Return to “Ideas and Requests For Mods”