Temporary stations pathing problem

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
pejsek
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Apr 10, 2020 10:07 pm
Contact:

Temporary stations pathing problem

Post by pejsek »

Hello, can someone please help me? I built a track for my personal train for easy travelling around the map. This piece of track is only for one train so it has no signals. The problem is that when I hold CTRL to create a temporary station, it won't always choose the shortest path. It might be something to do with where the temp station is placed (on which side of the track). But I am not sure how that works. I have attached a video showing what I mean. It should be clear from the video. I can post more pictures/videos if needed. Thank you.

https://www.youtube.com/watch?v=ndYYMlIxjvc

Factorio 0.18.18
mmmPI
Smart Inserter
Smart Inserter
Posts: 3640
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Temporary stations pathing problem

Post by mmmPI »

i think your explanation is correct, it must depend on which side is your cursor relative to the track.

In the video it seems to act like if the game is trying to place an invisble station as close as possible from where the mouse is pointing.

In this case, you could see it as signals, they give orientation to the track. A signal on the right side of a vertical track would make it a one-way to the top, a signal on the left side of the vertical track would make it a one-way to the bottom.

If you use temp station on the right side of a vertical track , it seems like the train is going to try and reach destination while going toward the top.

if you use temp station on the left side of a vertical track, train will try to reach destination while going toward the bottom.

Like a temporary orientation.

That's just a guess after the video though
pejsek
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Apr 10, 2020 10:07 pm
Contact:

Re: Temporary stations pathing problem

Post by pejsek »

Thanks for your reply. The train doesn't seem to care where the cursor is though. Clicking on the other locomotive doesn't work either. I posted another video of me trying to change the orientation of the station.

https://www.youtube.com/watch?v=KpK3GXJbM0g

I recreated this in my sandbox save. I built a similar track and it happened again.

https://www.youtube.com/watch?v=LHzSx9lzkZw

On a simpler track, it works just fine. It chooses the shortest path. Could this be a bug?
mmmPI
Smart Inserter
Smart Inserter
Posts: 3640
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Temporary stations pathing problem

Post by mmmPI »

I will have another look at it because it doesn't seem like my guess was correct when looking at the newer videos it's obvious i missed something.

maybe there are other layer of logic, such as this "invisible station thing" but it's updated only when the cursor switch from a track section to another track section.

So by closely following a piece of track, you could "trick" the game into not updating the path, but when cursor goes above a junction and then goes past it, then the game tries again to place a station based on total distance rather than just "extending" previously found path ?

And this would also happens when instead of a junction it's another parralel track that temporarily become closer to the mouse, the "invisible station" would jump on the other track, and when going back to the original track, the path is again choosen based on total distance , which could lead to not getting the same path but having it "the other way around" if it's closer.

I am not sure how it works either that was just another guess.
pejsek
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Apr 10, 2020 10:07 pm
Contact:

Re: Temporary stations pathing problem

Post by pejsek »

I did some searching and it looks like this issue has already been discussed here.

viewtopic.php?f=48&t=74994
mmmPI
Smart Inserter
Smart Inserter
Posts: 3640
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Temporary stations pathing problem

Post by mmmPI »

Well thanks for sharing you findings, i'll stop whatever i could have tested, i don't think i'd be capable of testing more precisely than boskid and kovarex saying it's a minor issue makes me think that this will stay this way till version 1.0
pejsek
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Apr 10, 2020 10:07 pm
Contact:

Re: Temporary stations pathing problem

Post by pejsek »

Thank you for your effort. I think the issue should get more attention since this can get annoying with a really long track. And the conditions for this to happen are not unusual. I guess the only way to solve this is to redesign the rail tracks. Possibly by making it so that there is only one way to get to the places you want to go to. Still, this looks stupid to me:

Image
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3017
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Temporary stations pathing problem

Post by boskid »

This is known, minor issue and is related to how trains pathfinder works. In trains pathfinder, nodes are based on rail segments (series of rails without junctions, signals and train stops) and it is designed to work primarly with train stops. Since train stops are always at the end of rail segment, trains pathfinder will always add length of whole last rail segment that has goal. Temporary train stops violate one assumption - goal is not on the rail segment end. Because length of whole last rail segment is added when computing path from both sides and rail goal is bidirectional, it appears as penalty of last rail segment is not considered. I could fix this but it requires some extra checks inside of quite hot code, mainly to check if next node has a goal that is not on rail segment end and to create extra node in-the-middle with proper partial penalty of last rail segment. If other devs decide it would be better to have it fixed or when i find a good solution that does not have performance impact i will do it, but for now it is minor or wont fix.

By placing rail signals you will split rails into multiple rail segments and path to temporary train stop will be a little better.

74994 was due to last rail segment not being considered at all up to [0.17.79] but i fixed it for [0.18.0] when doing pathfinder optimisation. Only common part with this is viewtopic.php?p=453618#p453618
pejsek
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Apr 10, 2020 10:07 pm
Contact:

Re: Temporary stations pathing problem

Post by pejsek »

Thanks for your comment. Placing several signals along the loop makes it much more acceptable and it behaves more or less how one would expect.
Post Reply

Return to “Gameplay Help”