Rail that pathfinding sees as 100 units long instead of 1
Moderator: ickputzdirwech
Rail that pathfinding sees as 100 units long instead of 1
Basically a "dense" rail you can use that is normal except the path-finding algorithm "sees" it as 100 units long (or a variable length) instead of 1 unit.
Allows much easier control of path-finding selection of routes for trains to travel, as well as easy prevention of trains taking "short-cuts" through stations or sidings they aren't supposed to be on.
Picture example of what could be avoided
Red - Path the train currently takes.
Green - Path I would like the train to take.
Having a piece of rail to make the red path "longer" than it actually is easily remedies this sort of problem.
Allows much easier control of path-finding selection of routes for trains to travel, as well as easy prevention of trains taking "short-cuts" through stations or sidings they aren't supposed to be on.
Picture example of what could be avoided
Red - Path the train currently takes.
Green - Path I would like the train to take.
Having a piece of rail to make the red path "longer" than it actually is easily remedies this sort of problem.
Re: Rail that pathfinding sees as 100 units long instead of 1
Plug a train stop in, add signals.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Rail that pathfinding sees as 100 units long instead of 1
This is bad solution. I tried it and putting fake train stations slows the trans down as they have to stop on them. OPs idea is much more viable IMHO.ssilk wrote:Plug a train stop in, add signals.
Another way would be to add yet another rail signal, that would work like train stations but wouldnt require trains to stop at it.
Re: Rail that pathfinding sees as 100 units long instead of 1
A train doesn't has to stop on a trainstop. Only if you put it in the schedule.oLaudix wrote:This is bad solution. I tried it and putting fake train stations slows the trans down as they have to stop on them. OPs idea is much more viable IMHO.ssilk wrote:Plug a train stop in, add signals.
But it adds points to the pathfinder, if it is on the way. Which leads a train to think, another way is maybe shorter.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Rail that pathfinding sees as 100 units long instead of 1
Maybe the pathfinding algorithm could be tweaked by having the train factor in how much other tracks he crosses or weighs 'tracks with crossings' more than those don't in the case when distance is almost equal?
-
- Filter Inserter
- Posts: 952
- Joined: Sat May 23, 2015 12:10 pm
- Contact:
Re: Rail that pathfinding sees as 100 units long instead of 1
adding a more costly track will increase path finding cost for trains that need to go through them. Perhaps a constant cost going through a stop which won't affect path to the stop.
in this solution you can just cut the track that provides the looping part (in particular the bottom left part curving upwards to connect to the main line)
in this solution you can just cut the track that provides the looping part (in particular the bottom left part curving upwards to connect to the main line)
Re: Rail that pathfinding sees as 100 units long instead of 1
It sounds more like you're looking for a form of 1-way rail block. Trains traveling against this block would incur a pathing penalty, while trains going the way you want continue happily.
Re: Rail that pathfinding sees as 100 units long instead of 1
A much simpler solution would be to implement waypoints, which could be added like train stops.
Or we could change the train stop so that if we set zero as the time, the train should just drive through without stopping at all.
Much more intuitive than a special piece of rail we later forget about and don't understand why the trains take a weird path. Much easier if you could see the waypoints in the list of train stops.
Or we could change the train stop so that if we set zero as the time, the train should just drive through without stopping at all.
Much more intuitive than a special piece of rail we later forget about and don't understand why the trains take a weird path. Much easier if you could see the waypoints in the list of train stops.
Last edited by Val on Fri Jul 31, 2015 2:11 pm, edited 1 time in total.
Re: Rail that pathfinding sees as 100 units long instead of 1
The suggested approach is simple to implement and integrate in almost any existing pathfinding system, which is why it's found common use in some contexts, but I agree it's not ideal from a player's perspective. Waypoints could be a solution for many cases; the ability to somehow designate track "station only" could be nice as well. Like, a special kind of signal, paired to one or more stations, that says "can't cross this unless you're headed to one of these stations."Val wrote:A much simpler solution would be to implement waypoints, which could be added like train stops.
Or we could change the train stop so that if we set zero as the time, the train should just drive through without stopping at all.
Much more intuitive than a special piece of rail we later forget about and don't understand why the trains take a weird path. Much easier if you could see the waypoints in the list if train stops.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
Re: Rail that pathfinding sees as 100 units long instead of 1
a waypoint system would work just as well as my suggestion, extra train stops don't seem to be the best solution as that would also fill the list of train stops with "detour around xx" stops or such. As for not being able to remember where such rail has been placed, just making the section of rail a red color or such would make it easily visible.
As for what ssilk said, there is already a train stop it runs through taking the "shortcut" vs the other rail.
As another poster also put, adding a rail section like this is generally very simple to implement while not quite ideal from a player perspective.
As for what ssilk said, there is already a train stop it runs through taking the "shortcut" vs the other rail.
As another poster also put, adding a rail section like this is generally very simple to implement while not quite ideal from a player perspective.
Re: Rail that pathfinding sees as 100 units long instead of 1
I'd love to see this and other things like "high-speed tracks" that works like highways for trains, where no trains could stop on those tracks. So I could run a 4 line (2 going 2 going back) everywhere. The middle tracks would be for the train to travel long distances, and it would hop into the outside track when it's close to the station. The actual concept I developed is more complex than this, but you get the point.
Re: Rail that pathfinding sees as 100 units long instead of 1
No, I said, that placing the train stop is like placing some special kind of signal, that adds waypoints and the train tries to find a "better" way. This is the solution I would prefer. This is a quick fix solution for now.delassa wrote:As for what ssilk said, there is already a train stop it runs through taking the "shortcut" vs the other rail.
As I see it there are these two options:
- Having a special entity, that adds a lot of waypoints, so that the trains avoid this way and only drive it, if they really need to go to a station there.
Some kind of static signal, a special rail-type or whatever.
- Having a "waypoint" station, a train-stop, where the trains just need to pass by.
This includes, that the trains need to be (re-)programmed. Which I think it is not needed, cause of the first solution.
But I dunno.
Both can be simulated, the first by placing a train-stop (where the train will not halt) or more signals. I'm not so sure about this. The second by using the train-stop with 0 seconds waiting time (but the train will still stop). I will play around with these options.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Rail that pathfinding sees as 100 units long instead of 1
Let me know what you come up with, I'd be interested to see what kind of temporary solutions can be used to fix the problem for the time being.
Right now the solution I use is just to separate the in/out lines so that the pathway along the "shortcut" isn't continuous which of course keeps the trains from going there.
Right now the solution I use is just to separate the in/out lines so that the pathway along the "shortcut" isn't continuous which of course keeps the trains from going there.
Re: Rail that pathfinding sees as 100 units long instead of 1
I've tested this. There is currently no way to influence the path-finder by placing signals or train-stops.
All what's known about it is here: https://forums.factorio.com/wiki/inde ... th_finding
All what's known about it is here: https://forums.factorio.com/wiki/inde ... th_finding
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Rail that pathfinding sees as 100 units long instead of 1
I like the concept of setting "rail yard" areas separate from main lines. If we had some way to make a section as a railyard entrance then a train just doesn't route through that section unless it needs a location in that railyard.
Re: Rail that pathfinding sees as 100 units long instead of 1
Yes. The easiest way how it could be added yet would be to have a "sign", which adds points to the pathfinder, that then tries to avoid this path.
The extension would be to have three different signs:
- A sign, that subtracts points from the pathfinder, so that he prefers this way, no matter, what's on there.
- A sign, that add points (as above).
- A sign, that adds even more points (so that you can create sub-areas).
I think the first solution is good enough, the second adds too much complexity.
I add also, that it would be in extreme cases a good idea, to have something, that shows, how the pathfinder works. I think to a debug-view and if you hover a train the path-values are drawed on each piece of track.
The extension would be to have three different signs:
- A sign, that subtracts points from the pathfinder, so that he prefers this way, no matter, what's on there.
- A sign, that add points (as above).
- A sign, that adds even more points (so that you can create sub-areas).
I think the first solution is good enough, the second adds too much complexity.
I add also, that it would be in extreme cases a good idea, to have something, that shows, how the pathfinder works. I think to a debug-view and if you hover a train the path-values are drawed on each piece of track.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
-
- Filter Inserter
- Posts: 952
- Joined: Sat May 23, 2015 12:10 pm
- Contact:
Re: Rail that pathfinding sees as 100 units long instead of 1
Except that A* path finding (which I believe trains use) doesn't quite work with negative path costs. Because the heuristic needs to underestimate the best possible path to goal at all times.ssilk wrote:Yes. The easiest way how it could be added yet would be to have a "sign", which adds points to the pathfinder, that then tries to avoid this path.
The extension would be to have three different signs:
- A sign, that subtracts points from the pathfinder, so that he prefers this way, no matter, what's on there.
- A sign, that add points (as above).
- A sign, that adds even more points (so that you can create sub-areas).
I think the first solution is good enough, the second adds too much complexity.
I add also, that it would be in extreme cases a good idea, to have something, that shows, how the pathfinder works. I think to a debug-view and if you hover a train the path-values are drawed on each piece of track.
It's much simpler to create a rail/sign that has extra cost though with the danger that paths that need to go through it will waste time exploring paths that it will eventually not take.
optimizations for that are possible: for example keeping a list of stations that are known to need to pass through the sign. (or just stations within X cost)
Re: Rail that pathfinding sees as 100 units long instead of 1
Would simply adding a pathing penalty to every train stop fix most of this? If you're going to that stop, you don't care what the penalty is; that's your destination so you have to go there. But if you're just on your way to somewhere else, it might be faster to go around.