Page 6 of 8

Re: Train station skipping conditions

Posted: Wed May 03, 2017 11:07 pm
by <NO_NAME>
sparr wrote:Bumping this thread. I'm not a fan of a lot of the additional ideas put forward in the middle of the thread, but I would still very much like to see my original idea implemented. I am going to try to implement it as a mod, if I can figure out all the UI stuff.
I'm looking forward to it.

If you succeed, please add condition 'Skip if any other station is not skipped'. It would allow trains to go to a depot when they have nothing to do.

Re: Train station skipping conditions

Posted: Fri May 05, 2017 10:57 am
by kamiza
sparr wrote:
leoch wrote:You can do this in 0.15 by using the circuit network to disable stations. Mind, it doesn't work well with multiple trains and might require you building long-distance circuit networks.
I don't want every train to skip the iron loading station, I only want trains already full of iron to skip it. I don't want every train to skip the third iron dropoff station, I only want empty trains to skip it.
Agree.

It would be nice if the train would at least know the -kind- of stop it was going to next
A: unloading - if (own cargo) empty, skip
B: loading - if (own cargo) full, skip
At the very least, that should just be a simple checkbox / toggle between [L] and when adding a station
Maybe even choose item type to check for too (in-case carrying multiple types)

Then maybe something that can check for fuel? Or add [F]uel type.

Granted...I guess I have done situations where I have done both in 1 stop, that I loaded to 1 cargo and unloaded from another. Could then add additional toggles oth and/or [N]one so would skip that logic
But really...I'm sure you can find an example for any case to counter everything, but then we wouldn't get features implemented.

Re: Train station skipping conditions

Posted: Fri May 12, 2017 9:00 am
by Engimage
I came up with the same idea here.

There could be a second set of rules for skipping station in addition to leave condition.
The decision about skipping station should be done when train picks its next station (and not on the move).

You can add following types of skipping conditions:
  • Cargo full
  • Cargo empty
  • Cargo contains certain item/amount
  • Fuel below/above certain value
  • Circuit network condition
By default skipping condition list is empty which defaults to current train behaviour.

This can ultimately extend train possibilities to make game even more awesome.
Examples follow:
  • Creating dedicated refueling stations
  • Creating on-demand logistics
  • Optimizing trains to serve multiple outposts
There are LOTS of possibilities. And the implementation is really simple!

Re: Train station skipping conditions

Posted: Fri May 12, 2017 10:56 am
by TheUnknown007
I think this already was in this thread (great minds think alike)
PacifyerGrey wrote:And the implementation is really simple!
You are not a programmer, are you?

Re: Train station skipping conditions

Posted: Fri May 12, 2017 1:44 pm
by Engimage
TheUnknown007 wrote: You are not a programmer, are you?
I am IT Manager, a mix of a sysadmin and project manager. I know programming.
And here I can freely judge. I know capabilities of Factorio devs. And I do understand this suggestion brings nothing new or complex to them as most of related stuff is already in the game.

Re: Train station skipping conditions

Posted: Fri May 12, 2017 4:05 pm
by sparr
TheUnknown007 wrote:
PacifyerGrey wrote:And the implementation is really simple!
You are not a programmer, are you?
I'm a programmer. I write Factorio mods. The only thing stopping me from writing this as a mod is the UI portion of the problem. The actual train logic code IS simple.

Re: Train station skipping conditions

Posted: Fri May 12, 2017 4:20 pm
by Selvek
PacifyerGrey wrote: There could be a second set of rules for skipping station in addition to leave condition.
Disclaimer - I haven't read the entire last year of this thread.

Would it be sufficient to have a check box saying "if wait condition is already met, skip station"? IE if your wait condition is "wait until cargo empty" and the cargo is already empty, the station is skipped. I imagine this would simplify the implementation since you don't need a whole separate section for defining skip conditions.

Or, are there behaviors people need where the skip and wait conditions would need to be separate? E.G. if your wait condition is "wait 30 seconds" there would be no way to skip the station (without adding an OR to the wait condition). But I feel like personally I could do everything required without separating the conditions.

----

Wait a second... hold on... I imagine a grid inside engines which you can place combinators in, with input ports from the fuel and cargo inventories as well as external circuit connections through the current train stop, and an output that can be used to set the train's destination...

Re: Train station skipping conditions

Posted: Fri May 12, 2017 4:46 pm
by sparr
Selvek wrote:
PacifyerGrey wrote: There could be a second set of rules for skipping station in addition to leave condition.
Disclaimer - I haven't read the entire last year of this thread.

Would it be sufficient to have a check box saying "if wait condition is already met, skip station"? IE if your wait condition is "wait until cargo empty" and the cargo is already empty, the station is skipped. I imagine this would simplify the implementation since you don't need a whole separate section for defining skip conditions.
The fifth post in this thread is a gui mockup of exactly that.

Re: Train station skipping conditions

Posted: Fri May 12, 2017 5:01 pm
by Selvek
sparr wrote:
Selvek wrote:
PacifyerGrey wrote: There could be a second set of rules for skipping station in addition to leave condition.
Disclaimer - I haven't read the entire last year of this thread.

Would it be sufficient to have a check box saying "if wait condition is already met, skip station"? IE if your wait condition is "wait until cargo empty" and the cargo is already empty, the station is skipped. I imagine this would simplify the implementation since you don't need a whole separate section for defining skip conditions.
The fifth post in this thread is a gui mockup of exactly that.
Good thing I added the disclaimer then ;)

Re: Train station skipping conditions

Posted: Mon Jun 12, 2017 6:59 pm
by Tinyboss
Selvek wrote:
PacifyerGrey wrote: There could be a second set of rules for skipping station in addition to leave condition.
Disclaimer - I haven't read the entire last year of this thread.

Would it be sufficient to have a check box saying "if wait condition is already met, skip station"? IE if your wait condition is "wait until cargo empty" and the cargo is already empty, the station is skipped. I imagine this would simplify the implementation since you don't need a whole separate section for defining skip conditions.
I can't think of a situation where this wouldn't be sufficient. Granted, I've only been thinking a minute or so, but at least all the scenarios I've already run into where I want to skip stations would be solved by this. And if we just made that the default train behavior, it wouldn't require any UI change at all!
sparr wrote:
TheUnknown007 wrote:
PacifyerGrey wrote:And the implementation is really simple!
You are not a programmer, are you?
I'm a programmer. I write Factorio mods. The only thing stopping me from writing this as a mod is the UI portion of the problem. The actual train logic code IS simple.
I've only written one (simple) mod, and it didn't touch trains, so I don't know...is this change something a mod could accomplish?

Re: Train station skipping conditions

Posted: Mon Jun 12, 2017 9:39 pm
by Lubricus
PacifyerGrey wrote:I came up with the same idea here.

There could be a second set of rules for skipping station in addition to leave condition.
.....

This can ultimately extend train possibilities to make game even more awesome.
Examples follow:
  • Creating dedicated refueling stations
  • Creating on-demand logistics
  • Optimizing trains to serve multiple outposts
There are LOTS of possibilities. And the implementation is really simple!
[*]Creating on-demand logistics - Is already possible. Turn on the station that has the demand, turn it of when the demand is fulfilled. Wire the train-station to the buffer-chests
[*]Optimizing trains to serve multiple outposts - Name the outposts the same and turn them on when they have enough stuff.
[*]Creating dedicated refueling stations - No idea how to do it with the current system, would be fun to be able to.

Re: Train station skipping conditions

Posted: Tue Jun 13, 2017 7:57 am
by Engimage
Lubricus wrote: [*]Creating on-demand logistics - Is already possible. Turn on the station that has the demand, turn it of when the demand is fulfilled. Wire the train-station to the buffer-chests
[*]Optimizing trains to serve multiple outposts - Name the outposts the same and turn them on when they have enough stuff.
[*]Creating dedicated refueling stations - No idea how to do it with the current system, would be fun to be able to.
Problems with current system of turning stations on/off:
  • Turning station off while train is in transit requires train to loop somewhere which is not good for many layouts like dual head design - or the train will just stuck and lock the system down.
  • Using same name for multiple outposts results in unbalanced outpost resource drain. Not a major issue but still...
Also by creating on-demand logistics I meant that you gain the ability to control delivery point of a train using circuit network and it does not require turning off any stations and catching loaded trains in transit offguard as a result. This can lead to multiple cool solutions that currently people can't even come up with.

Re: Train station skipping conditions

Posted: Tue Jun 13, 2017 9:51 am
by mrvn
Tinyboss wrote:
Selvek wrote:
PacifyerGrey wrote: There could be a second set of rules for skipping station in addition to leave condition.
Disclaimer - I haven't read the entire last year of this thread.

Would it be sufficient to have a check box saying "if wait condition is already met, skip station"? IE if your wait condition is "wait until cargo empty" and the cargo is already empty, the station is skipped. I imagine this would simplify the implementation since you don't need a whole separate section for defining skip conditions.
I can't think of a situation where this wouldn't be sufficient. Granted, I've only been thinking a minute or so, but at least all the scenarios I've already run into where I want to skip stations would be solved by this. And if we just made that the default train behavior, it wouldn't require any UI change at all!
Making it the default would be bad. I had setups where trains stop at all stations until they get "Circuit condition G=1". Same condition on every stop. So the train would skip all future stops.

Re: Train station skipping conditions

Posted: Tue Jun 13, 2017 10:23 am
by mp0011
viewtopic.php?f=6&t=49214&p=286148#p286097

There is my suggestion about skipping stations - last station You leave should decide about this, using Logic Circuit.

Re: Train station skipping conditions

Posted: Tue Jun 13, 2017 11:52 am
by TheUnknown007
mp0011 wrote:viewtopic.php?f=6&t=49214&p=286148#p286097

There is my suggestion about skipping stations - last station You leave should decide about this, using Logic Circuit.
Yes, we had come to the same conclusion

Re: Train station skipping conditions

Posted: Wed Jun 14, 2017 8:36 pm
by Daz3
I'm not a programer so not sure if this could be worked but...

If each station is connected to it's buffer chests then it could put out to the rail-network (as opposed to the circuit or logistic nets) the condition of it's supplies. (Have coal or need coal for example.)

A train with that stop next in it's list would check on the 'rail-net' the condition of the station and decide to attend it or not:

Station A; wants coal. (Power plant)

Station B; has coal. (Coal mine)

Train C is empty; it's next stop is A, then B. As it has no coal it skips A and goes to B.

Train D has a full load of iron. It's next stop is B (Just for the example.) Then A. As it is loaded it skips B. As it's loaded with Iron it skips A, and keeps doing so until it finds a station that wants iron. Or get's stuck in a loop not knowing what to do but that kind of learning is part of the fun! (Program your trains better!)

Just my thoughts on the matter; sort of a hybrid theory, I guess...

Re: Train station skipping conditions

Posted: Wed Jun 14, 2017 11:05 pm
by sparr
Lubricus wrote:[*]Creating on-demand logistics - Is already possible. Turn on the station that has the demand, turn it of when the demand is fulfilled. Wire the train-station to the buffer-chests
You've only solved half the problem. How do I stop a full train from visiting a station with supply?

Re: Train station skipping conditions

Posted: Thu Jun 15, 2017 7:40 am
by Engimage
This will not allow creating a train logistic network but it would allow for much more creative solutions coming close to it.
If you want a train logistic network there is a mod for that.

Re: Train station skipping conditions

Posted: Thu Jun 15, 2017 2:27 pm
by TheVeteraNoob
Where are the devs in all this. This topic is far too old and lacking entirely in purple chat.

Re: Train station skipping conditions

Posted: Fri Sep 01, 2017 12:42 pm
by guy smiley
It's probably worth noting here, that the train system already does calculation on which station to visit next, at the time it is about to leave the station it's currently at. It's just that, at the moment, the only criteria it checks for is whether a station has the name it's looking for (any number between 0 and all stations currently existing COULD have this), and which of those matches it can get to quickest. Simple algorythm, sure, but one that definitely already exists. Basically all that's being proposed here is including the ability for the player to add their own custom conditions to this already existing process, using a slightly modified but basically already existing UI and code base. Really not sure if there's some major problem with this on the dev's side, but can't imagine how there would be.

Also, conditions that check the trains own fuel state would be nice too.