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 1 commit into from Feb 18, 2019


None yet
5 participants
Copy link

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;

This comment has been minimized.


glx22 Feb 11, 2019


Doesn't this change require conversion on load ?

This comment has been minimized.


PeterN Feb 11, 2019

Author Member

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.


This comment has been minimized.

Copy link

J0anJosep commented Feb 17, 2019

What about merging this one?


This comment has been minimized.

Copy link

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

@PeterN PeterN deleted the PeterN:more-orders branch Feb 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.