Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timetable "Start date" with shared orders setting dates in the past #8584

Closed
tpetazzoni opened this issue Jan 17, 2021 · 4 comments
Closed

Comments

@tpetazzoni
Copy link

Version of OpenTTD

Git at commit 3e7c757

Expected result

When doing Ctrl + Start Date on a time table, I expect all vehicles sharing this order to have "Start Dates" nicely spread out, but all of those start dates should be in the future.

Actual result

When doing Ctrl + Start Date on a time table, and entering a Start Date in the future, some of the actual start dates assigned to a number of vehicles are in the past.

Steps to reproduce

Create for example 6 busses that share orders. Fill in the time table, then Ctrl + click on Start Date. You will see that some of the Start Dates of other vehicles with the shared orders will be in the past.

For example in the attached screenshot, I have 6 busses sharing orders. The game is paused on October 18, 1953. I am setting the Start Date of the Vehicle number 1 to November 1st, 1953, which is in the future compared to now. Note that the screenshot is taken with me having already set this Start Date, so all Vehicles have already had this Start Date assigned. You can see the following:

  • Vehicle 1 starts on November 1st, 1953, which is OK
  • Vehicle 2 starts on October 12, 1953, which is in the PAST
  • Vehicle 3 starts on August 8, 1953, which is in the PAST
  • Vehicle 4 starts on November 21, 1953, which is OK
  • Vehicle 5 starts on September 1st, 1953, which is in the PAST
  • Vehicle 6 starts on September 21, 1953, which is in the PAST
    gnome-shell-screenshot-6CLDX0
@James103
Copy link
Contributor

From what you have, can you try doing "Start Date" again (with the same date, game still paused) on the vehicle whose timetable is scheduled to start the earliest (in this case "Road Vehicle 3")?

@2TallTyler
Copy link
Member

Per the source code and its comments, start dates less than a year in the past are allowed. This isn't necessarily a bug, but an unexpected behavior.

https://github.com/OpenTTD/OpenTTD/blob/master/src/timetable_cmd.cpp#L270-L274

@nchappe
Copy link
Contributor

nchappe commented Jul 23, 2022

I think this is really a bug. Only the start date of the selected vehicle is checked, and the other vehicles can end up with a start date several years in the past. It can break the other invariants too (date after MAX_DAY, etc.).
To avoid having start dates in the past, it seems the player has to be careful to use the timetable window of the first vehicle as sorted by VehicleTimetableSorter, i.e. the first vehicle able to reach the first station of the order list.

nchappe added a commit to nchappe/OpenTTD that referenced this issue Jul 23, 2022
@LordAro
Copy link
Member

LordAro commented Jul 24, 2022

I wonder if this is the cause of #8054

Joel-Milligan pushed a commit to Joel-Milligan/OpenTTD that referenced this issue Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants