Smart Train Deliveries with Combinator Magick [0.13/0.14]

This board is to show, discuss and archive useful combinator- and logic-creations.
Smart triggering, counters and sensors, useful circuitry, switching as an art :), computers.
Please provide if possible always a blueprint of your creation.
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by siggboy »

sethcor wrote:If i want multiple drop off locations for the same resource do i need to name them each differently rather than having them all named the same? I am loving this system so far, took a bit to set it up though. so many little things can go wrong, though it is mostly involving powering a station before it is completely built.
All stations have different names. The only exception is the depot stations, if you have multiple lanes (all lanes have the same name).

If several requesters take the same resource, the system will take care of that.

Regarding the setup: the worst case is that you need to reset the register at the station. When you set up a new station, always take the same order of (1) blueprint (2) smart trains (3) configure (4) wire/power.
sethcor wrote:I had it working but now it is not sending trains to the requester after it picks up its ore. instead it continues the scheduled as if it was a normal train until i returns to the depot. if i send trains to the requester it will send them back to the depot.
Check the condition on the lamp, if it's missing or wrong then your provider will not be able to tell the train where to go.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Smart dynamic train deliveries with combinator Magick [0.13]

Post by siggboy »

HiddenWolf wrote:However, I can't even get your new depot and provider/requester circuits to work in a simple creative mode loop.
One thing that I noticed is that in neither blueprint, the station combinator is hooked up to anything. I've got green, D and S on the bus, and nothing else.
I think the "instant blueprint" feature of Creative Mode does not place the blueprints correctly. It's because the SmartTrains mod does place some "proxy objects" (the combinator and the lamp).

Try to place the blueprints with robots, and turn off the instant blueprinting.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

sethcor
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Oct 21, 2016 8:12 am
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by sethcor »

siggboy wrote:
sethcor wrote:If i want multiple drop off locations for the same resource do i need to name them each differently rather than having them all named the same? I am loving this system so far, took a bit to set it up though. so many little things can go wrong, though it is mostly involving powering a station before it is completely built.
All stations have different names. The only exception is the depot stations, if you have multiple lanes (all lanes have the same name).

If several requesters take the same resource, the system will take care of that.

Regarding the setup: the worst case is that you need to reset the register at the station. When you set up a new station, always take the same order of (1) blueprint (2) smart trains (3) configure (4) wire/power.
sethcor wrote:I had it working but now it is not sending trains to the requester after it picks up its ore. instead it continues the scheduled as if it was a normal train until i returns to the depot. if i send trains to the requester it will send them back to the depot.
Check the condition on the lamp, if it's missing or wrong then your provider will not be able to tell the train where to go.
Which one, the ones at the providers stating a train is being requested or do you mean the ones attached to the smart train stops? I am assuming the one on the train stop itself based on the smart train stops and how they work.

They are all there and look to be connected right. I used the blueprint you linked not to long ago and altered it a bit by removing the circuit meant for giving the inserters a item filter, i also have a copy of an older one that i have tried using, its main circuit looks the same as the the multi item one.

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by siggboy »

sethcor wrote:
siggboy wrote:Check the condition on the lamp, if it's missing or wrong then your provider will not be able to tell the train where to go.
Which one, the ones at the providers stating a train is being requested or do you mean the ones attached to the smart train stops? I am assuming the one on the train stop itself based on the smart train stops and how they work.

They are all there and look to be connected right. I used the blueprint you linked not to long ago and altered it a bit by removing the circuit meant for giving the inserters a item filter, i also have a copy of an older one that i have tried using, its main circuit looks the same as the the multi item one.
It's the lamp at the train station. It does have a condition, that determines the signal which is then used as the destination for the train. The requesters have a fixed setting there (D>0 I think), and the destination is always the depot. The providers have a dynamic destination (the requester that takes the delivery). So if the condition on the lamp is wrong or missing on the providers, then the train will ignore the destination signal and simply go to the next station in the schedule.

The other lamps are only for information to the player, it's not a problem if their conditions are wrong.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

sethcor
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Oct 21, 2016 8:12 am
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by sethcor »

siggboy wrote:
sethcor wrote:
siggboy wrote:Check the condition on the lamp, if it's missing or wrong then your provider will not be able to tell the train where to go.
Which one, the ones at the providers stating a train is being requested or do you mean the ones attached to the smart train stops? I am assuming the one on the train stop itself based on the smart train stops and how they work.

They are all there and look to be connected right. I used the blueprint you linked not to long ago and altered it a bit by removing the circuit meant for giving the inserters a item filter, i also have a copy of an older one that i have tried using, its main circuit looks the same as the the multi item one.
It's the lamp at the train station. It does have a condition, that determines the signal which is then used as the destination for the train. The requesters have a fixed setting there (D>0 I think), and the destination is always the depot. The providers have a dynamic destination (the requester that takes the delivery). So if the condition on the lamp is wrong or missing on the providers, then the train will ignore the destination signal and simply go to the next station in the schedule.

The other lamps are only for information to the player, it's not a problem if their conditions are wrong.

Looking at the signals I am assuming the R signal coming from the requesters is the signal to tell what its station number is, but with multiple people transmitting it they are just totaling up on the hub, would this be my problem?

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by siggboy »

sethcor wrote:Looking at the signals I am assuming the R signal coming from the requesters is the signal to tell what its station number is, but with multiple people transmitting it they are just totaling up on the hub, would this be my problem?
When the depot needs to determine the actual number of the requester station, it will ask all the outposts in turn, and the number will not be totalled up.

The totalled up numbers for "R" and "P" are visible when the depot is finding a resource to deliver, but at that point it's not yet relevant what the exact values of "R" and "P" will be.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

sethcor
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Oct 21, 2016 8:12 am
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by sethcor »

So It is getting the signal with the right number for the station. that it should be dropping off at. so now i am baffled. this endevor has helped me learn the cuircutes for this so now i understand in detail how the provider / requester work. I just can not figure out why it is not working. I have the signal # marked with an X in the Station # is blank. Line: smart trains # 0 and no X in use station mapping

The lamp is getting an R6 ( the requester station number) D1 (the signal that is sent over all the red buss) X2 (there are no trains at the depo) and a Station1 signal ( not sure what this one is for.)

I see the lamp at the requester only having the D1 signal

sethcor
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Oct 21, 2016 8:12 am
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by sethcor »

I updated my game and it started working. I had been playing on 14.13

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by siggboy »

sethcor wrote:this endevor has helped me learn the cuircutes for this so now i understand in detail how the provider / requester work.
That's never a bad thing, because it will make it easier for you if you need to change something on that end.
The lamp is getting an R6 ( the requester station number) D1 (the signal that is sent over all the red buss) X2 (there are no trains at the depo) and a Station1 signal ( not sure what this one is for.)
The "R" signal (at the provider, which is put on the lamp) is the important one, the other signals do not matter for the provider. The "X" signal is not used at all at the outposts, it's basically a garbage signal that can be ignored (as far as the outposts go, of course it's important for the depot). The "D" signal is only used at the requester.
I see the lamp at the requester only having the D1 signal
That is correct. In fact, the "D" signal is just a static signal which is always on the bus, and it is the number of the depot. Most of the time it will have the value "1", because the depot is the first station on the train line in a typical setup.

The train will always go back to the depot after the requester, and that is why this signal is on the lamp for all the requesters. You can change that if you want the train to go somewhere else before it returns to the depot. In fact, you can create a non-standard setup for transporting oil in barrels if you change this for the oil outposts. But that's tricky and I don't recommend it until you're familiar with the system.

There are other ways to configure that: you could simply feed a value of "1" (or the number of the depot station) directly at the requester, or you could configure it in SmartTrains (that's awkward).

The current approach with the "D=1" signal on the red wire makes the requester circuit slightly smaller and it allows to reconfigure the depot position (although that should never be necessary). It also makes the SmartTrains configuration as simple as possible. That's why I've done things this way.
sethcor wrote:I updated my game and it started working. I had been playing on 14.13
I have no idea why the update helped. Maybe there was a bug in the game which broke something.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

doxsroxs
Fast Inserter
Fast Inserter
Posts: 160
Joined: Mon Aug 01, 2016 4:19 pm
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by doxsroxs »

Hi again

Two questions I have been toying with:
If station A needs 180k ore, and station B has that much. Would it be possible to introduce a function for providing more than one train load with one match?
I know the system can do that today if I have multiple providers, but we are running into issues with the number of stations vs match times.
Perhaps add several registers to the station logic so it can store more than one recepient?

Next questions is, do you think it would be possible to change how the depot makes the station matches to increase match speed?
Im thinking along the lines of having multiple combinator clusters working in parallell to match faster.
But to be honest, Im not sure if it is feasible.
Send train to station ID using combinator signal is a long overdue feature!
viewtopic.php?f=6&t=74663

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by siggboy »

Both of these suggestions would require a major redesign of the circuit, and those changes are really only useful for really large setups (like yours).

Maybe you should consider building a second depot that is completely separate from the first (using green wire for the bus), and have that depot handle only the rare cases (i.e. resources that don't get shipped a lot).

That way you can offload a lot of the outposts to the second depot and that will make match times much shorter for the primary depot.

I also think that the match times themselves are only a part of the problem, you always run into the limitation that your trains need to pass through the depot, which takes time and introduces delays. Even if you could launch the trains immediately, with no delay, they'd have to decelerate, stop and leave.

So maybe split the depot into two, and see how that goes. I'd be interested in your experience.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

sethcor
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Oct 21, 2016 8:12 am
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by sethcor »

siggboy wrote:
sethcor wrote:I updated my game and it started working. I had been playing on 14.13
I have no idea why the update helped. Maybe there was a bug in the game which broke something.
Me either but now its working beautifully, I think it must have been my problem the entire time XD ahh well. With it i find i still run trains to some stations without it because of the lock out effect it has a station ( only 1 train to a supply station at a time thing) I should dig into the depo circuits and see if its possible to make it able to request multiple trains based on resource load. I suose it mya be easier to just have a second pickup spot from the same place, hat i would remove as the place output drops. Currently running 15 trains on a 5 lane with a ten stacker before it and it is handling the stations I do have fine. , working on making a mega style base XD so i may move the depot spot to make it handle more trains. but not sure i need to just yet since 3-4 trains tend to be in waiting as is.

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by siggboy »

It's not possible to have more than 1 train inbound at a time to the provider with the current design. In order to have multiple trains it would be necessary to add more memory to the providers, because you would have to store the different destinations, and resources to be delivered.

That is rather complicated and would require a major rework of the depot circuit, too. In any case, I'm not planning to add this to the setup.

If your trains are big enough, then it's fine to have only single trains going to the providers. That only becomes a limitation when you have very large or speedboosted mining operations that are also very distant from the factory (just do the math, figure out how much a single train can pick up from an outpost per minute and compare it to the mining rate, and you'll see that parallel/pipelined trains don't really do anything in most cases).

It's always a good idea to have the depot in a nice central location, and make sure that your railroad is not causing any delays.

Your 5 lanes are also more than enough to service a very heavy load. Probably you don't even need that many. As long as you have trains waiting in your depot your setup is not close to saturation anyway. In my experience if you have 4-wagon fast trains (with two locomotives pulling), then with 20 trains you can already make 1 rocket every 2-3 minutes, and that's with a lot of leeway for optimization.

So don't worry about it for now, focus on a solid railroad and on the basics.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

doe
Burner Inserter
Burner Inserter
Posts: 19
Joined: Sun Jul 17, 2016 4:26 pm
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by doe »

Got it working and it stopped redid it all and it stopped working and started lol. I must say as frustrating as it has been getting this to work, it's been alot of fun.

I got the book which you posted previously and i am using the combi provider, set it all up as detailed, the requester requested coal and the train left the depot and went to the provider, problem i got is the filter inserters are not loading coal onto the train?? I have set the resource type at the req and the amount the buffer needs before it requests. i.e -4000 coal
At the provider station i have set the amount which the station should have, i.e 8000 as i have 1-4 trains. yes i set the cargo wagon number in the depot. Not sure whats missing or what i not changed to get the filter inserters to load the coal onto the train even though the requester requested it and the train was sent.

Any help appreciated.

doe
Burner Inserter
Burner Inserter
Posts: 19
Joined: Sun Jul 17, 2016 4:26 pm
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by doe »

I lowered the 8k number at the provider station and it started loading the coal, but now it wont load a full 4 wagon train, instead of loading 8k resources it stops at 7582 or something similar, any idea whats up with it?

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by siggboy »

doe wrote:I lowered the 8k number at the provider station and it started loading the coal, but now it wont load a full 4 wagon train, instead of loading 8k resources it stops at 7582 or something similar, any idea whats up with it?
That's normal and intended. The reason is that "144" units are subtracted per wagon (12 units per inserter per wagon, with the usual 12 inserters per wagon that's 144 per wagon) so the filter inserters will never try to completely fill the wagons. This is so you can provide multiple items at a single provider and you won't have the problem that the inserters are left with "residual items" in their hands. Residual items are a big problem for multi-resource providers (they will lead to mixed cargo in the trains).

If we make the inserters stop when there are still at least 12 units of space in the wagon, per inserter used, then we guarantee that all inserters can always offload the full stack that they're holding -- no residual items. Of course this does waste a little space per wagon (if you intend to actually fill the wagons completely).

In your case, you do not need this functionality (because the outpost only produces Coal). You can simply replace the filter inserters with regular stack inserters and thus ignore the item limit. There is then some redundant (not needed) circuitry which you can leave around or remove.

If this bothers you, then you can make two blueprints for providers: the "multi-provider" (that's the blueprint from the book that you are using now), and a "bare bones" provider without the circuitry that limits the inserters (and regular stack inserters instead of filter inserters).

In your game you might never actually build a "multi-provider", and then it's of course a little better to have the simpler provider design for most purposes. The multi-provider is only really interesting if you ship intermediate products (for example, the various things a refinery can produce), or if you use mods such as Bob's Mod that does add a lot of different minerals.
In a game where your trains mainly ship ores (from outpost to the smelting) and coal, the multi-provider is not that useful.

Another side benefit of the multi-provider is that the filter inserters will only load a train if the outpost has actually been "programmed" for a delivery by the depot. That means that if you have a bug in your setup and you have trains that "run amok", then those trains won't be loaded with random resources at the provider stations. Also, if you manually drive a train into a provider station, then the outpost won't load your passenger train (in the general case).
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

doe
Burner Inserter
Burner Inserter
Posts: 19
Joined: Sun Jul 17, 2016 4:26 pm
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by doe »

siggboy wrote:
doe wrote:I lowered the 8k number at the provider station and it started loading the coal, but now it wont load a full 4 wagon train, instead of loading 8k resources it stops at 7582 or something similar, any idea whats up with it?
That's normal and intended. The reason is that "144" units are subtracted per wagon (12 units per inserter per wagon, with the usual 12 inserters per wagon that's 144 per wagon) so the filter inserters will never try to completely fill the wagons. This is so you can provide multiple items at a single provider and you won't have the problem that the inserters are left with "residual items" in their hands. Residual items are a big problem for multi-resource providers (they will lead to mixed cargo in the trains).

If we make the inserters stop when there are still at least 12 units of space in the wagon, per inserter used, then we guarantee that all inserters can always offload the full stack that they're holding -- no residual items. Of course this does waste a little space per wagon (if you intend to actually fill the wagons completely).

In your case, you do not need this functionality (because the outpost only produces Coal). You can simply replace the filter inserters with regular stack inserters and thus ignore the item limit. There is then some redundant (not needed) circuitry which you can leave around or remove.

If this bothers you, then you can make two blueprints for providers: the "multi-provider" (that's the blueprint from the book that you are using now), and a "bare bones" provider without the circuitry that limits the inserters (and regular stack inserters instead of filter inserters).

In your game you might never actually build a "multi-provider", and then it's of course a little better to have the simpler provider design for most purposes. The multi-provider is only really interesting if you ship intermediate products (for example, the various things a refinery can produce), or if you use mods such as Bob's Mod that does add a lot of different minerals.
In a game where your trains mainly ship ores (from outpost to the smelting) and coal, the multi-provider is not that useful.

Another side benefit of the multi-provider is that the filter inserters will only load a train if the outpost has actually been "programmed" for a delivery by the depot. That means that if you have a bug in your setup and you have trains that "run amok", then those trains won't be loaded with random resources at the provider stations. Also, if you manually drive a train into a provider station, then the outpost won't load your passenger train (in the general case).
Ohh great thank's for replying, makes alot of sense.Yeah i will take advice and make 2 bps with 2 providers, a multi and standard, Thanks again for the explanation, helps alot.

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by siggboy »

doe wrote:Ohh great thank's for replying, makes alot of sense.Yeah i will take advice and make 2 bps with 2 providers, a multi and standard, Thanks again for the explanation, helps alot.
If you look at the multi-provider, you will see two parts of the circuit, on each side of the station. The smaller part is connected to the inserters, that's the part which disables the filters when the target amount is reached (the mechanism behind it is not obvious, it does use integer overflow in the circuit to force a negative signal which will effectively remove the filter and disable the inserters -- there is no easier way currently in the game to do exactly this).

If you replace the filter inserters with regular inserters, then that entire part of the circuit can be removed. Just be careful that you don't remove anything else...

In general, be careful when making any changes to the circuits. A single missing wire can ruin everything, and it's hard to debug unless you understand the setup in detail.

The outpost circuits (provider and requester) are reasonably easy to understand, but they're not trivial.

With regards to the multi-provider, the interesting bit is the register which does store the information that is received from the depot. One part is the number of the requester station (next hop for the train after loading is finished), it is the "R" signal. The other part is the actual resource which is to be loaded. You are free to ignore the resource bit, if the provider does only load one resource type anyway. Simply make the inserters load the train and have the train leave when it is "full" (you do that with a regular train station condition).

The "R" signal always needs to be evaluated. It is input to the lamp at the smart train station, and then the SmartTrains mod uses the signal to determine the next hop of the train. This part is strictly mandatory because otherwise the train would not know where to drop off the cargo.

Also, there always needs to be a "leave condition" for the train which does make sense. If your leave condition is "train full", then you cannot use the resource limiting that is a part of the multi-provider circuit -- because that will never completely fill the train in the general case, for the reasons mentioned.

Therefore, in an actual multi-provider the leave condition cannot be "train full"; the straightforward way is to use an "inactivity" rule instead.

The "train full" rule can be safely used with regular providers that always fill the train to the limit.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

crazy142857
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Nov 10, 2016 8:17 am
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by crazy142857 »

I need help coz i'm not sure why my setup isn't working anymore.
I've studied your the demo unit and followed the setup.
I totally love the concept and want to apply it.

I created the depot for my train, then provider: Coal & requester: Coal stations. I managed to get it to work.
Then I've added provider: copper plates & requester: copper plates at the end of smartrain.
At first it worked (i guess for 1-2 trips), then somehow somewhere it stops.

Not sure if I broke something in depot or provider station. Provider station's lamp isn't lighting up as it should. I've check the values and all are as per demo (expect for depot lanes and train stops values in combinator)

Attached is my saved file.
Attachments
free-ivan-buffer.zip
(13.47 MiB) Downloaded 126 times

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Smart Train Deliveries with Combinator Magick [0.13/0.14]

Post by siggboy »

You need to also upload your "mods" folder so I can easily recreate your environment.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

Post Reply

Return to “Combinator Creations”