Train Entry-Condition
Moderator: ickputzdirwech
Train Entry-Condition
Just like Exit-conditions that are in the game, Pre-conditions would be nice, too.
They'd work just like exit ones, except the train checks them before it makes a route to the next station.
This could be something like:
Fuel < 100
- The train won't stop at this station unless it's fuel is below 100.
Iron > 1000
- The train will only stop at this station if it has more than 1000 iron.
Thank you!
Advert
They'd work just like exit ones, except the train checks them before it makes a route to the next station.
This could be something like:
Fuel < 100
- The train won't stop at this station unless it's fuel is below 100.
Iron > 1000
- The train will only stop at this station if it has more than 1000 iron.
Thank you!
Advert
Re: Train Entry-Condition
please allow me to ride along on your suggestion, and possibly extend it.
In the fuel tab of the train properties, enable a conditional for "seek fuel", maybe settable as to percentage remaining.
in train stops, enable a condition for "I am a fuel stop". This condition could be modify-able by circuit condition if the train stop's fuel source becomes depleted.
In the fuel tab of the train properties, enable a conditional for "seek fuel", maybe settable as to percentage remaining.
in train stops, enable a condition for "I am a fuel stop". This condition could be modify-able by circuit condition if the train stop's fuel source becomes depleted.
Re: Train Entry-Condition
for the whole train getting fuel thing you might want to try the logistics train mod, there's a depot station in there and a train returns there to refuel after each run the same way a bot returns to a roboport.
The train entry conditions for certain things like cargo full it should do the test for leaving before it heads there, if it satisfies a leaving condition it could skip that station.
The train entry conditions for certain things like cargo full it should do the test for leaving before it heads there, if it satisfies a leaving condition it could skip that station.
My Mod ideas - https://forums.factorio.com/forum/vie ... 49#p107558
Re: Train Entry-Condition
And what will it do when the entry-condition is false? Will it skip that station and jump to the next station in the train's orders? If yes, then I would be very much in favor of your suggestion.Advert wrote:Just like Exit-conditions that are in the game, Pre-conditions would be nice, too.
They'd work just like exit ones, except the train checks them before it makes a route to the next station.
I don't like being only able to deactivate a station for all trains, instead of only certain trains. Therefore, I like your suggestion.
Re: Train Entry-Condition
I would much rather see trains becoming more smart and being able to decide where to go next. That would solve the same problem, but would open many more interesting possibilities.
Re: Train Entry-Condition
Yes, I agree with that. OpenTTD (Transport Tycoon Deluxe) has conditional order jumping. I would love to see something like that in Factorio.Lav wrote:I would much rather see trains becoming more smart and being able to decide where to go next. That would solve the same problem, but would open many more interesting possibilities.
Last edited by Tekky on Mon Jan 29, 2018 1:08 am, edited 1 time in total.
Re: Train Entry-Condition
Thanks for the feedback -- I would like to avoid adding special cases, though.Tym wrote:please allow me to ride along on your suggestion, and possibly extend it.
In the fuel tab of the train properties, enable a conditional for "seek fuel", maybe settable as to percentage remaining.
in train stops, enable a condition for "I am a fuel stop". This condition could be modify-able by circuit condition if the train stop's fuel source becomes depleted.
You could achieve this as described above, checking if fuel is low before deciding to go to that station.
An interesting note, you said percentage remaining -- how about checking for travel time remaining? Could also display estimated travel time to the various stations, along with a historical graph of how long trains take to get from A-B. Maybe a bit much for now, but it'd be cool. Graphtorio

I'd assume the same as the current system works: When a station is not found (i.e, disabled from circuit -- I do this to stations frequently: Train stop [Detect Train -> T, Enable/Disable: T = 0] -> Pole), it skips it and goes to the next one. It would be nice to have some additional things going here, but I don't want to write a 10 page design document for freeTekky wrote:And what will it do when the entry-condition is false? Will it skip that station and jump to the next station in the train's orders? If yes, then I would be very much in favor of your suggestion.Advert wrote:Just like Exit-conditions that are in the game, Pre-conditions would be nice, too.
They'd work just like exit ones, except the train checks them before it makes a route to the next station.
I don't like being only able to deactivate a station for all trains, instead of only certain trains. Therefore, I like your suggestion.

Lav wrote:I would much rather see trains becoming more smart and being able to decide where to go next. That would solve the same problem, but would open many more interesting possibilities.
Me too, this is just getting the discussion started. A lot of convenience could be added as well, for example train series (all trains of the same series would share configuration), lines (A list for trains to follow, you could update this by placing a station and setting it up to a line, instead of placing a station, then finding the trains and changing their configuration).Tekky wrote:Yes, I agree with that. OpenTTD (Transport Tycoon Deluxe) has conditional order jumping. I would love to see something like that in Factorio.
Thanks for getting the discussion going, I'm very interested to see where this leads us!
Advert
Re: Train Entry-Condition
Maybe something like this:
Train station lists (schedule) works like a playlist.
Replace Manual/Automatic slider with play/pause = automatic/manual;
Add next/prev buttons = go to next/previous station on the list (in manual mode, or manually skip station in automatic)
Each station can send "departure" signal with value.
departure = 0 => no signal, just wait for signal.
departure = 1 => go to next station (current+1) on the list.
departure = 2 => skip next and go directly to the current+2 on the list.
departure = -1 => back to previous station (current-1).
Then, in this example scenario, current station can detect coal with "read train fuel", and based on this, send train to coal station with "departure=1", or directly to the OreStation, with "departure=2" signal. All You need, is to add "coal station" entry between stations in the schedule.
You may also make "decider station", which can detect trains cargo, and decide whether send it to "current+2" dropIron station, or "current+1" dropCopper station, or "current+3" - sorting station...
Train station lists (schedule) works like a playlist.
Replace Manual/Automatic slider with play/pause = automatic/manual;
Add next/prev buttons = go to next/previous station on the list (in manual mode, or manually skip station in automatic)
Each station can send "departure" signal with value.
departure = 0 => no signal, just wait for signal.
departure = 1 => go to next station (current+1) on the list.
departure = 2 => skip next and go directly to the current+2 on the list.
departure = -1 => back to previous station (current-1).
Then, in this example scenario, current station can detect coal with "read train fuel", and based on this, send train to coal station with "departure=1", or directly to the OreStation, with "departure=2" signal. All You need, is to add "coal station" entry between stations in the schedule.
You may also make "decider station", which can detect trains cargo, and decide whether send it to "current+2" dropIron station, or "current+1" dropCopper station, or "current+3" - sorting station...
Re: Train Entry-Condition
If schedules have a "jump"/"goto" condition, better to use absolute numbers (like code lines) than relative numbers (like suggested above). But just skipping a line is probably enough.
I like the idea. It would make refuelling-on-demand easy, and maybe a few other things, but isn't super important (like trains going backwards).
I like the idea. It would make refuelling-on-demand easy, and maybe a few other things, but isn't super important (like trains going backwards).
Re: Train Entry-Condition
Yes, if programs are train-based, it should be absolute.
In station-based, relative are better and simpler.
Relative jumps does not need to carry about all previous stations count.
If It is absolute, station need to know own position in the "program", or all programs must be the same.
In relative approach, all schedule may be as now, each train may have own, different with variable length.
Just few entries around programmed station needs to be in strict order. ALso, same routine may be used few times in one schedule.
Example:
1) getOre station
2) checkFuel station => logic here, sends departure=1 or 2, directing train to getFuel station, or directly to ore melting station.
3) GetFuel station => optional, conditional stop
4) Drop Ore station
5) checkFuel station => the same station as above, same logic as above, train goes to get more fuel, or to load ore (playlists loops if ends).
3) GetFuel station => optional, conditional stop
There, only positions 2/3 and 5/6 are "within program", rest is just regular schedule, any length.
In station-based, relative are better and simpler.
Relative jumps does not need to carry about all previous stations count.
If It is absolute, station need to know own position in the "program", or all programs must be the same.
In relative approach, all schedule may be as now, each train may have own, different with variable length.
Just few entries around programmed station needs to be in strict order. ALso, same routine may be used few times in one schedule.
Example:
1) getOre station
2) checkFuel station => logic here, sends departure=1 or 2, directing train to getFuel station, or directly to ore melting station.
3) GetFuel station => optional, conditional stop
4) Drop Ore station
5) checkFuel station => the same station as above, same logic as above, train goes to get more fuel, or to load ore (playlists loops if ends).
3) GetFuel station => optional, conditional stop
There, only positions 2/3 and 5/6 are "within program", rest is just regular schedule, any length.
Additional condition slot for trains
Abstract:
Another condition for trains, based on which the train decides whether it goes to the next station or skips it.
I'll start with an example. I have a train that supplies three factories with iron. It may happen, that the train unloads everything in the first factory and will then travel to the other two unnecessarily. With another condition slot it could be able skip the two stations and return to refill itself with iron immediately. The train would be only able to read it's own contents and not the circuit network. The train should also read cargo and fuel slots independently.
This could save a lot of time and ease congestion on railroads by avoiding unnecessary travels. It would also be useful for making of refueling stations.
Here's an example of such schedule: Station Name (go to condition) - wait (waiting condition)
Ironworks () - wait (full)
Factory A (Cargo: *>0) - wait (60 seconds)
Factory B (Cargo: *>0) - wait (60 seconds)
Factory C (Cargo: *>0) - wait (60 seconds)
Refuel (Fuel: Coal<50 AND SolidFuel<25 AND NukaFuel<1) - wait (10 seconds)
Explanation: There's no condition for Ironworks, so the train will always go there. Then the train checks it's contents and if it's not empty will go to Factory A, where it will wait for 60 seconds. Same goes for Factory B and C. If it IS empty, it will skip these stations. Then it checks it's fuel slots and if the conditions are true, it will go to refuel station. If not, it will continue directly back to Ironworks.
Another condition for trains, based on which the train decides whether it goes to the next station or skips it.
I'll start with an example. I have a train that supplies three factories with iron. It may happen, that the train unloads everything in the first factory and will then travel to the other two unnecessarily. With another condition slot it could be able skip the two stations and return to refill itself with iron immediately. The train would be only able to read it's own contents and not the circuit network. The train should also read cargo and fuel slots independently.
This could save a lot of time and ease congestion on railroads by avoiding unnecessary travels. It would also be useful for making of refueling stations.
Here's an example of such schedule: Station Name (go to condition) - wait (waiting condition)
Ironworks () - wait (full)
Factory A (Cargo: *>0) - wait (60 seconds)
Factory B (Cargo: *>0) - wait (60 seconds)
Factory C (Cargo: *>0) - wait (60 seconds)
Refuel (Fuel: Coal<50 AND SolidFuel<25 AND NukaFuel<1) - wait (10 seconds)
Explanation: There's no condition for Ironworks, so the train will always go there. Then the train checks it's contents and if it's not empty will go to Factory A, where it will wait for 60 seconds. Same goes for Factory B and C. If it IS empty, it will skip these stations. Then it checks it's fuel slots and if the conditions are true, it will go to refuel station. If not, it will continue directly back to Ironworks.
Re: Additional condition slot for trains
I like the idea.
However, it has already been suggested half a year ago in the following thread:
viewtopic.php?f=6&t=49214 Train Entry-Condition
EDIT: The above link now points to the current thread, because the threads have now been merged.
However, it has already been suggested half a year ago in the following thread:
viewtopic.php?f=6&t=49214 Train Entry-Condition
EDIT: The above link now points to the current thread, because the threads have now been merged.
Last edited by Tekky on Mon Jan 29, 2018 7:18 pm, edited 1 time in total.
Re: Train Entry-Condition
[Koub] Merged into older topic with same suggestion.
Koub - Please consider English is not my native language.
-
- Burner Inserter
- Posts: 7
- Joined: Wed Dec 20, 2017 3:21 am
- Contact:
Re: Train Entry-Condition
yes absolutely want this. the only way to do this right now is to lay down a red/green cable network thru your whole play (which i kinda like but its a lot to do)Advert wrote:Just like Exit-conditions that are in the game, Pre-conditions would be nice, too.
They'd work just like exit ones, except the train checks them before it makes a route to the next station.
and use combinators to check conditions on others stations , if fullfilled you could send them... depends on what u need and its very limited option.
The function, for trains, is missing which enables the possibility to precheck a condition and if false, skip to the next station in the order.
esp for supply trains it would be so awesome, i like having my base and subbases fully automated with bots and trains. Like solar farm supply trains.
So instead of wasting time, railspace and materials, the train would check if the stations needs resupply, if not then relax in the main base.
Re: Train Entry-Condition
I was going to make a suggestion about that, and found this topic.
Today, if you do that, you will see that trains that are moving from B to C will go straight to A.
That is exactly what could be done. But instead of only a global "close station" you have the train evaluating if it should go to station.
Usually you see something like that to try get over it
And if a new signal was implemented to read the train fuel value, a fuel station would became straight forward.
I would imagine something like that:
The basic flow would be:
Flexible train schedule
Flexible train schedule or an options for a train to skip stations. Similar for the Wait condition but for entry the station stead of leaving.What ?
The "Entry" station condition would be very very very very..... helpful, you see mods that do "smart trains" like Logistic Train Network, The Fat Controller, fuel station and others what is the main reason for those mods?Flexible trains schedule
- Go to Station A
Go to Station B
Go to Station C
Today, if you do that, you will see that trains that are moving from B to C will go straight to A.
That is exactly what could be done. But instead of only a global "close station" you have the train evaluating if it should go to station.
Usually you see something like that to try get over it
- Go to Station A
Go to Station B
Go to Station A
Go to Station B
Go to Station A
Go to Station B
Go to Station C <-- trying to pass here less times
And if a new signal was implemented to read the train fuel value, a fuel station would became straight forward.
I would imagine something like that:
- 1. The same interface that we have now, with one more "division" for the entry condition
2. The entry conditions will have less conditions available as the exit condition, like "Inactivity" and "wait X" don't make to much sense for going in.
- Station 1 > Iron ore Loader A
Station 2 > Iron ore Loader B
Station 3 > Iron smelter X
Station 4 > central trains stop (fuel and maintenance)
The basic flow would be:
- 1. Go to Loader A
2. Go to Smelter X
- SETP. Target Station (Entry condition) (Leave condition)
- 1. Go to Loader A ( ) (Leave if inactive for 5sec)
2. Go to Loader B (If cargo < 5000) (Leave if inactive for 5sec OR cargo full)
3. Go to Smelter X ( ) (leave cargo empty)
4. Go to central (if fuel < 100) (wait 10sec)
- 1. The train finish his task at Station A (complete the Wait condition)
2. Before he jump to the next station, he check the entry condition for the next station. The train still in station A so it could read circuit network if needed.
2.1 If there is no condition, the train will go to the station
2.2 If there is a condition and the condition is TRUE, the train will go to the station
2.3 if there is a condition but the condition is FALSE, the train will get the Next station and start the step "2" again. (check the entry condition) (the train still in the Station A)
Why ?
That would make the game much more dynamic and fun, as well accomplish what some mods like "Logistic Trains Network", "The Fat Controller", "Fuel Station" try to do.- Deadly-Bagel
- Smart Inserter
- Posts: 1498
- Joined: Wed Jul 13, 2016 10:12 am
- Contact:
Re: Train Entry-Condition
We recently got the ability to disable stations but this is only a half-solution. It can't be selective of which trains can stop there and which can't, it's all or nothing, so it's useless for a fuel depot and many other use-cases.
Giving trains the ability to a) set conditions based on fuel, and b) skip a stop based on a condition would pretty much cover all vanilla requirements. Sure, a few will want to get into proper train programming and the like but that's what mods are for.
Once I would have said the current system is enough, however with the complexity of Nuclear Power it can be a bit awkward to ship around the Sulphuric Acid, especially if your reactors are off-site.
Giving trains the ability to a) set conditions based on fuel, and b) skip a stop based on a condition would pretty much cover all vanilla requirements. Sure, a few will want to get into proper train programming and the like but that's what mods are for.
Once I would have said the current system is enough, however with the complexity of Nuclear Power it can be a bit awkward to ship around the Sulphuric Acid, especially if your reactors are off-site.
Money might be the root of all evil, but ignorance is the heart.
Re: Train Entry-Condition
Yeh.
While the devs don't consider that feature over others, we'll need to be happy with mods
While the devs don't consider that feature over others, we'll need to be happy with mods

-
- Long Handed Inserter
- Posts: 95
- Joined: Fri Mar 01, 2019 7:56 am
- Contact:
Re: Train Entry-Condition
Sorry to ressurect an old sugestion topic, but I'd rather do this than make a new one with the same suggestion.
Adding a condition on a target station would be a very good addition to the game in my opinion.
It would also fit the logic of the game as well, the train is at a stop and checks if it fullfulls the next stop conditions, if not it skips that stop and checks the conditions of the stop after that, etc. If no stops satisfy the conditons the train remains in the current station.
Coupling this with the circuit network would make scenarions like "go to the unload station with the least amount of iron in storage" possible.
Adding a condition on a target station would be a very good addition to the game in my opinion.
It would also fit the logic of the game as well, the train is at a stop and checks if it fullfulls the next stop conditions, if not it skips that stop and checks the conditions of the stop after that, etc. If no stops satisfy the conditons the train remains in the current station.
Coupling this with the circuit network would make scenarions like "go to the unload station with the least amount of iron in storage" possible.
Re: Train Entry-Condition
As a long-time train optimiser, I would *love* to see conditional station orders in the game. It would solve many issues I have with trains / fueling them in a smarter way.
Currently there is no easy way to fuel your trains aside from sending them to a station to refuel (potentially leading to either many different refuel stations / names or much traffic at one station that doesn't actually do very much) or to bring fuel to all your stations, both of which are really inefficient.
There are also many other ways in which conditional orders can smartly be used, i.e. skipping a delivery if your cargo is already empty or continue delivering if you still have some left over.
Currently there is no easy way to fuel your trains aside from sending them to a station to refuel (potentially leading to either many different refuel stations / names or much traffic at one station that doesn't actually do very much) or to bring fuel to all your stations, both of which are really inefficient.
There are also many other ways in which conditional orders can smartly be used, i.e. skipping a delivery if your cargo is already empty or continue delivering if you still have some left over.