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

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

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

What about merging this one?

@James103
Copy link
Contributor

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
@PeterN PeterN deleted the more-orders branch February 18, 2019 07:37
nielsmh pushed a commit to nielsmh/OpenTTD that referenced this pull request Mar 11, 2019
douiwby pushed a commit to douiwby/OpenTTD that referenced this pull request Apr 16, 2020
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

Successfully merging this pull request may close these issues.

No more space for orders
5 participants