Dynamic Rail Provider/Requester Setup
Dynamic Rail Provider/Requester Setup
All,
I have been searching for material on this, and it feels like there are no good solutions. There are a number of (overly complicated) setups for requester/provider circuit schemes, but they appear unnecessary and still do not provide the underlying functionality. I'm trying to understand if there is a way to solve this problem, and if there isn't - i'm trying to understand if this was intended or a problem with the 2.0 that will be fixed.
Summary of the problem:
What I can do:
I can setup dynamic train allocation pretty simply using the new interrupt system. For example, lets hypothesize this simple setup
Three interrupts programed in trains. Assume for now we are talking boxcar trains and boxcar materials:
Provider Stations - Name: 'Provider' / circuit activates station when it has sufficient materials to provide or circuit decides its time to offer for providing. Any free train can leave depot (condition empty) to head to the provider station to pickup. When loaded it sits, fully loaded, waiting for a delivery opportunity.
Associated Interupt - 'Pickup'. Targets any station named 'Provider'
Requester Stations - name '[type] Requester' / circuit activates teh station when it needs materials or some other circuit otehrwise activates request. Any train loaded with correct material leaves the provider station it previously loaded at to dropoff.
Associated Interupt - "[wildcard Bulk] Requester' . The train replaces Bulk wildcard with the material in its inventory, thus matching the station name. For example, a [Iron Ore] Requester station will be serviced by a train carrying iron ore using the [Wildcard Bulk] Requester station ID.
Depot - third station type and interupt (set to interupt interupts) that when cargo is empty and has no other station to go to, it returns to the depot (where it can also be refueled).
All of this works and is fucntionally great.
--- What i CANT do:
Either the [wildcard SIGNAL] type is broken, or i dont correctly understand its functionality. I would love to see more detail written on how this works. What i would like to do is setup a dynamic requester station. FOr example, lets say i had a station that offloaded into provider chests that the logistic network then exfilled. High value low quantity items. Lets say Blue circuits and Rocket fuel. I would like the same station to ask for Blue circuits when the circuit network says i need more of them, and take in rocket fuel when i need more of them. I dont need the same train to carry both, but i want the same station to service either.
Intuitively the way to solve this would be to rename the station type from '[Blue circuit] Requester' to '[wildcard Circuit] Requester'. I presume what should happen is if i feed in a request for something (e.g. Blue circuits) via the circuit network into the depot, the wildcard circuit should substitute Blue circuits in the wildcard slot, and then a train (already existing with the already existing interupt targeting station ' [wildcard Bulk] Requester' should, if its carrying blue circuits, trigger on that interupt.
What Happens if i try this:
Instead, the interupt never triggers. The train says 'no depot found'. However, if i manually trigger the interupt, it works as i expect, and the train moves to teh correct station. So its as if some of the functionality exists, but i need to trigger the interupt constantly to 'reset' the system into finding the right station.
I'm thinking if there is a way to add a heartbeat (which i havent figured out yet) so every train checks every second for an update, it might work, but as i said i haven't rigure that out.
so
1) Has anyone solved this problem
2) how do [wildcard circuit] pointers work and why can't they be used with stations (or what should i do differently)
Thanks
-Shaftoe
I have been searching for material on this, and it feels like there are no good solutions. There are a number of (overly complicated) setups for requester/provider circuit schemes, but they appear unnecessary and still do not provide the underlying functionality. I'm trying to understand if there is a way to solve this problem, and if there isn't - i'm trying to understand if this was intended or a problem with the 2.0 that will be fixed.
Summary of the problem:
What I can do:
I can setup dynamic train allocation pretty simply using the new interrupt system. For example, lets hypothesize this simple setup
Three interrupts programed in trains. Assume for now we are talking boxcar trains and boxcar materials:
Provider Stations - Name: 'Provider' / circuit activates station when it has sufficient materials to provide or circuit decides its time to offer for providing. Any free train can leave depot (condition empty) to head to the provider station to pickup. When loaded it sits, fully loaded, waiting for a delivery opportunity.
Associated Interupt - 'Pickup'. Targets any station named 'Provider'
Requester Stations - name '[type] Requester' / circuit activates teh station when it needs materials or some other circuit otehrwise activates request. Any train loaded with correct material leaves the provider station it previously loaded at to dropoff.
Associated Interupt - "[wildcard Bulk] Requester' . The train replaces Bulk wildcard with the material in its inventory, thus matching the station name. For example, a [Iron Ore] Requester station will be serviced by a train carrying iron ore using the [Wildcard Bulk] Requester station ID.
Depot - third station type and interupt (set to interupt interupts) that when cargo is empty and has no other station to go to, it returns to the depot (where it can also be refueled).
All of this works and is fucntionally great.
--- What i CANT do:
Either the [wildcard SIGNAL] type is broken, or i dont correctly understand its functionality. I would love to see more detail written on how this works. What i would like to do is setup a dynamic requester station. FOr example, lets say i had a station that offloaded into provider chests that the logistic network then exfilled. High value low quantity items. Lets say Blue circuits and Rocket fuel. I would like the same station to ask for Blue circuits when the circuit network says i need more of them, and take in rocket fuel when i need more of them. I dont need the same train to carry both, but i want the same station to service either.
Intuitively the way to solve this would be to rename the station type from '[Blue circuit] Requester' to '[wildcard Circuit] Requester'. I presume what should happen is if i feed in a request for something (e.g. Blue circuits) via the circuit network into the depot, the wildcard circuit should substitute Blue circuits in the wildcard slot, and then a train (already existing with the already existing interupt targeting station ' [wildcard Bulk] Requester' should, if its carrying blue circuits, trigger on that interupt.
What Happens if i try this:
Instead, the interupt never triggers. The train says 'no depot found'. However, if i manually trigger the interupt, it works as i expect, and the train moves to teh correct station. So its as if some of the functionality exists, but i need to trigger the interupt constantly to 'reset' the system into finding the right station.
I'm thinking if there is a way to add a heartbeat (which i havent figured out yet) so every train checks every second for an update, it might work, but as i said i haven't rigure that out.
so
1) Has anyone solved this problem
2) how do [wildcard circuit] pointers work and why can't they be used with stations (or what should i do differently)
Thanks
-Shaftoe
Re: Dynamic Rail Provider/Requester Setup
The wildcards function like this: Whenever a train is about to leave a station, the interrupts are checked. If during this check a wildcard is detected in a trigger condition, the currently loaded cargo is checked. If there is cargo, the wildcard is replaced with that cargo.
If there is no cargo loaded, the wildcard is not replaced and the corresponding interrupt is skipped. For replacement, the wildcard doesn't check and match stuff in any station or circuit connection, it matches stuff currently loaded in the cargo wagons.
It meant to give a train some kind of identity. An empty train doesn't have any identity. It could be loaded with anything. Once something is loaded into a train, it can be given the identity "this is an iron ore train, so go to the iron ore dropoff" by matching the wildcard. Once the train is unloaded and empty, it loses this identity again.
If there is no cargo loaded, the wildcard is not replaced and the corresponding interrupt is skipped. For replacement, the wildcard doesn't check and match stuff in any station or circuit connection, it matches stuff currently loaded in the cargo wagons.
It meant to give a train some kind of identity. An empty train doesn't have any identity. It could be loaded with anything. Once something is loaded into a train, it can be given the identity "this is an iron ore train, so go to the iron ore dropoff" by matching the wildcard. Once the train is unloaded and empty, it loses this identity again.
Re: Dynamic Rail Provider/Requester Setup
Understood - but none of that really answers the question or explains the behavior.
For example, if i have a train with a '[bulk wildcard] Requester' station tag, the moment iron ore enters the car, it becomes an '[iron ore] Requester' station tag. When the interupt condition is finished (e.g. it loads a full load of iron ore) it looks for a station with the name '[Iron ore] Requester' that meets conditions (e.g. is available).
So taking that example, exactly as you described it, if i now have a station named '[Signal Wildcard] Requester', and the signal changes the wildcard to '[Iron Ore] Requester' - the above example should still work right? Except it doesnt - the train can't find the station
But its not even that simple
Because if you manually trigger the interupt, it DOES find the station. it just doesnt find it without a manual trigger.
The problem isn't hte wildcard on the train - its the wildcard on the station - it does not appear to be working correctly, or at least intuitively.
For example, if i have a train with a '[bulk wildcard] Requester' station tag, the moment iron ore enters the car, it becomes an '[iron ore] Requester' station tag. When the interupt condition is finished (e.g. it loads a full load of iron ore) it looks for a station with the name '[Iron ore] Requester' that meets conditions (e.g. is available).
So taking that example, exactly as you described it, if i now have a station named '[Signal Wildcard] Requester', and the signal changes the wildcard to '[Iron Ore] Requester' - the above example should still work right? Except it doesnt - the train can't find the station
But its not even that simple
Because if you manually trigger the interupt, it DOES find the station. it just doesnt find it without a manual trigger.
The problem isn't hte wildcard on the train - its the wildcard on the station - it does not appear to be working correctly, or at least intuitively.
Re: Dynamic Rail Provider/Requester Setup
It's not as you wrote. It seems you assume the wildcards have a meaning while the temporary schedule exists and is being processed, but this is not the case.
Imagine you're the train. You don't know what you carry. You're just the locomotive with some unknown wagons. You're at a station, sleeping and waiting for station processing to finish.
You wake up and want to go to the next station.
To determine the next station, you check your schedule. First, you remove any temporary entries that are finished. If there are still any temporary entries present as next schedule, resulting from some previous interrupt, you use them and drive there (this happens if an interrupt adds more than 1 station to the schedule).
Otherwise, you check your interrupt list. You check the interrupt condition for each interrupt.
While looking through all conditions, if you encounter one of the green wildcards, you look into your wagons and check the corresponding cargo type. If you find the same type of cargo as the wildcard demands (item, fluid, fuel, circuit condition), you substitute the wildcard with the cargo you found. If you found iron ore in your wagons, you substitute iron ore wherever you find this wildcard in the corresponding interrupt definition. If all interrupt conditions for some interrupt are true, you decide to copy the corresponding schedule entries into your regular schedule, and the crucial thing is you're copying the entries not with the wildcard but instead you copy a substituted version. So if you have a schedule with "[wildcard] unload", and you substituted [iron ore] before, you actually copy this schedule as "[iron ore] unload", not as "[wildcard] unload". You (the player) need to make sure that after the wildcard substitution the resulting station name is actually present on your map.
After this copy job, you immediately forget that you have iron ore loaded, and you forget the cargo-to-wildcard assignments you made.
Now you check the temporary entry you just created. You find the destination "[iron ore] unload", so you drive there.
The same substitution at copy time takes place for the waiting conditions associated with the destination stations. You substitute only in the moment when you check the interrupts and create the temporary schedule. Afterwards, the temporary schedule looks as if it was created with the substituted value in the first place and there was never any substitution.
If this is not what you asked, please post screenshots of station names, schedules and interrupts that show the names and entries and wildcards you have issues with.
Imagine you're the train. You don't know what you carry. You're just the locomotive with some unknown wagons. You're at a station, sleeping and waiting for station processing to finish.
You wake up and want to go to the next station.
To determine the next station, you check your schedule. First, you remove any temporary entries that are finished. If there are still any temporary entries present as next schedule, resulting from some previous interrupt, you use them and drive there (this happens if an interrupt adds more than 1 station to the schedule).
Otherwise, you check your interrupt list. You check the interrupt condition for each interrupt.
While looking through all conditions, if you encounter one of the green wildcards, you look into your wagons and check the corresponding cargo type. If you find the same type of cargo as the wildcard demands (item, fluid, fuel, circuit condition), you substitute the wildcard with the cargo you found. If you found iron ore in your wagons, you substitute iron ore wherever you find this wildcard in the corresponding interrupt definition. If all interrupt conditions for some interrupt are true, you decide to copy the corresponding schedule entries into your regular schedule, and the crucial thing is you're copying the entries not with the wildcard but instead you copy a substituted version. So if you have a schedule with "[wildcard] unload", and you substituted [iron ore] before, you actually copy this schedule as "[iron ore] unload", not as "[wildcard] unload". You (the player) need to make sure that after the wildcard substitution the resulting station name is actually present on your map.
After this copy job, you immediately forget that you have iron ore loaded, and you forget the cargo-to-wildcard assignments you made.
Now you check the temporary entry you just created. You find the destination "[iron ore] unload", so you drive there.
The same substitution at copy time takes place for the waiting conditions associated with the destination stations. You substitute only in the moment when you check the interrupts and create the temporary schedule. Afterwards, the temporary schedule looks as if it was created with the substituted value in the first place and there was never any substitution.
If this is not what you asked, please post screenshots of station names, schedules and interrupts that show the names and entries and wildcards you have issues with.
Re: Dynamic Rail Provider/Requester Setup
You are not understanding my question, I give up - after extensive searches of the forums/reddit/etc. seems noone has solved this problem.
A simplified question:
Has anyone come up with a method to dynamically request different materials to be dropped at the same train station via the circuit network. E.g. I request item A, and then later, i request Item B, via the same train station, with the same train station name.
Thanks
S
A simplified question:
Has anyone come up with a method to dynamically request different materials to be dropped at the same train station via the circuit network. E.g. I request item A, and then later, i request Item B, via the same train station, with the same train station name.
Thanks
S
Re: Dynamic Rail Provider/Requester Setup
Have a separate interrupt for each cargo type.Shaftoe wrote: ↑Thu Nov 07, 2024 12:52 am You are not understanding my question, I give up - after extensive searches of the forums/reddit/etc. seems noone has solved this problem.
A simplified question:
Has anyone come up with a method to dynamically request different materials to be dropped at the same train station via the circuit network. E.g. I request item A, and then later, i request Item B, via the same train station, with the same train station name.
Thanks
S
multidrop not full AND
Cargo "processing units" > 0 AND
Signal "Processing units" > 0
goto multidrop
wait till cargo empty
Add another for each other type of resource.
Have multidrop send a circuit signal to every train stop where a full and available train for that resource could wait with the resource it needs.
Last edited by Zanthra on Thu Nov 07, 2024 2:04 am, edited 1 time in total.
- AileTheAlien
- Filter Inserter
- Posts: 351
- Joined: Sat Mar 11, 2017 4:30 pm
- Contact:
Re: Dynamic Rail Provider/Requester Setup
They want a generic interrupt. See my answer below.
This sounds just as complicated, but I'm also still sick. I was thinking about how to solve this problem while walking my dog and while getting hamburgers, and I think you could do it with a circuit network shared by radar, across all of your trains. I think you want the supply station to use a signal to know what destination to send its current train to. That train needs an interrupt with a generic signal, that is filled in with an icon for the specific destination. (Similar to this other thread.) Your destination stations need names that include a unique icon. Maybe the train station on the west is "[lab icon] [number one icon]", the one on the east is "[lab icon] [number two icon]", and you have many different locations manufacturing electric smelters named like "[electric smelter icon] [assembler icon] [number one icon]", ... "[electric smelter icon] [assembler icon] [number nine icon]". (They're all used for purple science.) Then you'd know specifically that your labs are handled by science, and you use a signal for red bottles, green bottles, etc, to send to either lab. You'd use a signal for red circuits, stone bricks, and steel, to fill up the place assembling electric smelters. I think you could also have more than one train inbound to a destination, but you'd have to be careful with sending only one train per ingredient. You could send an arbitrary number of them, but trains already have lots of cargo space, and you can just send another one in thirty seconds or something. Hopefully this is what you want! I know it's more advanced than my current factory, where I just have separate tracks and separate 1-1 trains for iron plates, copper plates, oil, all going into my centralized base. I haven't cleared enough space of trees and biters, to make anything with shared train-tracks and intersections.Shaftoe wrote: ↑Thu Nov 07, 2024 12:52 amA simplified question:
Has anyone come up with a method to dynamically request different materials to be dropped at the same train station via the circuit network. E.g. I request item A, and then later, i request Item B, via the same train station, with the same train station name.
Last edited by AileTheAlien on Thu Nov 07, 2024 2:09 am, edited 1 time in total.
Re: Dynamic Rail Provider/Requester Setup
I was answering the simplified question which had no requirements for generic interrupts or wildcards.
Re: Dynamic Rail Provider/Requester Setup
Ah, THIS is the question. You should have asked this way in the first place.Shaftoe wrote: ↑Thu Nov 07, 2024 12:52 am Has anyone come up with a method to dynamically request different materials to be dropped at the same train station via the circuit network. E.g. I request item A, and then later, i request Item B, via the same train station, with the same train station name.
Unfortunately, there is no easy or straightforward solution. Because of questions like this, mods like LTN or Cybersyn have been developed.
This is because the requester has to provide the information: "I need a train" and "I need material x", and there might be different requester stations requesting different materials all at the same time. So if there is a train with one material, there must be a way to give him as destination exactly the one station that requests this material. However, if you have multiple requester stations with the same name (as it is probably the case for unified rail/train setups), and you have 2 requester stations with pending requests, one for this material and the other for a different material, the train cannot decide to which station to go. Both have the same name after all.
It's not possible to dynamically change the name of a station on the station item, otherwise you could dynamically set the requested material as name. So all your requester stations always have the same name, and your trains can never differ between them.
The most easy approach to solve this dilemma is to build requester stations for one material only. Don't use universal requester stations. Instead, use one for one material only. This way you can have the material name in the station name, so you can use the interrupts. The FFFs discussing the interrupt system assume this setup.
The next less easy approach is to create the material mix in the provider station and have your trains always carry all materials. For example one wagon for one material. However, now you need to provide all materials at the provider stations.
Even less easy is if you go for a mixed train but want your mixed train being loaded on different provider stations. You cannot use the same station name for all your provider stations, because with all the same name you cannot know where to send the train to load some specific material. To identify which station provides which material, you need to create material specific station names. You loose some of the universalism provided by interrupts, but that's a way. In every station, you read the train and at the same time send the circuit signals to the train. A circuit computes the difference between actual train content and wanted train content, so the missing material is appearing as negative.
In the interrupts, you can use the green signal wildcard to check for these circuit-provided signals. You can check for [signal wildcard] < 0 as interrupt condition and build the corresponding loading station name with the [signal wildcard] in the schedule template like this: This requires you to build a corresponding combinator circuit on all stations your train is supposed to visit. If there is a station without circuit connection or without "send to train", any interrupt is skipped that has a signal condition.
There are more approaches, more direct and static, without interrupts. For example, you could name all your provider stations with the material it contains and create a static schedule that makes the train first visit all provider stations one after the other to completely fill the train, then as last static entry you provide the requester station. So full trains will wait at the last provider station, then drive to the first requester station that opens up one train limit.
If you ask me what I would do to solve all this, I would go for "one train for one material, every station has its dedicated material". If space constrained and it's absolutely impossible to build enough distinct requester stations, I would go for mixed trains and perhaps try to implement the approach with the screenshot, but I'm not sure if it will really work out. I only posted quick research, I didn't fully implement this yet.
There's another idea. You can put stations directly one after another. I mean the 2x2 station items you put down on the map. This way their loading/unloading area overlaps and they (mostly) share the same inserters/buffer chests. This way each of these stations can be named and activated/deactivated differently and be given one material as name, and the whole contraption requires less space than multiple different complete stations.
Re: Dynamic Rail Provider/Requester Setup
Thanks for the detailed answer. to your first point, thats already what i do for major materials that i need in large quantities - single requester stations dedicated to, for example, copper plates.
The single station multi request question is related to things that i need significantly less of - trying to reduce the footprint of the offloading stations by using one station for multiple purposes linked to the requester chests. I used to do this with LTN, but i was hoping with space age functionality i could do it without mods (and my first playthrough is without mods). So in the end, last night, i came to the solution you posted at the end. Essentially a long straight track with a station every 6 blocks, with 4 active provider chests in between. And then each station requesting a unique resource as described above.
Graphically - Station= s, chest = c
SSCCCCssCCCCssCCCC... etc
This works great, so its what i'm using now, but it feel inelegant and ugly, so i still don't love it (but i'll live with it!)
Thanks
-Greg
PS - to Aile's response,
Yes i considered a solution like that, but the problem is that you are now not really using dynamic station allocation - you are using a bunch of unique identifiers and that does not scale indefinitely. Its a worse fix than the one described above. However, to your solution, i do think i plan to implment a variation on that. To replace the LTN functionality of desiring MIXED GOODS (for example, if i have a distant outpost that needs walls, laser turrets, construction bots, and repair kits - just for automated defense maintenance) - then i can setup an infinite number of stations with the same name (e.g. Defense Requester), linked to requester chests. I can activate any given station when the parts run low. And then back at my main mall, i can have a train stop called Defense provider thats linked to a requester chest that asks for those parts. When the chest is correctly loaded, i can activate the station. As soon as a defense requester pings active because its part count is low, off the supplies go. Its still ugly, in that its not truly dynamic - I can't change the specific part request based upon arbitrary circuit network inputs - at least it scales infinitely.
-S
The single station multi request question is related to things that i need significantly less of - trying to reduce the footprint of the offloading stations by using one station for multiple purposes linked to the requester chests. I used to do this with LTN, but i was hoping with space age functionality i could do it without mods (and my first playthrough is without mods). So in the end, last night, i came to the solution you posted at the end. Essentially a long straight track with a station every 6 blocks, with 4 active provider chests in between. And then each station requesting a unique resource as described above.
Graphically - Station= s, chest = c
SSCCCCssCCCCssCCCC... etc
This works great, so its what i'm using now, but it feel inelegant and ugly, so i still don't love it (but i'll live with it!)
Thanks
-Greg
PS - to Aile's response,
Yes i considered a solution like that, but the problem is that you are now not really using dynamic station allocation - you are using a bunch of unique identifiers and that does not scale indefinitely. Its a worse fix than the one described above. However, to your solution, i do think i plan to implment a variation on that. To replace the LTN functionality of desiring MIXED GOODS (for example, if i have a distant outpost that needs walls, laser turrets, construction bots, and repair kits - just for automated defense maintenance) - then i can setup an infinite number of stations with the same name (e.g. Defense Requester), linked to requester chests. I can activate any given station when the parts run low. And then back at my main mall, i can have a train stop called Defense provider thats linked to a requester chest that asks for those parts. When the chest is correctly loaded, i can activate the station. As soon as a defense requester pings active because its part count is low, off the supplies go. Its still ugly, in that its not truly dynamic - I can't change the specific part request based upon arbitrary circuit network inputs - at least it scales infinitely.
-S
Re: Dynamic Rail Provider/Requester Setup
If it comes to this, i. e. relatively small amount of manufactured items from the mall, I have a special solution. A loader station collects items via logistics network from the mall, then loads a predefined set of items into the train. Each wagon set is defined with a constant combinator.
The corresponding unloading station also has one constant combinator for each wagon and defines the item to unload to this station. The unloaded items are provided to the local logistics network and are thus available for something like defense wall maintenance, for example.
The unloading station computes the difference between current stock and demand from the constant combinators, then calls a train (increase train limit to 1) and unloads what is missing.
There is also garbage collection. The unloading station collects items not in the wagon definition into a special chest, which is emptied into a trash wagon. This trash wagon is then emptied at the loading station and the items return into the big storage pile of the mall.
This is not easily described in a post, since the corresponding combinator setup is somewhat complex. The loading station is simple (2 combinators + 2 combinators per wagon), but to compute the trash and to determine when to request a train by an unloading station is demanding (8 combinators + 2 combinators per wagon). This setup is able to use train interrupts.
If you're interested I can post blueprints.
-
- Manual Inserter
- Posts: 1
- Joined: Sun Nov 17, 2024 9:17 pm
- Contact:
Re: Dynamic Rail Provider/Requester Setup
Not much help here, but I think you're describing the same issue i've also been looking to find a solution for, or even just confirmation that this it's supposed to work like this. We have f.e. Item Signal on Train Interrupts and they are replaced with the actual item from the cargo, but then when using it as a fixed Depot (where it should definitely use it but it doesn't). Or in a station name, where i would assume it to use the first circuit that comes in, it doesn't.
I designed some nice circuit logic and unloaders to have multi receiving station with room for 4 blue belts from 1 item and 2 blue belts from another item but alas it seems that it doesn't work like that It seems weird to even offer to use those signal parameters on stations if they don't do anything, but not allow them on things like inserters e.t.c. why allow them on stations then?
Situation: Schedule: Signal to Station: Station:
I designed some nice circuit logic and unloaders to have multi receiving station with room for 4 blue belts from 1 item and 2 blue belts from another item but alas it seems that it doesn't work like that It seems weird to even offer to use those signal parameters on stations if they don't do anything, but not allow them on things like inserters e.t.c. why allow them on stations then?
Situation: Schedule: Signal to Station: Station:
- Attachments
-
- 11-17-2024, 22-32-30.png (1.71 MiB) Viewed 195 times