The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Simutrans-Extended future development discussion => Topic started by: zook2 on August 30, 2021, 08:55:38 AM

Title: Ship changes line on its own
Post by: zook2 on August 30, 2021, 08:55:38 AM
A weird one (and reproducible):
on the BB server, go to the dock at 217,600 (password: pw). Buy a boat, set the line to "#- Welsh Potatoes". It shows up in the line list in the white font. Launch it. A second later it disappears from the potato line and is now in "#- Welsh Bulk & Goods".
Title: Re: Ship changes line on its own
Post by: zook2 on September 14, 2021, 05:39:48 PM
Confirmed now. If I have two lines with identical stops (e.g. one freight line and one cargo), the game often auto-assigns a new convoy to the other line (perhaps based on some kind of internal line ID?) and not the one I selected in the depot. A second after leaving the depot my "Foo - Bar Express" passenger train slips into "Foo - Bar Cargo Express". After manually reassigning it, everything's OK.
Title: Re: Ship changes line on its own
Post by: Mariculous on September 14, 2021, 07:27:38 PM
I'm not sure if this is a bug or a feature...
What's going on is that that the line comparator method used to compare schedules is used to select a line with the same schedule.
If they match, the first matching line will be assigned.
Title: Re: Ship changes line on its own
Post by: Matthew on September 14, 2021, 10:12:06 PM
It seems that this can be worked around relatively easily using waypoints. But it's undocumented and confusing, especially for new players.
Title: Re: Ship changes line on its own
Post by: Mariculous on September 15, 2021, 09:49:41 AM
Definitely. This is confusing and should be fixed.

I am not exactly sure about the intention of this code.
This behavior seems to be meant to re-assign the original line of a convoy when it's leaving the depot as the line is unassigned when a convoy enters the depot.
This method (schedule_t::matches) is based on more than just the waypoints. It does also account for the schedule options.

I am wondering if instead of this admittedly confusing re-assignment mechanism, convoys should instead "simply"* not un-assign their line when entering a depot.
The same can be observed in further cases, e.g. when changing the schedule of a convoy outside of the depot.

*I did not yet check how simple this actually is.
Title: Re: Ship changes line on its own
Post by: jamespetts on January 21, 2022, 09:54:47 PM
I believe that this is a long established original feature dating from before Extended was forked from Standard.