NewTownGrowthMechanism

From TTWiki
Revision as of 15:53, 18 June 2011 by Orudge (talk | contribs) (Add link to town growth examples)
Jump to navigationJump to search

How the switches controlling town growth work in detail.

Sub-topics:

Summary

TTDPatch version 2.0 introduced a host of new switches that control how fast and when towns can grow, thanks to Marcin Grzegorczyk who wrote the feature. This section attempts to explain all the details and intricacies about town growth, first by explaining how it works in regular TTD, and then how the new switches modify this.

There are two sets of town growth switches. The first one makes small modifications, but keeps TTD's general town growth algorithm as explained in the next section. The second one allows you to fine-tune the town growth conditions and rates.

The first set includes towngrowthlimit and largertowns. towngrowthlimit sets (roughly) the maximum radius to which towns can grow. largertowns allows a certain fraction of towns to grow twice as fast. For example, largertowns 5 doubles the growth rate of every fifth city, but the selection of cities for which this applies is random. If largertowns is enabled, towngrowthlimit affects only towns with doubled growth rate; if largertowns is disabled, towngrowthlimit affects all towns. Both these switches also apply some small modifications and bug fixes that are explained in the next section.

The rate at which towns grow is controlled by the setting of towngrowthratemode:

  • towngrowthratemode 0 or off: TTD's original algorithm, unmodified except for a bugfix
  • towngrowthratemode 1: Improved town growth rate calculation
  • towngrowthratemode 2: Custom town growth algorithm

To fully understand how both the improved and custom town growth rates work, read the following sections.

The executive summary for modes 0 and 1: Town growth is boosted by activity (loading or unloading) at stations in the town's transport zone, the size of which depends on the number of buildings in the town. Up to 4 (in mode 0) or 5 (in mode 1) stations can contribute to the growth. If the "Fund new buildings" action was carried out in the town within the last 3 months, stations either do not affect the growth rate (mode 0) or affect it weakly (mode 1). The largertowns option does not double the growth rate of towns which have no active stations in their transport zones.

For mode 2, there is no executive summary. All switches whose name begins with "towngrowthrate" or "tgr" are used to control and fine-tune town growth rate. See the New Town Growth Switches for the detailed description.

You can see some examples here.