Multi-Item Train Stations

Post all other topics which do not belong to any other category.
GoatsWithPants
Burner Inserter
Burner Inserter
Posts: 11
Joined: Mon Oct 21, 2024 3:35 pm
Contact:

Multi-Item Train Stations

Post by GoatsWithPants »

Anyone know of a way to do generic multi-item train stations with the new interrupt system? The only solutions I can think of involve defining a unique custom interrupt for every single station and each station's request, which would be thousands and thousands of interrupts.

I'm hoping there's an easier / more elegant way to approach the problem. I'm open to using circuits and combinators and wildcard signals, I just can't think of an implementation that works under the current system for multi-item stations.

Looking for ideas, thanks for the help!
Ranec1
Inserter
Inserter
Posts: 31
Joined: Sat Nov 02, 2024 3:12 pm
Contact:

Re: Multi-Item Train Stations

Post by Ranec1 »

Can you give an example of multi-items and expectations? I can think of a few different scenarios.

For example, are there multiple suppliers, destinations, trains per stop? Are all items used at all stops or will some empty without others? Should the train re-supply when any item is zero?
GoatsWithPants
Burner Inserter
Burner Inserter
Posts: 11
Joined: Mon Oct 21, 2024 3:35 pm
Contact:

Re: Multi-Item Train Stations

Post by GoatsWithPants »

Sure, I can clarify. I used to use cybersyn and I'm looking for a way to replace it using interrupts. I think I'll specify my ideal use case, but if that's not possible I'd be happy to hear alternative suggestions you have.


I would like to be able to request multiple item types at a single station. Each item would have a user-defined threshold that once it drops below, it requests one trainload of that item. The train limit for the station would be set based on number of active requests (if theres 3 trainloads of items needed, train limit = 3). Ideally, I would like my trains to be "generic pull-based", or all share one train schedule that fulfills request as they come up. There could be multiple suppliers, but for simplicity let's assume any suppliers of a single item type would all have the same name (iron provider, for example).

I think I know how to do "generic request-based trains" using the wildcard signals. This system requires stations to be named based on the item they request, eg "iron stop" and "copper stop". The problem is, if I want a station requesting multiple items called "iron + copper stop", I can't think of an easy way for the wildcard to assign a train this station without having a unique interrupt condition for slightly-different name.

I'm definitely open to different implementations of train systems based on what's possible. I'm playing overhauls with a large number of items needed at very low throughput, so my main goal is just to be able to set up train stations that can infrequently request many item types.

I hope that makes sense, and I really appreciate your time and help!
mergele
Fast Inserter
Fast Inserter
Posts: 173
Joined: Sat Aug 20, 2016 5:45 am
Contact:

Re: Multi-Item Train Stations

Post by mergele »

I think you would need the trains to go to the stop first and then pick up which item they are supposed to bring via circuit signal to set the stop from which to fetch it.
FunMaker
Fast Inserter
Fast Inserter
Posts: 107
Joined: Wed Jun 08, 2016 8:43 pm
Contact:

Re: Multi-Item Train Stations

Post by FunMaker »

You made my day. I posted a similar question in the Train Interrupt FFF and got no answer.
I feel building dedicated stations for products extremely space consuming.

The main problem with using wildcards is, that you can not place multiple icons in station names dynamically - might be capped at 2 icons imho (product in train wildcard and circuit wildcard).
Another problem is setting filters of the inserters at the provider station and lining this up with multiple trains arriving at the station. So you could reduce the train limit to 1...

In the current state it is too much of hassle to build such things and that disappoints me a bit.

I had hoped for additional train- circuit interaction. Something lile letting trains behave like modifyable comstant combinator: Read the combinator while at the station, set the combinator on leaving the station (on different wires) - this way you could put information in the train 'what to pick up'
Tertius
Filter Inserter
Filter Inserter
Posts: 921
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Multi-Item Train Stations

Post by Tertius »

The core problem to deliver different items with different trains to the same destination station is that you don't just have to communicate: "I need material" but additionally which material you currently need, so the corresponding train can be dispatched.

The interrupt destination selection works by constructing a station name, but you're unable to change station names at the station object on the fly, so you're unable to communicate the material this way. You need a second means to transfer the requested item info to the train, and it's still another crucial thing missing: To which destination station? If you name all destination stations the same, the train cannot know which one is the destination. So you need to name them differently, may be even each one to some unique name, but this leads to a mess, because this unique name must be transferred as well. Vanilla isn't able to support this kind of setup efficiently. For this, mods such as LTN and Cybersyn have been developed.

Alternatives for vanilla could be that instead of one destination station, you build multiple station objects directly one after another, so they share the unloading space, each named according to one of the possible materials to request.

Or you design trains that carry all materials, for example one wagon per material. In this case, all destination stations can have the same name, because all trains are able to deliver all materials.
FunMaker
Fast Inserter
Fast Inserter
Posts: 107
Joined: Wed Jun 08, 2016 8:43 pm
Contact:

Re: Multi-Item Train Stations

Post by FunMaker »

Naming a Train Station with Multiple Names might work for some part of the problem...
GoatsWithPants
Burner Inserter
Burner Inserter
Posts: 11
Joined: Mon Oct 21, 2024 3:35 pm
Contact:

Re: Multi-Item Train Stations

Post by GoatsWithPants »

Funmaker that's exactly the issue I was dealing with today; I was wanting to use the "any signal" wildcard to dynamically dispatch trains, but you can only change one variable in the train stop name using circuits, which feels very limiting. It's so close to being able to replicate cybersyns functionality, but it just barely falls short.

I thought about doing something like naming stations with every item they require (iron+copper+steel requester), and using wildcards and circuits to dynamically choose the target station. I could do it if there were more wildcards, or if the "anything" wildcard actually worked in train stop names.

You can currently add the wildcard signal "anything" to a train stop name, but it acts like a normal icon instead of a wildcard. I would love it if you could make an interrupt that said "go to iron-anything-anything requester", and it would target every station with iron+any icon+any icon in its name. This would fix my problem I think, and I made a feature request for it, but I think it's so niche that I don't have high hopes for it.

I think naming a train station multiple names would also be a solution to the problem... there's a lot of valid solutions here, but from what I've seen there's no way to do multi-item stations without crazy long interrupt schedules or tons of unique station names. It's a bummer.
testnewbie
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Nov 13, 2024 10:37 am
Contact:

Re: Multi-Item Train Stations

Post by testnewbie »

I feel like I am misunderstanding you and the others on a fundamental level, so to clarify for my different wired brain:

Do you want the same system I and I guess many others are using for orbital platforms?
My platforms take the items in, they are meant to take in, than they travel to other planets and the planets send their requests to the planetary hub. So once a platform arrives it delivers the requested items, if they are available. Now translated into trains&stations.

You want a trainstation that requests trains with ressources but instead of just iron ore, you want a range of items correct?
This would be easy, I assume. But you want to have multiple train stations, functioning like a request based orbital platform (doesn´t exist).
Multiple stations, with multiple items, defined by circuit network requests and satisfied by trains. That sounds pretty impossible. A proofed concept and not too far off (hopefully), would be central hub for everything. That central hub works as the brain. It knows how many items it has and how many trains it has. The "brain" will than process all the requests and send trains to the stations, requesting said things. If you´re using 1-1 trains, you can line up unload stations and have several stations in "one station". This would eliminate the "multiple stations" problem while kinda keeping your theme.

Pros:
  • A central hub for all resources that then get delivered to the production lines is the most efficient way to deliver things - given you´re not a base in a box.
    1-1 or 1-1-1 trains looks super neat and are pretty fast, while using less space and therefore giving you a lot of room to fill the rails.
    Trains!
    It worked in 1.0 and with SA and the new trains, it should work like a charm (working towards that, not there yet)
Cons: It can be a bit tedious to set it all up. But since I just have the concept in my head for 2.0, I can´t say if it´s super bad or not. Can´t imagine it being bad, since it was good pre SA.
GoatsWithPants
Burner Inserter
Burner Inserter
Posts: 11
Joined: Mon Oct 21, 2024 3:35 pm
Contact:

Re: Multi-Item Train Stations

Post by GoatsWithPants »

Essentially, in the overhaul I'm playing, some recipes need something like 30 ingridients. I'm looking for a system that allows me to avoid having to create 30 individual train stations for a recipe like this.

I think the system you described, of having a "brain" that can dispatch trains based on active requests is exactly what I'm trying to do. I thiiinnkk it's currently possible if only use single-item stations, but I'm hoping to cut down on the total number of stations needed, which is why I'm trying to figure out some kind of multi-item implementation.
thddx
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu Nov 14, 2024 3:16 pm
Contact:

Re: Multi-Item Train Stations

Post by thddx »

I put something together that sounds similar. I use it to supply my outposts with a large variety of items. It's simplistic and just a stop-gap solution until I make it better. Stock levels need to be set via the constant combinators. Each machine has descriptions. The receiving end uses a similar setup to only pull what's needed.

Tertius
Filter Inserter
Filter Inserter
Posts: 921
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Multi-Item Train Stations

Post by Tertius »

If you need to collect/deliver 30 different ingredients via train, I suggest you use a train that carries every ingredient. Use the wagon slot filter to reserve appropriate space in a wagon, for example in a 4 wagon train, carry ceil(30/4) = 8 ingredients per wagon, so reserve 6 slots for every ingredient. Then visit all loading stations one after another until the train visited them all and the train is supposed to be full. Or you distribute this to may be 4 convenient locations, collect 1/4 of the ingredients in the locations, load the corresponding subset at each location, and instead of one "Loading" station, create "Loading1", "Loading2", "Loading3", Loading4" and create 4 schedule entries one after another to fully load the train, then send it via interrupt either to some depot behind the 4th loading station or to the unloading station if it currently requires some ingredient.

Or instead of statically reserve slots, build a configurable train loader, similar to something I presented here: viewtopic.php?p=636620#p636620

With the approach of stations stacked one after the other, I found up to 8, perhaps 9 stations work very well. The difficult part is just to dynamically disable the inserters at the front, so they will not extract the train fuel.

out.mp4
(13.3 MiB) Downloaded 15 times
GoatsWithPants
Burner Inserter
Burner Inserter
Posts: 11
Joined: Mon Oct 21, 2024 3:35 pm
Contact:

Re: Multi-Item Train Stations

Post by GoatsWithPants »

Thank you for the suggestion, using a dedicated train for a 30-item station would definitely work. The issue is I want to avoid each station having a dedicated train, as my last save got up to something like 1500 train stops. These were able to be serviced by around 100 trains using cybersyn, I think having 1500 trains would be logistically and UPS-wise a struggle.

After giving it a lot of thought, I think I've come to the conclusion that vanilla trains are just too limited to do what I would like them to do, and I should just use cybersyn instead. I really wanted to try to get a cool, flexible train system working in vanilla, but I don't think they have all the tools to do what I want.

Thank you for your time and suggestions though, I really appreciate them! If Wube adds in more train functionality, I'll definitely revisit the idea, but until then I think mods are the only way to solve this problem (other than revisiting my train station design, but every station design I can think of has tradeoffs that I'm not willing to make, like requiring one train per station or an interrupt schedule with thousands of entries).
GoatsWithPants
Burner Inserter
Burner Inserter
Posts: 11
Joined: Mon Oct 21, 2024 3:35 pm
Contact:

Re: Multi-Item Train Stations

Post by GoatsWithPants »

Just in case anyone reading this thread is curious, if Wube allowed us to dynamically set target stations with circuit networks, this would solve my problem and allow for generic multi-item stations.

You can currently do this with wildcard train signals, but it only works for ONE variable in the train name, so you can't use it for multi stations with multiple items in the station name unfortunately.

I put in a feature request, so here's hoping something like that gets added in the future!
mergele
Fast Inserter
Fast Inserter
Posts: 173
Joined: Sat Aug 20, 2016 5:45 am
Contact:

Re: Multi-Item Train Stations

Post by mergele »

Heres your multi-item train station:


Edit: Cleaned up a bit and more importantly actually copied train station names.
GoatsWithPants
Burner Inserter
Burner Inserter
Posts: 11
Joined: Mon Oct 21, 2024 3:35 pm
Contact:

Re: Multi-Item Train Stations

Post by GoatsWithPants »

I'll check it out, thank you for the BP!
mergele
Fast Inserter
Fast Inserter
Posts: 173
Joined: Sat Aug 20, 2016 5:45 am
Contact:

Re: Multi-Item Train Stations

Post by mergele »

Actually scratch that, I made a big brain fart and built something both way overcomplicated and useless for your requirements, that still results in needing to make (at least) 1 train per 30 item input, plus adjusting their shedule, and a station name. And I messed up the train station names and the shedule in the blueprint too. Testing on to small a scale and to much chaos interference from the rest of the factory i built this in led me astray (plus a good bunch of not being thorough enough on my own part).
Edit: And experimenting and tinkering more has only shown me how uncooperative trains are when it comes to station names in interrupts. They don't take parameters or quality circuit signals. I am afraid I am (almost) out of ideas what else one might pursue to make the unload target station dynamic. (There is a spark of a faint idea using seed items, but I neither sure that would work, nor convinced it'd be worth the massive headache to get it do so.)
mergele
Fast Inserter
Fast Inserter
Posts: 173
Joined: Sat Aug 20, 2016 5:45 am
Contact:

Re: Multi-Item Train Stations

Post by mergele »

Well, I said and then I did it anyways. After a much more thorough testing this time heres version 2, one that actually works (as well as it is currently possible as far as I can tell). It probably won't solve 1500 stations, but it can support as many as there are items in the game, and maybe more. (When a train does a signal wildcard parameter replacement it picks in a consistent and fix order if multiple are available. The train stop needs 3 for administrative work, so if you can find out which are the lowest 3 you can have all the rest including recipies etc. for unloader station names. Currently I am using "Signals" signals which are after items at the very least.) And once you are through with all the signals you can just put a "2" behind the station names on your input and put down the same number of those for a second train to service.
Post Reply

Return to “General discussion”