Difference between revisions of "NewTownGrowthSwitchesdetails"
m (style: fix <tt> mess-up) |
(Reformat and update) |
||
Line 1: | Line 1: | ||
− | =New Town Growth Switches (details)= |
||
− | |||
− | How the new town growth switches work |
||
− | |||
This section describes the switches that apply in "towngrowthratemode 2". They fine tune and control every detail of town growth. |
This section describes the switches that apply in "towngrowthratemode 2". They fine tune and control every detail of town growth. |
||
Line 11: | Line 7: | ||
{| |
{| |
||
!number of active stations!!average rate (new houses per 100 years) |
!number of active stations!!average rate (new houses per 100 years) |
||
− | |||
|- |
|- |
||
| 0 ||20 |
| 0 ||20 |
||
− | |||
|- |
|- |
||
| 1 ||182 |
| 1 ||182 |
||
− | |||
|- |
|- |
||
| 2 ||256 |
| 2 ||256 |
||
− | |||
|- |
|- |
||
| 3 ||349 |
| 3 ||349 |
||
− | |||
|- |
|- |
||
| 4 ||480 |
| 4 ||480 |
||
Line 30: | Line 21: | ||
or, if a building fund is active, the rate is fixed at 640 new houses per century. These rates are as they're normally in TTD, except that a bug with 5 or more stations (see the previous section) is fixed. |
or, if a building fund is active, the rate is fixed at 640 new houses per century. These rates are as they're normally in TTD, except that a bug with 5 or more stations (see the previous section) is fixed. |
||
− | For the new growth rate calculation, we have the maximum and minimum rate, the towngrowthratemin and towngrowthratemax switches. Let <tt>''ratediff''</tt> be the difference between the maximum and the minimum, i.e. |
+ | For the new growth rate calculation, we have the maximum and minimum rate, the towngrowthratemin and towngrowthratemax switches. Let <tt>''ratediff''</tt> be the difference between the maximum and the minimum, i.e.: |
+ | <pre>ratediff = towngrowthratemax - towngrowthratemin</pre> |
||
⚫ | |||
+ | Then the '''base rate delta multiplier''' (BRDM) is calculated as follows: |
||
⚫ | |||
+ | |||
⚫ | |||
⚫ | |||
where the two-letter abbreviations represent '''growth boost components''' (explained in detail below) depending on, respectively: |
where the two-letter abbreviations represent '''growth boost components''' (explained in detail below) depending on, respectively: |
||
{| |
{| |
||
− | + | |<tt>''AS''</tt> ||the number of active stations |
|
− | |||
|- |
|- |
||
|<tt>''PO''</tt> ||percentage of passengers transported (`passengers out') |
|<tt>''PO''</tt> ||percentage of passengers transported (`passengers out') |
||
− | |||
|- |
|- |
||
|<tt>''MO''</tt> ||percentage of mail transported (`mail out') |
|<tt>''MO''</tt> ||percentage of mail transported (`mail out') |
||
− | |||
|- |
|- |
||
|<tt>''PI''</tt> ||incoming passengers (`passengers in') |
|<tt>''PI''</tt> ||incoming passengers (`passengers in') |
||
− | |||
|- |
|- |
||
|<tt>''MI''</tt> ||incoming mail (you get the picture...) |
|<tt>''MI''</tt> ||incoming mail (you get the picture...) |
||
− | |||
|- |
|- |
||
|<tt>''GI''</tt> ||incoming goods |
|<tt>''GI''</tt> ||incoming goods |
||
− | |||
|- |
|- |
||
|<tt>''FI''</tt> ||incoming food |
|<tt>''FI''</tt> ||incoming food |
||
− | |||
|- |
|- |
||
|<tt>''WI''</tt> ||incoming water |
|<tt>''WI''</tt> ||incoming water |
||
− | |||
|- |
|- |
||
|<tt>''SI''</tt> ||incoming sweets/candy |
|<tt>''SI''</tt> ||incoming sweets/candy |
||
− | |||
|- |
|- |
||
|<tt>''DI''</tt> ||incoming fizzy drinks |
|<tt>''DI''</tt> ||incoming fizzy drinks |
||
Line 72: | Line 57: | ||
{| |
{| |
||
− | + | |<tt>''ASW''</tt> ||tgractstationsweight |
|
− | |||
|- |
|- |
||
|<tt>''POW''</tt> ||tgrpassoutweight |
|<tt>''POW''</tt> ||tgrpassoutweight |
||
− | |||
|- |
|- |
||
|<tt>''MOW''</tt> ||tgrmailoutweight |
|<tt>''MOW''</tt> ||tgrmailoutweight |
||
− | |||
|- |
|- |
||
|<tt>''PIW''</tt> ||tgrpassinweight |
|<tt>''PIW''</tt> ||tgrpassinweight |
||
− | |||
|- |
|- |
||
|<tt>''MIW''</tt> ||tgrmailinweight |
|<tt>''MIW''</tt> ||tgrmailinweight |
||
− | |||
|- |
|- |
||
|<tt>''GIW''</tt> ||tgrgoodsinweight |
|<tt>''GIW''</tt> ||tgrgoodsinweight |
||
− | |||
|- |
|- |
||
|<tt>''FIW''</tt> ||tgrfoodinweight |
|<tt>''FIW''</tt> ||tgrfoodinweight |
||
− | |||
|- |
|- |
||
|<tt>''WIW''</tt> ||tgrwaterinweight |
|<tt>''WIW''</tt> ||tgrwaterinweight |
||
− | |||
|- |
|- |
||
|<tt>''SIW''</tt> ||tgrsweetsinweight |
|<tt>''SIW''</tt> ||tgrsweetsinweight |
||
− | |||
|- |
|- |
||
|<tt>''DIW''</tt> ||tgrfizzydrinksinweight |
|<tt>''DIW''</tt> ||tgrfizzydrinksinweight |
||
|} |
|} |
||
− | The higher the weighting factor for some component is relative to the other weighting factors, the more influence the |
+ | The higher the weighting factor for some component is relative to the other weighting factors, the more influence the associated growth boost component has on the final growth rate. Note that it's the relation betwen weighting factors that matters; for instance, if all the other weighting factors are zero, the following set: |
− | <pre> |
+ | <pre>tgractstationsweight = 10 |
+ | tgrpassoutweight = 5</pre> |
||
− | yields exactly the same results as |
+ | yields exactly the same results as: |
− | <pre> |
+ | <pre>tgractstationsweight = 2</tt> |
+ | tgrpassoutweight = 1</pre> |
||
The growth boost components are calculated as follows: |
The growth boost components are calculated as follows: |
||
− | + | <tt>''AS''</tt> = ((<tt>''NAS''</tt> * tgractstations) + tgractstationexist) * 10 / <tt>''ratediff''</tt> |
|
+ | : except: <tt>''AS''</tt> = 0 if <tt>''NAS''</tt> = 0, and <tt>''AS''</tt> = 1 if the above term > 1, |
||
+ | |||
+ | where <tt>''NAS''</tt> = number of active stations. If tgractstationsweight is the only nonzero weighting factor, then the default values, tgractstations=10 and tgractstationexist=5 result in an approximation of the standard TTD behaviour. Note that tgractstationexist can be negative. |
||
+ | |||
+ | <tt>''PO''</tt>, <tt>''MO''</tt>: These are simply percentages of passengers and mail, respectively, generated by this town and transported within the last month. |
||
+ | |||
+ | <tt>''PI''</tt> = <tt>''PILM''</tt>/tgrpassinmax: <tt>''PI''</tt> = 1 if <tt>''PILM''</tt>>tgrpassinmax, |
||
+ | |||
+ | where <tt>''PILM''</tt> = number of passengers `in' (i.e accepted at all stations belonging to the town) last month. The rationale is that incoming passengers boost growth of a town, but only up to a point. |
||
+ | |||
+ | <tt>''GI''</tt> = (<tt>''GILM''</tt>*tgrmailinoptim)/(<tt>''P''</tt>*2) |
||
+ | : <tt>''GI''</tt> = 1 if <tt>''GILM''</tt>>(<tt>''P''</tt>*2/tgrmailinoptim), |
||
+ | |||
+ | where <tt>''GILM''</tt> = number of crates of goods `in' last month and <tt>''P''</tt> = population of the town. The rationale is that incoming goods boost growth of a town, but only up to some `optimum', which is directly proportional to the population of the town; in a sort of way, each inhabitant can consume only up to some amount of goods each month. This `optimum' is defined as population per 2 crates of goods. For example, if <tt>tgrgoodsinoptim=20</tt>, then a town with population of 400 needs (400/20)*2 = 40 crates of goods each month; more goods will be still accepted but will not contribute to the growth of the town. |
||
+ | |||
+ | <tt>''MI''</tt>, <tt>''FI''</tt>, <tt>''WI''</tt>, <tt>''SI''</tt>, <tt>''DI''</tt> |
||
+ | : These are calculated the same way GI is, except that each uses its own `tgr*optim' setting. Any cargo type not available in the current climate is omitted from the calculations, as if its weighting factor were zero. |
||
+ | |||
+ | An additional calculation is done for towns in snow and desert areas. It is presumed that towns above the snow line (or in desert) need some minimum food to grow at all. This is defined via tgrfoodinmin, again as population per 2 tonnes of food. Before <tt>''FI''</tt> is calculated, <tt>''RFI''</tt> = (<tt>''P''</tt>*2)/tgrfoodinmin is subtracted from <tt>''FILM''</tt> (which is, remember, the number of tonnes of food `in' last month); if the result is negative, the town will not grow at all. Similarly, <tt>''RWI''</tt> = (<tt>''P''</tt>*2)/tgrwaterinmin is subtracted from <tt>''WILM''</tt> for towns in desert. |
||
+ | |||
+ | The base rate delta multiplier is then used to calculate the '''rate delta multiplier''': |
||
+ | |||
+ | <tt>''AS''</tt> = <nowiki>[[NTB / tgrtownsizebase) * TSF) + (1 - TSF]]</nowiki> |
||
where <tt>''NTB''</tt> is the number of buildings in the town and <tt>''TSF''=tgrtownsizefactor/255</tt> (i.e. it's a value between 0 and 1, which determines how much of the growth rate depends on the town size, in percent). This can be used to add a bit of `exponentiality' to the growth of towns (remember, the growth rate is expressed in new buildings per time unit, so with a constant rate larger towns will appear to grow more slowly). |
where <tt>''NTB''</tt> is the number of buildings in the town and <tt>''TSF''=tgrtownsizefactor/255</tt> (i.e. it's a value between 0 and 1, which determines how much of the growth rate depends on the town size, in percent). This can be used to add a bit of `exponentiality' to the growth of towns (remember, the growth rate is expressed in new buildings per time unit, so with a constant rate larger towns will appear to grow more slowly). |
||
Line 119: | Line 120: | ||
<pre>RGR = towngrowthratemin + ratediff*CRDM</pre> |
<pre>RGR = towngrowthratemin + ratediff*CRDM</pre> |
||
− | where <tt>''CDRM'' |
+ | where <tt>''CDRM''=''RDM''</tt> if <tt>''RDM''</tt> <= 1, and <tt>''CRDM=1''</tt> otherwise. |
Then, if a town building fund is active in this town, 600 is added. Then, if the town is one of those supposed to be larger (see the largertowns switch), the rate is doubled. And ''this'' is the final growth rate, in new houses per century. |
Then, if a town building fund is active in this town, 600 is added. Then, if the town is one of those supposed to be larger (see the largertowns switch), the rate is doubled. And ''this'' is the final growth rate, in new houses per century. |
||
As a final note, the real growth of towns is a second- or third-order effect of the final growth rate, so don't expect towns to grow exactly at the rate you've calculated from the formulae above.... But on the average it shouldn't be far off. |
As a final note, the real growth of towns is a second- or third-order effect of the final growth rate, so don't expect towns to grow exactly at the rate you've calculated from the formulae above.... But on the average it shouldn't be far off. |
||
+ | [[Category:Additional Reading]][[Category:New Town Growth Mechanism]][[Category:TTDPatch]][[Category:TTDPatch Manual]] |
Latest revision as of 18:37, 18 June 2011
This section describes the switches that apply in "towngrowthratemode 2". They fine tune and control every detail of town growth.
As described in the previous section, TTD internally uses an inverse growth rate, i.e. the number of 70-tick time units between attempts to build a new house. However, the enhanced rate calculation uses a direct growth rate, defined as the average number of new town buildings per 38400 time units, which is approximately 100 years. At the end of calculations this rate is converted to the inverse growth rate. If the inverse growth rate is greater than 255, it's reduced and town growth is blocked randomly to have the same effect on the average.
For comparison, with "towngrowthratemode 0" (TTD's original calculation), the rates are:
number of active stations | average rate (new houses per 100 years) |
---|---|
0 | 20 |
1 | 182 |
2 | 256 |
3 | 349 |
4 | 480 |
or, if a building fund is active, the rate is fixed at 640 new houses per century. These rates are as they're normally in TTD, except that a bug with 5 or more stations (see the previous section) is fixed.
For the new growth rate calculation, we have the maximum and minimum rate, the towngrowthratemin and towngrowthratemax switches. Let ratediff be the difference between the maximum and the minimum, i.e.:
ratediff = towngrowthratemax - towngrowthratemin
Then the base rate delta multiplier (BRDM) is calculated as follows:
BRDM = (AS*ASW + PO*POW + MO*MOW + PI*PIW + MI*MIW + GI*GIW + FI*FIW + WI*WIW + SI*SIW + DI*DIW) / (ASW + POW + MOW + PIW + MIW + GIW + FIW + WIW + SIW + DIW)
where the two-letter abbreviations represent growth boost components (explained in detail below) depending on, respectively:
AS | the number of active stations |
PO | percentage of passengers transported (`passengers out') |
MO | percentage of mail transported (`mail out') |
PI | incoming passengers (`passengers in') |
MI | incoming mail (you get the picture...) |
GI | incoming goods |
FI | incoming food |
WI | incoming water |
SI | incoming sweets/candy |
DI | incoming fizzy drinks |
Each component is a number between 0 and 1, so the result (BRDM) is also between 0 and 1. The rest are weighting factors, represented by the following settings in the configuration file:
ASW | tgractstationsweight |
POW | tgrpassoutweight |
MOW | tgrmailoutweight |
PIW | tgrpassinweight |
MIW | tgrmailinweight |
GIW | tgrgoodsinweight |
FIW | tgrfoodinweight |
WIW | tgrwaterinweight |
SIW | tgrsweetsinweight |
DIW | tgrfizzydrinksinweight |
The higher the weighting factor for some component is relative to the other weighting factors, the more influence the associated growth boost component has on the final growth rate. Note that it's the relation betwen weighting factors that matters; for instance, if all the other weighting factors are zero, the following set:
tgractstationsweight = 10 tgrpassoutweight = 5
yields exactly the same results as:
tgractstationsweight = 2</tt> tgrpassoutweight = 1
The growth boost components are calculated as follows:
AS = ((NAS * tgractstations) + tgractstationexist) * 10 / ratediff
- except: AS = 0 if NAS = 0, and AS = 1 if the above term > 1,
where NAS = number of active stations. If tgractstationsweight is the only nonzero weighting factor, then the default values, tgractstations=10 and tgractstationexist=5 result in an approximation of the standard TTD behaviour. Note that tgractstationexist can be negative.
PO, MO: These are simply percentages of passengers and mail, respectively, generated by this town and transported within the last month.
PI = PILM/tgrpassinmax: PI = 1 if PILM>tgrpassinmax,
where PILM = number of passengers `in' (i.e accepted at all stations belonging to the town) last month. The rationale is that incoming passengers boost growth of a town, but only up to a point.
GI = (GILM*tgrmailinoptim)/(P*2)
- GI = 1 if GILM>(P*2/tgrmailinoptim),
where GILM = number of crates of goods `in' last month and P = population of the town. The rationale is that incoming goods boost growth of a town, but only up to some `optimum', which is directly proportional to the population of the town; in a sort of way, each inhabitant can consume only up to some amount of goods each month. This `optimum' is defined as population per 2 crates of goods. For example, if tgrgoodsinoptim=20, then a town with population of 400 needs (400/20)*2 = 40 crates of goods each month; more goods will be still accepted but will not contribute to the growth of the town.
MI, FI, WI, SI, DI
- These are calculated the same way GI is, except that each uses its own `tgr*optim' setting. Any cargo type not available in the current climate is omitted from the calculations, as if its weighting factor were zero.
An additional calculation is done for towns in snow and desert areas. It is presumed that towns above the snow line (or in desert) need some minimum food to grow at all. This is defined via tgrfoodinmin, again as population per 2 tonnes of food. Before FI is calculated, RFI = (P*2)/tgrfoodinmin is subtracted from FILM (which is, remember, the number of tonnes of food `in' last month); if the result is negative, the town will not grow at all. Similarly, RWI = (P*2)/tgrwaterinmin is subtracted from WILM for towns in desert.
The base rate delta multiplier is then used to calculate the rate delta multiplier:
AS = [[NTB / tgrtownsizebase) * TSF) + (1 - TSF]]
where NTB is the number of buildings in the town and TSF=tgrtownsizefactor/255 (i.e. it's a value between 0 and 1, which determines how much of the growth rate depends on the town size, in percent). This can be used to add a bit of `exponentiality' to the growth of towns (remember, the growth rate is expressed in new buildings per time unit, so with a constant rate larger towns will appear to grow more slowly).
Then the real growth rate is calculated:
RGR = towngrowthratemin + ratediff*CRDM
where CDRM=RDM if RDM <= 1, and CRDM=1 otherwise.
Then, if a town building fund is active in this town, 600 is added. Then, if the town is one of those supposed to be larger (see the largertowns switch), the rate is doubled. And this is the final growth rate, in new houses per century.
As a final note, the real growth of towns is a second- or third-order effect of the final growth rate, so don't expect towns to grow exactly at the rate you've calculated from the formulae above.... But on the average it shouldn't be far off.