Patch: Initial population in towns

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
steili
Engineer
Engineer
Posts: 2
Joined: 29 May 2014 23:43

Patch: Initial population in towns

Post by steili »

Hi guys,

Here comes a patch that let you set a lower and upper limit of the initial population size of towns during world generation. To use it, go to Advanced Settings -> World Generation, select Enable fixed initial population limit in towns and specify the limits in the Lower population and Upper Population.

Some notes:
  • Maximum lower- and upper population limit to 500 000 and 1 000 000 respectively, but you may change this in settings.ini before you compile. I haven't been able to get bigger cities than 7-800000 though.
  • If you try to generate big cities, you should limit the number of cities on the map to a reasonable size (choose Custom in No. of towns in the new game menu).
  • Towns founded in-game are also generated using the same algorithm, but the result aren't verified, so the town may end up with a population outside the limits.
  • The limits are scaled with the city scale multiplier if the generated town is a city.
  • Creating very large towns (>500 000) may take some time - just be patient during word creation.
  • Lower limit * city city multiplier shouldn't exceed 500 000 when cities is enabled.
I'll apprecicate all feedback on the patch - I'm quite new to the OpenTTD source and it's been a while since I last used C++, so I'll apprecicate all feedback :)

Some screenshots:

50k-100k
Image\

500k-1000k
Image\

500k-1000k
Image\

870k town
Image\

Use some town NewGRF, Total Town Replacement Kit is a good alternative. The regular GFX is a bit boring if you have big towns :)
Image\

Settings
Image

Edit: Any ideas regarding how to grow the cities are very welcome. At the moment I use a hacky solution based on regression analysis.. 8)
Attachments
townsize_r26620.patch
(9.67 KiB) Downloaded 153 times
Gigigonzalez
Engineer
Engineer
Posts: 91
Joined: 12 Jun 2014 14:24

Re: Patch: Initial population in towns

Post by Gigigonzalez »

Noice! Exactly what i was looking for!

Ill try to patch it against current trunk.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 28 guests