Train circuit condition "next station enabled"

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
CzBuCHi
Long Handed Inserter
Long Handed Inserter
Posts: 90
Joined: Thu Feb 22, 2018 10:25 pm
Contact:

Train circuit condition "next station enabled"

Post by CzBuCHi »

Hello, just got into train phase of the game and now need little kick in right direction :)

I have train with this shedule:
1) Mine Stack - blocked by chain signal
2) Mine - wait until full
3) Smelter Stack - blocked by chain signal
4) Smelter - wait until empty

My trouuble is that when Mine and Smelter are both disabled via circuit networks (mine ore to low, smelter ore to high) trains will loop between stack staions ...

Ideal solution would be have circuit condition at stack staions like "next staion on shedule is enabled" (stacks are used for multiple train types - cannot simply send signal on wire...)

In LuaTrain i found schedule so i can get next station name, but cannot find how to determine is staion is enabled or not ...

plan is to create mod, that will send "next station enabled" signal to train station so it can be used in condition - my question is if anybody already dealt with this so im not inventing the wheel L:)

mrvn
Smart Inserter
Smart Inserter
Posts: 5710
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Train circuit condition "next station enabled"

Post by mrvn »

Two options:

1) Don't put stations in your stacker. Reduce the schedule to exactly 2 stations.
2) draw a wire from here to the next station. Use the same condition that disables that station to decide weather it's enabled or not.

zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1161
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Train circuit condition "next station enabled"

Post by zOldBulldog »

This is not as trivial as some of the other options but this relatively simple setup seems to work fine:

- When my stations are disabled (for whatever reason... occupied, chests full, etc), each sends out a signal "<ore signal> = 1" that reaches the stacker stop.
- I share one stacker for all of the ore unload stations.
- I have enough stacker lanes to hold *all* of the ore trains.
- The stacker stop is set to pass the circuit info to the train.
- The train is set to stop at the stacker until the circuit condition "<ore signal> < <number of stations for that ore>" is met.


How it behaves:

- For this example, assume 2 copper stations. Some other other stations share the stacker but we'll ignore them for now.
- If at least one copper station is enabled, the train pauses for less than a second at the stacker and moves on to the empty copper station and begins unloading. Leaves to go to the load station when empty.
- If all copper stations are disabled, the train stops at the stacker until one enables.

You should be able to replicate this simple setup.

---------------------------------------------------------------------------

My personal setup is a little more complex (and although it works it is not what I'd call fully mature yet), you might want to think about it but I don't recommend attempting it until you are successful with the simpler approach I described.

- Each of my unload stations consist of an Unload stop and an Unload Queue stop right behind it (nothing happens there).
- Trains use the "until empty" condition at the unload stop, a 1 second wait at the Unload Queue.
- My Unload Queue stop gets disabled when the stop itself is occupied or the signal right behind it is red (because the train hasn't fully moved forward into the Unload stop yet). When disabled it sends the "<ore signal> = 1" to the stacker.
- The stacker passes the signal to the train. The train uses the circuit condition "<ore signal> < <number of stations for that ore>" to enable the train past the stacker.

What my setup achieves:

- I use 1-2 trains. So, the Unload + Unload Queue stops occupy about the same space as a 2-4 train stop but get into unload position much faster.
- As long as I have enough ore deposits and trains, my unload stop is always full. *Usually* there is a 2nd train waiting in the Queue stop ready to move up. This way, "moving up" takes very little time. As a side-benefit, these are 2 trains that aren't sitting in the stacker, so I don't need a huge stacker to ensure I have enough full trains of every kind of ore ready to unload.
- Extra trains of that ore wait full of ore at the stacker.
- I am nowhere ready to do formal tests, but by having trains almost constantly unloading, I expect to saturate a blue belt per wagon and maybe two. So, a 1-2 train setup should be able to saturate 2-4 blue belts, so long as I have enough ore deposits and trains.

User avatar
MeduSalem
Smart Inserter
Smart Inserter
Posts: 1488
Joined: Sun Jun 08, 2014 8:13 pm
Contact:

Re: Train circuit condition "next station enabled"

Post by MeduSalem »

zOldBulldog wrote:When my stations are disabled (for whatever reason... occupied, chests full, etc), each sends out a signal "<ore signal> = 1" that reaches the stacker stop.
- I share one stacker for all of the ore unload stations.
- I have enough stacker lanes to hold *all* of the ore trains.
- The stacker stop is set to pass the circuit info to the train.
- The train is set to stop at the stacker until the circuit condition "<ore signal> < <number of stations for that ore>" is met.
Pointless. If there are more trains than stations and all of them waiting in the stacker, then the second one of the station becomes available ALL of the trains waiting in the stacker will depart at once and then you will have a mess at the unloading stations with several trains bunched up... except if the stacker is "serial" and not "parallel'", but in that case it isn't a stacker anymore.

Might as well then just leave out the circuitnetwork entirely and just mark trainstops as unavailable... would have the same behaviour.

You need an additional logic (like a counter) to keep track of how many trains are already on route from the stacker to the stations... otherwise it won't work as expected. The counter would then get increased when a train departs the stacker to head for a station, and decreased once it arrives in a station. But that stuff is really annoying to build.

Because it is so annoying it is one of the reasons why I absolutely hate trains and why I already abandoned the "common stacker" concept entirely and moved back to having dedicated trains going to dedicated train stations. Fuck this useless circuitnetwork shit that is never going to work out anyway. Even with all the CN stuff and whatnot the game already has it simply doesn't work without using additional mods.
Last edited by MeduSalem on Tue May 08, 2018 6:08 pm, edited 1 time in total.

zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1161
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Train circuit condition "next station enabled"

Post by zOldBulldog »

MeduSalem wrote:
zOldBulldog wrote:When my stations are disabled (for whatever reason... occupied, chests full, etc), each sends out a signal "<ore signal> = 1" that reaches the stacker stop.
- I share one stacker for all of the ore unload stations.
- I have enough stacker lanes to hold *all* of the ore trains.
- The stacker stop is set to pass the circuit info to the train.
- The train is set to stop at the stacker until the circuit condition "<ore signal> < <number of stations for that ore>" is met.
Pointless. If there are more trains than stations and all of them waiting in the stacker, then the second one of the station becomes available ALL of the trains waiting in the stacker will depart at once and then you will have a mess at the unloading stations with several trains bunched up... except if the stacker is "serial" and not "parallel'", but in that case it isn't a stacker anymore.

Might as well then just leave out the circuitnetwork entirely and just mark trainstops as unavailable... would have the same behaviour.
LOL, not pointless at all. It just requires common sense to use successfully.

In first place I would most likely never have more than one extra train per ore type unless my base was massively using that ore.

Second, the condition of trains actually parking in the stacker only happens when your station goes idle for the resource.

The two scenarios aren't likely to happen at the same time, and only a complete fool would massively overpopulate with trains.

Furthermore, in the unlikely case you had a lot of trains and suddenly your consumption went to nothing and then restarted... the worst that could happen is that the trains make ONE extra loop of the circuit as things balance out.

Or, if demand drops permanently to a fraction of capacity then anyone with common sense would remove the excess trains.

Back to the beginning, common sense.. required.

User avatar
MeduSalem
Smart Inserter
Smart Inserter
Posts: 1488
Joined: Sun Jun 08, 2014 8:13 pm
Contact:

Re: Train circuit condition "next station enabled"

Post by MeduSalem »

zOldBulldog wrote:LOL, not pointless at all. It just requires common sense to use successfully.

In first place I would most likely never have more than one extra train per ore type unless my base was massively using that ore.

Second, the condition of trains actually parking in the stacker only happens when your station goes idle for the resource.

The two scenarios aren't likely to happen at the same time, and only a complete fool would massively overpopulate with trains.

Furthermore, in the unlikely case you had a lot of trains and suddenly your consumption went to nothing and then restarted... the worst that could happen is that the trains make ONE extra loop of the circuit as things balance out.

Or, if demand drops permanently to a fraction of capacity then anyone with common sense would remove the excess trains.

Back to the beginning, common sense.. required.
You are speaking of too many "Probabilities" for my taste. You just assume "won't happen", "unlikely to happen"... yeah well... until it does. And then you are going to abandon your concept, believe me, I have a lot more experience with that kind of stuff than you seem to have.

Murphy's Law, brother.

zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1161
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Train circuit condition "next station enabled"

Post by zOldBulldog »

MeduSalem wrote:
zOldBulldog wrote:LOL, not pointless at all. It just requires common sense to use successfully.

In first place I would most likely never have more than one extra train per ore type unless my base was massively using that ore.

Second, the condition of trains actually parking in the stacker only happens when your station goes idle for the resource.

The two scenarios aren't likely to happen at the same time, and only a complete fool would massively overpopulate with trains.

Furthermore, in the unlikely case you had a lot of trains and suddenly your consumption went to nothing and then restarted... the worst that could happen is that the trains make ONE extra loop of the circuit as things balance out.

Or, if demand drops permanently to a fraction of capacity then anyone with common sense would remove the excess trains.

Back to the beginning, common sense.. required.
You are speaking of too many "Probabilities" for my taste. You just assume "won't happen", "unlikely to happen"... yeah well... until it does. And then you are going to abandon your concept, believe me, I have a lot more experience with that kind of stuff than you seem to have.
That's OK. You rely on experience, I rely on thinking and common sense.

Common sense hasn't failed me yet, I have no intention to overpopulate the design, and as I said already the consequences if the worst happened are minimal.

CzBuCHi
Long Handed Inserter
Long Handed Inserter
Posts: 90
Joined: Thu Feb 22, 2018 10:25 pm
Contact:

Re: Train circuit condition "next station enabled"

Post by CzBuCHi »

!@#$ ... i didnt wanna start war over here :D

i think (at least for now) im resolving this by rail signal at stack exit, that turns red when all related stations are red ...

bobucles
Smart Inserter
Smart Inserter
Posts: 1669
Joined: Wed Jun 10, 2015 10:37 pm
Contact:

Re: Train circuit condition "next station enabled"

Post by bobucles »

I rely on thinking and common sense.
I don't know what kind of common sense makes a person proficient with train networks, circuit trains and having the right number of ore trains for each outpost. That sounds like hard earned experience to me.

zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1161
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Train circuit condition "next station enabled"

Post by zOldBulldog »

bobucles wrote:
I rely on thinking and common sense.
I don't know what kind of common sense makes a person proficient with train networks and having the right number of ore trains for each outpost. That sounds like hard earned experience to me.
Experience = Try things, fail, correct, and eventually know what works. Nothing wrong with it.
Common Sense = Research, analyze, think, evaluate, observe changes, make good decisions based on available information, adapt.

Experience is always good, and eventually those that persist get there in any area of life.

Common sense lets you be effective with a minimum of failures or at least minimizing the impact of failures. It does not demand perfection, merely that whatever you do work well and relatively easily. It eventually leads to Experience just as the rough and tough trial and error method does.

Experience does have a negative side, it can make you "too comfortable" and even lazy, blinding you to newer approaches that *might* work better. I have a lot of experience in several areas of life and I have to constantly guard myself against those pitfalls.

To come back to the topic of the thread, in the particular station design that led to our long discussion, I don't claim that the design I suggested and that your experience tells you "don't do it!!!" is perfect, but it is working quite well for me and using common sense (like avoiding overloading it with trains) I am getting very decent throughput without any of the dire dangers that you mention. I am certain I'll need to make some tweaks as I keep adding complexity to the network, but the true test will be the next 400-800 hours of gameplay on this map. We'll see. Taking THAT approach is what using common sense is all about. Don't be afraid of trying new things, experiment with things that seem to work and adjust as needed. Something wonderful *might* come out of it. :D

Bauer
Filter Inserter
Filter Inserter
Posts: 346
Joined: Fri May 05, 2017 12:48 pm
Contact:

Re: Train circuit condition "next station enabled"

Post by Bauer »

zOldBulldog wrote: Experience = Try things, fail, correct, and eventually know what works. Nothing wrong with it.
2 of my most favourite Thomas Edison quotes*:
1. "I didn't fail. I know 1000 ways now how to NOT build a light bulb."
2. "The light bulb isn't a gradual improvement of a candle."

You mostly learn from failure and a big step forward needs a disruptive idea that is considered to be loony by the average until proven.

* I think it's actually unlikely that he said that himself. But it fits...

Post Reply

Return to “Gameplay Help”