[kovarex] [0.17.76] Train Can't Path When Moving Backwards

This subforum contains all the issues which we already resolved.
Post Reply
wizard07ksu
Inserter
Inserter
Posts: 23
Joined: Fri Dec 29, 2017 11:00 am
Contact:

[kovarex] [0.17.76] Train Can't Path When Moving Backwards

Post by wizard07ksu »

This will probably get moved to minor issues.

I got in a train and changed the mode to manual, then started moving backwards. My train setup was LCCC, and I was on a dead-end track. By moving backwards, I'd get back onto the main rail system. While the train was moving backwards, I clicked on the engine and tried to set a temporary destination (using CTRL+CLICK in the train GUI) somewhere but got an error message "No path to destination". The train was on the main rail system by then, and if I stopped the train and tried again it would work just fine.

Since automatic trains will only go "forward" relative to the direction of an engine on the train, and can only go in both directions if there are at least 2 engines, I would have expected a train facing along the track (the direction the engine is pointed in) would be able to move in that direction if you set a reachable temporary destination.

This behavior is inconsistent with a train in manual mode with a pre-set station, and then you change the train to "automatic". The train will immediately come to a stop, then start moving "forwards" towards the set station.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.17.76] Train Can't Path When Moving Backwards

Post by Klonan »

Can you provide a save game or a screenshot of the exact setup and series of events?

User avatar
TruePikachu
Filter Inserter
Filter Inserter
Posts: 978
Joined: Sat Apr 09, 2016 8:39 pm
Contact:

Re: [0.17.76] Train Can't Path When Moving Backwards

Post by TruePikachu »

I think I might have encountered this one myself. The gist of repro steps would be:
  • Make a good-length section of rail
  • Put a single locomotive, with fuel, on the rail
  • Drive the locomotive backwards in manual mode
  • While still driving backwards, open the train's GUI and set a temporary stop somewhere in front of it (in terms of the way it's facing; if the locomotive is facing north and you were driving it south, the stop would be placed north of the locomotive).
I just repro'd the report successfully using these steps. You're also not able to drop such a stop on the other side either, but that's more due to it being behind the train.


That said, I'm not 100% sure if this would be classified as a bug or not. In a nutshell, the current core behaviour is such that if a train is moving, it won't attempt to establish a path that would result in it stopping and reversing; it would instead create a path in the direction of its current travel. While this "contradicts" the behaviour that occurs if you set a real stop and then put the train in auto mode (where the train will stop and reverse, but more due to the failure to find a path stopping it and the reversing happening once it attempts to find a path after stopping), it's still important for the use case of doubleheaded trains on bidirectional track; if the path becomes invalidated for whatever reason while travelling at speed, you probably don't want the train to stop and reverse down the track it came from (since it would "waste" the energy it took to get up to speed initially).

My vote would be to leave things the way they are, since the only alternatives would be to either (a) special-case a forced stop of a moving train when setting a temporary stop, which might require (b) a recode of part of the rail pathfinder so it can look in the opposite direction while moving.

wizard07ksu
Inserter
Inserter
Posts: 23
Joined: Fri Dec 29, 2017 11:00 am
Contact:

Re: [kovarex] [0.17.76] Train Can't Path When Moving Backwards

Post by wizard07ksu »

@TruePikachu

That is exactly the series of steps to reproduce this.

I filed this as a bug report since the behavior seemed odd to me. I'm fine with this being classified as "not a bug" - I did search there first but couldn't find anything related to this.

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

Re: [kovarex] [0.17.76] Train Can't Path When Moving Backwards

Post by boskid »

Ref 73377

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

Re: [kovarex] [0.17.76] Train Can't Path When Moving Backwards

Post by boskid »

Thanks for the report. It is now fixed for 0.18.9. There may be some tiny artifacts left, like gui showing path in trains opposite direction when pointing with mouse to somewhere while train will prefere going into same direction, but this should no longer prevent setting temporary train stop when train requires changing direction.

Post Reply

Return to “Resolved Problems and Bugs”