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 dynamic train deliveries with combinator Magick [0.13]

Post by siggboy »

muglebust wrote:Thanks for the idea, but thats not really practical for my intentions, I want to have other fluids on rails other than crude
I also transport lubricant barrels (I use a barrel mod), just the conventional way (main base requests them, main base also is a provider for empty barrels). This sounds outlandish, but my current map is a decentralized factory with everything being on artificial islands. So I actually need to ship lubricant, maybe I should open a sex toy store :).

In general I think barrels are way too awkward compared to a tanker, especially if you need a barrel mod anyway. It's a nice challenge, however, and when you need to ship great amounts of something (i.e. oil in a large base), then barrels are much better, because more oil fits in a train, is more easily buffered/stored, and also loaded/unloaded much faster.

Tankers are limited to 120 fluid/s per wagon, which might not be enough.
Have you published the oil depot BP for 0.12?
No, but I'll whip something together for 0.13 and then I'll post it here with instructions how to use it.
What about having one depot responsible for the entire logic, but having more lanes in it, where some are reserved for the other traintype, the lanes would actually be named differently, so they form a station by themselves.
Too complex, theoretically possible though. The current thing is already too complex, if I would add something like this it would be over my head.
It could be prone to problems if the depot selected some cargo for transport, with no vacant trains of that type. I think I will start by testing a bit more on the demo map :)
Don't underestimate the complexity. In a real game you also have to handle all this, setup problems are not uncommon, and depending on what you do wrong/forget your train system comes to a halt, or you get misdelivered items, lots of things can go wrong.
Making this more error prone by adding even more complexity will ultimately kill the fun (at least for me).

It's also the reason why I want to lock the provider to 1 train at a time. There are solutions for more than one consecutive train, but even if they worked they would only introduce another layer of possible run time problems.
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 »

OK, so here's the minimal oil delivery setup for 0.13. It's really small, does basically one thing, and one thing only (deliver a resource to a specific unload when that resource is available somewhere). It can also be used to deliver resources other than oil, but anything that goes beyond the basics (i.e. multiple resources, multiple unload stations, etc.) requires tweaking or will be impossible at all.

This can be combined with the full-blown setup (provider-requester-logistic-network-mega-depot) on the same (red) wire bus. The SmartTrains train line is different, simply create one line with the oil depot and the oil outposts, and put only your oil train(s) on that line (shown below).

Another important limitation of this: the providers (= outposts) have no "state". That means that they do not know if a train is already on the way or not.
If you run more than one train with this setup, they will (usually) all go to the same outpost as soon as this outpost becomes "ready".
Normally this is not what you want, so the setup as shown will only work really well with a SINGLE TRAIN on the line.

However, since this is strictly to handle oil, as requested by muglebust, one train will usually be enough to service all outposts. If you have, say, four healthy oil outposts, all of them pumping 400/minute, then you can probably easily keep those buffers empty with one single-wagon train (barring outlandish scenarios with excessive distances or inadequate railroads). A double wagon train would be able to handle much more still.
In any case, getting to the point where you actually need more than one train to be able to meet your oil demands requires quite a bit of consumption.

Use the version from the post just after this one instead, it does not have this limitation.

The stations shown below are to be connected to the existing red wire bus. The red wire is on the power pole in those blueprints.

Depot:

Image

The condition Pumpjack > 0 is mandatory. You have to set the same condition ("Pumpjack > 0") on the lamp as well, but that setting is part of the blueprint. The "Pumpjack" signal on the lamp (and the station) will be the destination station. It is retrieved by polling the outposts. While there is any outpost with available oil, then this signal will be present, and equal to the station number of one of these outposts.
The other signal ("Crude oil < 1000" in this example) can be anything. It will be the condition for a train to be dispatched from the oil depot.

You can also add more conditions, as long as you combine them with the "pumpjack" condition.

If you make a train leave while the "pumpjack" signal is not present, it will simply go to the next station in the schedule; in general that is not useful.

The tank illustrates where you would connect an output that gives you the "crude oil" signal. As long as you make it available to the train station it will be OK; it does not have to be connected in the specific way that is shown in the above screenshot.

The setup shown above will not work very well in practice. There should be another station where the train unloads the oil before it goes back to the depot. Combining the depot and the unload station into one is tricky, because it's not easy to find a good "leave condition" for the train, without resorting to timers and other shenanigans -- of course, if your rail tanker mod allows for reading the contents of the tank wagon ("Rail Tanker" does, "Tank Wagon" does not), then you can use that in the condition, and something like the above will work.
Blueprint Depot

Outpost:

Image

There is not much to be said here. The outpost should take a condition from the buffer, and only enable itself when that condition is met.
In this example, the condition is "Crude Oil > 2499", so the outpost will be "invisible" until the buffer tank is full.

You can modify this as needed.
Blueprint Outpost

SmartTrains configuration:

Image

The depot uses the signal, the outposts always have the oil unload as their next destination (= the depot in this case). If your oil unload happens to be different from the depot, which I would actually recommend, you change this appropriately. The train will go from outpost -> oil unload -> oil depot.
You can set this manually as shown above, or use the lamp and output constants to the lamp.
Last edited by siggboy on Sat Aug 27, 2016 12:56 pm, edited 1 time in total.
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 »

Here is the improved version of the simple oil transport:
Blueprint Book
It works the same as the primitive version, but an outpost will make itself "invisible" when a train leaves the depot for this outpost.

So you won't have several trains go to an outpost in a row, and it will work very well with multiple trains on the line.

In fact, this is very close to the first version of all this, from many months ago. It's funny how easy and simple it now looks, after all the nonsense that has been added to the current incarnation.
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 dynamic train deliveries with combinator Magick [0.13]

Post by doxsroxs »

I want to give a heads up and warn you regarding the Smart Display mod used in the demo here in case any others are struggling with multiplayer lag as well.

In our game this mod was causing game breaking lag and instability. In the new 0.14 version my friend would not catch up/sync up after connecting unless I paused the game.
As soon as we resumed he had about 8-10 fps. In 0.13 we where both down to about 20 fps.

This was never apparant in CPU or network usage since both of our machines are rather fast and we have gigabit connections from the same supplier with lower single digit millisecond ping. None of our machines CPU cores ever got over 45% when playing. Mine is often throttling down to much slower core speeds.

The mod creator is looking into this, but it seems a lot of separate entities are created when using this mod, and I assume Factorio itself has issues with that.
That part of the game does not seem very optimized or created with this usage in mind.
If I understood the mod creator correctly, he is spawning a separate entity for each letter. And we used a lot of signs + a lot of text in each sign -> huge number of entities.
We will start by reducing the number of updates per entity and see if this works, we will work with him to try and get this working smothly even in large games but to be honest Im not sure it will ever work without changes to either Factorio or major optimization in the mod to reduce entity updates/number of entities.
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 dynamic train deliveries with combinator Magick [0.13]

Post by siggboy »

There's another mod by the same author, called "Sticky Notes", and that is a lot better to leave information on the map than Smart Display.

You should use the display only for displaying dynamic content. You can also use Nixie Tubes (it looks better on the map).

To leave notes and annotations you should use Sticky Notes. With the next update to the demo map I will replace Smart Display with Sticky Notes for the instructions.
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 dynamic train deliveries with combinator Magick [0.13]

Post by doxsroxs »

siggboy wrote:There's another mod by the same author, called "Sticky Notes", and that is a lot better to leave information on the map than Smart Display.

You should use the display only for displaying dynamic content. You can also use Nixie Tubes (it looks better on the map).

To leave notes and annotations you should use Sticky Notes. With the next update to the demo map I will replace Smart Display with Sticky Notes for the instructions.
Thanks, Ill have a look at it. Unfortunately we had a bit of a meltdown in power production (and other issues) the last two days so did not have the time to test signs.
Lets just say that the new power plant design will be built using burner inserters and designed differently so it is actually possible to start it up once stopped. (For the record, was my friend who built it :lol: )

Your new version of the depot has colored status signals, could you give some more information regarding the lights on the depot?

Im sure it was not your fault, but lets just say we have thoroughly tested all the available error codes.
I have verified the station who caused the lockup as soon as a match for delivery was made and have reproduced the error, workaround was loading from autosave and not connecting it. Was a friend of mine who rebuilt it, Im going to have a look at it tonight since I suspect it was not built using the correct blueprints/setup.

Have you had a look at my combo station by the way? Also let me know if you have any feeback and improvements on it :)
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 dynamic train deliveries with combinator Magick [0.13]

Post by siggboy »

doxsroxs wrote:Lets just say that the new power plant design will be built using burner inserters and designed differently so it is actually possible to start it up once stopped. (For the record, was my friend who built it :lol: )
The easy fix is to power the inserters (and pumps, if any) from a disconnected solar array with a few accus. That way you can always recover.
Your new version of the depot has colored status signals, could you give some more information regarding the lights on the depot?
If you disable the combinator that emits "S=1", the light turns red, because the depot is then effectively suspended and doesn't send any new trains. That's the recommended way to stop the depot when you need to make disruptive changes, or simply when you want to recall all the trains.
I use it often.

The light is yellow when it's in phase 2 of the scheduling, that's when the "Q" signal loops around and selects a requester and provider. Usually this phase is very short, because only 1 pass is required. If the light ever stays yellow for longer than a second, that's already an error condition, and it should never happen -- in fact it has never happened with the latest version of the depot.

The light is green when a requester, provider and resource amount is in the registers, and the depot is waiting to dispatch a train. It could possibly be green for a while if no train is at the depot. If the light is green, and a train returns, it should immediately be dispatched, because a route has been determined already.

In phase 1, the light is simply off. That's when you have the signal "S=1" on the wire.
I have verified the station who caused the lockup as soon as a match for delivery was made and have reproduced the error, workaround was loading from autosave and not connecting it. Was a friend of mine who rebuilt it, Im going to have a look at it tonight since I suspect it was not built using the correct blueprints/setup.
I haven't found any more bugs in the logic myself. The only thing that can cause problems is lack of power, so if you want to be 100% fail safe you need to power the outpost circuits and the depots with disconnected power grids consisting of solar panels and accumulators.

Especially the counting of the resources at the requesters can become desynchronized in low power conditions, but that's unavoidable unless you have 100% guaranteed power on the inserters and the outpost circuit.

With the usual precautions (using only tested blueprints, and not powering up the outpost before it's configured and ready) there should be no disruptions.
Have you had a look at my combo station by the way? Also let me know if you have any feeback and improvements on it :)
No I haven't looked at it yet, but I will :).
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 »

Here's the latest version of the depot that I use now. It contains a fix for the "depot can get stuck in phase 2" problem, and looks a lot nicer and cleaned up.

For upgrading, leave the constant combinators at the top and right (that contain the resource configuration), and place the blueprint on top of them.

Then you only need to reconfigure a few minor things (number of lanes, number of outposts, number of wagons).

This version subtracts 144 per wagon from the amount of resources that is promised (if at cap), which does not matter for general use, but prepares the setup for multi-resource providers. I will post a blueprint of an outpost later.

I recommend to update to this version of the depot. Runs perfectly for me.

Orange can be taken from the old setup (leave these combinators in place before removing the old depot circuit, also any others you have added to these groups).

Yellow needs to be checked for config. The value "T=80" must be larger than the "Train station" value, I recommend adding "20". So if your "train station" config value (max. number of outposts) is "50", then a value of at least "T=70" is good. Or simply set "T=300" and forget about it, it's not important as long as it's large enough; but don't make it too large, it's a timeout counter. (I should have made it larger in the depot blueprint, but I took that directly from my live game.)

Green is the combinator that you can disable in order to suspend the depot.

The lanes connect to the power pole on the lower right, the red bus can connect to either substation.

Make sure that there is only 1 combinator emitting the "D=1" signal on the bus (or whatever you have as the depot station number, usually it's D=1). Check this directly on the bus, and remove any extra "D=1" combinator.
depot-new.PNG
depot-new.PNG (499.95 KiB) Viewed 7220 times
Blueprint
Last edited by siggboy on Tue Sep 27, 2016 2:57 pm, edited 1 time in total.
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 dynamic train deliveries with combinator Magick [0.13]

Post by doxsroxs »

siggboy wrote:
doxsroxs wrote:Lets just say that the new power plant design will be built using burner inserters and designed differently so it is actually possible to start it up once stopped. (For the record, was my friend who built it :lol: )
The easy fix is to power the inserters (and pumps, if any) from a disconnected solar array with a few accus. That way you can always recover.
Your new version of the depot has colored status signals, could you give some more information regarding the lights on the depot?
If you disable the combinator that emits "S=1", the light turns red, because the depot is then effectively suspended and doesn't send any new trains. That's the recommended way to stop the depot when you need to make disruptive changes, or simply when you want to recall all the trains.
I use it often.

The light is yellow when it's in phase 2 of the scheduling, that's when the "Q" signal loops around and selects a requester and provider. Usually this phase is very short, because only 1 pass is required. If the light ever stays yellow for longer than a second, that's already an error condition, and it should never happen -- in fact it has never happened with the latest version of the depot.

The light is green when a requester, provider and resource amount is in the registers, and the depot is waiting to dispatch a train. It could possibly be green for a while if no train is at the depot. If the light is green, and a train returns, it should immediately be dispatched, because a route has been determined already.

In phase 1, the light is simply off. That's when you have the signal "S=1" on the wire.
I have verified the station who caused the lockup as soon as a match for delivery was made and have reproduced the error, workaround was loading from autosave and not connecting it. Was a friend of mine who rebuilt it, Im going to have a look at it tonight since I suspect it was not built using the correct blueprints/setup.
I haven't found any more bugs in the logic myself. The only thing that can cause problems is lack of power, so if you want to be 100% fail safe you need to power the outpost circuits and the depots with disconnected power grids consisting of solar panels and accumulators.

Especially the counting of the resources at the requesters can become desynchronized in low power conditions, but that's unavoidable unless you have 100% guaranteed power on the inserters and the outpost circuit.

With the usual precautions (using only tested blueprints, and not powering up the outpost before it's configured and ready) there should be no disruptions.
Have you had a look at my combo station by the way? Also let me know if you have any feeback and improvements on it :)
No I haven't looked at it yet, but I will :).
Thanks! Im sure this was not related to any bug, my friend had been messing with the combinators trying to rearange them into a more compact setup. All other new stations we added yesterday have been working just fine.

That multiprovider sounds really interesting, though I think it will need a separate buffer for each material.
When it comes to power usage I think we are recovered from the meltdown and the new power station should be more failure proof (and possibly close to GW figures, but didnt count yet :p) I opted to go for burners & no pumps since I think solar is overpowered and immersion breaking. Also, we need somewhere to put the millions of coal we are mining :p

Will be interesting to hear your feedback on the central storage, it has been working very well for some time now :)

Ill have a look at the new depot tonight if I have the time, its looks really awesome and its cool that you keep improving this!
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 dynamic train deliveries with combinator Magick [0.13]

Post by siggboy »

doxsroxs wrote:That multiprovider sounds really interesting, though I think it will need a separate buffer for each material.
You can mix the buffer, it does not make a difference, because you have to use filter stack inserters anyway.

The trick is to avoid that the inserters are left holding residual items. So you can not completely fill the wagons and you need to make sure that you remove the filter setting correctly. That requires some tricks.

However, I've managed to build a very stable multi-provider with 4 additional combinators, that does waste the minimal amount of space per wagon.

It's really good for lower volume transports, and even for combining several mining outposts.
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 dynamic train deliveries with combinator Magick [0.13]

Post by doxsroxs »

Dont worry, Im sure we can break that one too ;)
Looking forward to testing it!
Send train to station ID using combinator signal is a long overdue feature!
viewtopic.php?f=6&t=74663

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

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

Post by doxsroxs »

Its installed and seem to work, however Im seing some strange signals on the bus.

I assume this is related to the multiprovider, but what I see is 47k ore, X2, D1.
Whats strange is that it stays that way for quite some time before reverting to the normal output.

I understand the D1, and I assume the 47k is a full trainload -144 as mentioned earlier.

But I dont quite understand the mechanics behind it, what is it doing and why? :lol:
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 dynamic train deliveries with combinator Magick [0.13]

Post by siggboy »

You can ignore those values, X is just a counter that goes through the different phases of the algorithm.

I could have filtered those values from the bus but it's not necessary and just adds extra combinators that make the depot bigger and harder to understand.

If you look on the left side of the depot, where the combinators are with "S=1" and the "Train Station" signals, there's a group of combinators that count X and Y and take values from the rest of the circuit and output values that start the polling and so on. That's a very simple state machine which is responsible for orderly execution of the algorithm. I've added that to get a cleaner circuit. It's also what makes the "status lamp" possible, that goes "yellow -> green", and turns "red" when you disable the depot.

The state machine is basically just a counter that advances when a certain condition is met. The value of the counter then determines what is output on the bus. If X=0 then the circuit will output S=1 on the bus, starting phase 1. As soon as a resource is found, the counter will advance to X=1, that disables the first phase and enables the second phase (the polling counter is started and output on the bus). When the polling is successful, the counter will advance to X=2 which will enable the train dispatch.
In the end, everything is reset, including the state machine counter, and the algorithm can start over.

If X=2 stays for a while, then you have no train at the depot, and it's waiting for a train. Perfectly normal (but maybe you should add more trains to your network...).

It's not related to the multiprovider. The multiprovider was possible before, it's not an addition to this version of the depot.

You can search for "Richards Controller" on wikipedia if you want to see how it looks in actual digital circuits. The state machine in the depot is a really simple Richards Controller.
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 dynamic train deliveries with combinator Magick [0.13]

Post by doxsroxs »

Ahaa, thanks!

Your probably right about the number of trains.
We are starting to get a bunch of stations and are adding more at a faster pace.
I have noticed less trains in the depot but didnt connect it to this signal on the bus, will look into adding more :)
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 dynamic train deliveries with combinator Magick [0.13]

Post by siggboy »

Well, the signal does not mean that there are too few trains. It just happens that if there is no train ready to be dispatched (= depot is empty), but the circuit has already found a route for the next train, then you see the signal X=2 (and the resource count) on the wire, because the depot is waiting at that phase of the dispatch. The depot status lamp will be "green" in this case.

As soon as the next train arrives, the depot detects the train and it will send it away. Then the circuit will go back to phase 1 and the X=2 disappears.

In any case, if you have an empty depot it usually means there are not enough trains. Because ideally there should always be a train ready to take the next order. That's why I think you have a bandwidth problem here and need to add more trains (and possibly more waiting bays). Adding more depot lanes is not necessary, especially since you don't have enough trains anyway.
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 dynamic train deliveries with combinator Magick [0.13]

Post by doxsroxs »

More trains are coming, I also thought about the long term effects, and we need trains to pause a while at the depot to ensure fuel is loaded or they will eventually run out.

Waiting bays are available, I made this fairly big from the beginning with 6 depot lanes and a large yard for waiting trains behind that. Cant remember the exact capacity, but we have room :p
I build according to the overkill principle.
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 dynamic train deliveries with combinator Magick [0.13]

Post by siggboy »

doxsroxs wrote:More trains are coming, I also thought about the long term effects, and we need trains to pause a while at the depot to ensure fuel is loaded or they will eventually run out.
If you load the fuel with a Stack Inserter then a pause is not necessary. Put a buffer chest at each locomotive, and fill the buffer chest from a belt (or simply with robots). Then load the fuel from the buffer chest into the locomotive, preferably with a stack inserter.

The locomotive will receive at least 1 stack of items from the chest, even if it only "runs through", and that should be enough to keep it at 100% fuel.

If you want to make extra sure, use Rocket Fuel.

On my map I use Rocket Fuel (that I make where the depot is, because running an oil pipeline was easier than running a coal belt). I only use Fast Inserters, and load the fuel through a buffer chest (as described above). Never had a single problem with trains not getting refueled enough.
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 dynamic train deliveries with combinator Magick [0.13]

Post by doxsroxs »

Hi, a question. Do I need a neutral constant signal in the depot in the combinator for number or wagons or can I just input a wagon signal from a combinator?

I can try myself, but want to make sure I dont mess up some part of the depot I dont know might be depending on a certain type of signal.
Especially since the train network has grown a lot lately and a stop there is catastrophic.

Also I want to share how I approach empty ore stations.
Removing an old station is a PITA when done the correct way since it involves stopping all traffic and rearanging the schedule. Instead do as follows:

Place a new station, requester or provider does not matter.
Rename to match old station name. Must be exactly the same.
Verify new station outputs correct station number.
Delete old station.
Rename new station to anything you like.
Connect new station to bus. (Dont forget to remove any bogus green or requested material signals first)
Profit.

No downtime, no reconfiguration, no mess :)

If I have the time tonight Ill post a few pictures and blueprints of my updated central storage stations and filtered + balanced requester stations. Balancing and filtering will save you time in the long run.

Another question by the way, how about updating the stations to not enumerate bogus information when no station number is present? I think it can be done with a combinator that activates if stn number is null.
Would be a small price for greatly increased stability and less things to worry about when placing a new station.
Send train to station ID using combinator signal is a long overdue feature!
viewtopic.php?f=6&t=74663

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

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

Post by doxsroxs »

siggboy wrote:
doxsroxs wrote:More trains are coming, I also thought about the long term effects, and we need trains to pause a while at the depot to ensure fuel is loaded or they will eventually run out.
If you load the fuel with a Stack Inserter then a pause is not necessary. Put a buffer chest at each locomotive, and fill the buffer chest from a belt (or simply with robots). Then load the fuel from the buffer chest into the locomotive, preferably with a stack inserter.

The locomotive will receive at least 1 stack of items from the chest, even if it only "runs through", and that should be enough to keep it at 100% fuel.

If you want to make extra sure, use Rocket Fuel.

On my map I use Rocket Fuel (that I make where the depot is, because running an oil pipeline was easier than running a coal belt). I only use Fast Inserters, and load the fuel through a buffer chest (as described above). Never had a single problem with trains not getting refueled enough.
Good tips, we are still using coal and cant build rocket fuel yet. (Needs new research) Been to busy with other stuff, like getting titanium production going. I did finish my 1,5 Giga Watt powerplant though :)
Incidentally the powerplant will need an upgrade and rebuild now that we have access to tech 3 and 4 stuff and materials...
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 dynamic train deliveries with combinator Magick [0.13]

Post by siggboy »

doxsroxs wrote:Hi, a question. Do I need a neutral constant signal in the depot in the combinator for number or wagons or can I just input a wagon signal from a combinator?
I've tried to replace the "wagon count" and "inserter bias" numbers with constants, but it's not straightforward. If you do it you will end up with bogus values in the resource register.

It's possible, but it will require some rebuilding and it will also increase the depot circuit in size. So I decided against it.
I can try myself, but want to make sure I dont mess up some part of the depot I dont know might be depending on a certain type of signal.
In order to make it work you will have to actually rework certain parts of the depot, which is only advisable if you understand exactly what everything does.
Removing an old station is a PITA when done the correct way since it involves stopping all traffic and rearanging the schedule. Instead do as follows:
Rename new station to anything you like.
Yes, that's very clever, and it works due to the fact how SmartTrains handles the station names and numbers.

But there's an even easier way: you can remove old stations, they will turn "red" in the schedules, but it will not change any of the numbers until you actually remove them and save the train line. So it's not a problem to have several "red" (deconstructed) outposts in the train schedules.

When you build a new outpost, you insert the new station directly above (or below) one of the "red" stations, then remove the "red" station and save the line.

That will also preserve the numbering but doesn't require any renaming shenanigans.
Another question by the way, how about updating the stations to not enumerate bogus information when no station number is present? I think it can be done with a combinator that activates if stn number is null.
Would be a small price for greatly increased stability and less things to worry about when placing a new station.
That shouldn't be too difficult, but I like how small the outpost circuits are right now, so I didn't want to make them bigger.

If you want to make your own fix, there is one thing you need to consider: the response time of the requester and the provider stations needs to be the same. This is the "tick delay" from receiving a polling signal (Q=x) to putting the response on the bus. This delay needs to be of equal length for all outposts. So you need to trace the signal path from the "Q=x" input to the output, and you will see it's the same for both. If you make any changes to that signal path you need to preserve this property.

It's probably not relevant for this change, but maybe keep it in mind if you want to make other changes in the future.

I think what you propose is an easy fix: install a decider that outputs a large value for the station number if the train station does not output any. Then combine the output from the train station and this decider, and use that as the station number. It's only one additional combinator for the outposts, and it should fix this problem.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

Post Reply

Return to “Combinator Creations”