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

Change: Increase maximum number of orders from 64000 to ~16.7m. #7220

Merged
merged 1 commit into from Feb 18, 2019

Conversation

@PeterN
Copy link
Member

@PeterN PeterN commented Feb 11, 2019

This fixes #6968. Turns out it is apparently trivial to increase the maximum number of orders, and doesn't even need a bump, though #7219 is useful in that case.

@@ -25,7 +25,7 @@ static const VehicleOrderID INVALID_VEH_ORDER_ID = 0xFF;
static const VehicleOrderID MAX_VEH_ORDER_ID = INVALID_VEH_ORDER_ID - 1;

/** Invalid order (sentinel) */
static const OrderID INVALID_ORDER = 0xFFFF;
static const OrderID INVALID_ORDER = 0xFFFFFF;
Copy link
Contributor

@glx22 glx22 Feb 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this change require conversion on load ?

Copy link
Member Author

@PeterN PeterN Feb 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orders are stored as references which already does the magic. See 1fa98e1 for a similar change, 9 years ago :-)

There would also be an issue if OrderID was passed in commands, but it seems VehicleOrderIDs are used instead.

@J0anJosep
Copy link
Contributor

@J0anJosep J0anJosep commented Feb 17, 2019

What about merging this one?

@James103
Copy link
Contributor

@James103 James103 commented Feb 17, 2019

If this pull request is merged, the following limits and stats will change:

  • If each order list has 255 orders, then the max number of order lists increases from 251 to 65,794.
  • If each company has 20,000 vehicles and there are 15 companies, then the maximum average number of orders per vehicle increases from 0.21 to 55.7 orders.

@PeterN PeterN merged commit 8496103 into OpenTTD:master Feb 18, 2019
8 checks passed
@PeterN PeterN deleted the more-orders branch Feb 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants