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 custom town max number limit to 20000 #6924

Closed

Conversation

SamuXarick
Copy link
Contributor

@SamuXarick SamuXarick commented Oct 1, 2018

When 4096x4096 became available, this limit was not scaled.

(5000 / (2048 * 2048)) * 4096 * 4096 = 20000

https://www.tt-forums.net/viewtopic.php?f=33&t=75329

When 4096x4096 became available, this limit was not scaled.

(5000 / (2048 * 2048)) * 4096 * 4096 = 20000
@James103
Copy link
Contributor

James103 commented Oct 1, 2018

town_distance
The minimum distance between 2 towns is 19 tiles. This means that the radius of a town is 10 tiles (manhattan distance), and that the no-other-town zone of a town is 1 + 4 + 8 + 12 + 16 + 20 + 24 + 28 + 32 + 36 = 181 tiles in area (if my calculations are correct). A map of 2048 * 2048 can already support over 20,000 towns at the most, which means a 4K map, 4096 * 4096 in size, can support over 80,000 towns theoretically. Though in practice the amounts are gonna be a lot smaller due to the placement of the towns. Using Euclidean methods, the max number of towns in a 4K map is 50,000 towns, and using a 1-dimensional distance method on a 2-dimensional plane, the max number of towns is about 40,000. All of the theoretical limits are greater than the 20,000 town proposed limit, and so I agree with the proposed new limit.

EDIT: Using a 512x512 map with default world gen settings (except for inputting the max custom number of towns), and a custom Game Script that I quickly wrote that was designed to output the number of towns, I got a figure of 668 towns. Multiply that by 64 (= 4096^2 / 512^2) and you get about 40,000 towns, again. The code for the game script was as follows:

GSController.Sleep(1); // wait until the game starts
local t = GSTownList(); // get the list of towns
for (t.Begin(); !t.IsEnd(); t.Next()) { x++; } // x is the number of towns
GSLog.Info(x + " towns"); // print the number of towns

Or alternatively: GSLog.Info(GSTownList().Count() + " towns")

@PeterN
Copy link
Member

PeterN commented Oct 2, 2018

Less is more. Maybe scale up the minimum distance between towns instead.

@James103
Copy link
Contributor

James103 commented Oct 2, 2018

I agree with that, but however, scaling up the minimum distance between towns should only apply during world generation, so you can still manually place towns at the current minimum separation distance of 19 tiles instead of the new one (which could be 30, 50, or even 100+ tiles or some other value).

@frosch123
Copy link
Member

OpenTTD is a transportation game. It is about vehicles, not about towns.

There are limits on the number of vehicles, there is no point in having more towns than vehicles.

If you think there are too few towns on a big map, then pick a smaller map.

@frosch123 frosch123 closed this Oct 7, 2018
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.

None yet

4 participants