Page 1 of 1

GSTown.SetGrowthRate ?

Posted: 03 Feb 2014 14:27
by R2dical
A few questions about the GSTown.SetGrowthRate and GSTown.GetGrowthRate functions...

How do they relate to the settings "Town growth speed" and "City" status of towns? If I run my GS to only print a GSTown.GetGrowthRate on existing or GS founded towns it is always 237 no matter the game growth speed or if it is a city. So is this the number of days between checks and the "growth" and "city" modifiers the size of the growth? Do I need to modify what values based on these setting if I want my GS to apply a global growth speed modifier to all towns?

Thanks for any help.

Re: GSTown.SetGrowthRate ?

Posted: 03 Feb 2014 18:37
by frosch
There are two aspects of town growth.

A) First thing is, whether a town growths at all. This depends on
  • The advanced setting "no growth".
  • Whether the cargo demands are meet.
  • Whether a company funds buildings. (this overrules the previous two things)
B) If a town grows according to those conditons (A) then the speed is determined on
  • If a GS set a custom rate via SetGrowthRate, then this is the rate, independent of the growth speed setting or the city status.
  • If the default growth rate is used, then the number of service stations determines the growth rate, scaled by city status and the growth-speed advanced setting.
GetGrowthRate returns the speed as given by (B), it does not evaluate the conditions from (A).

Note:
  • The advanced setting has effect on either (A) or (B) depending on whether it is set to "none" or something else.
  • GS have to evaluate city status and growth speed setting theirself, if they want to use SetGrowthRate.
  • If a GS has called SetGrowthRate with a custom value, GetGrowthRate will just return that value.

Re: GSTown.SetGrowthRate ?

Posted: 03 Feb 2014 23:06
by R2dical
Thanks for the detailed answer :) That clears things up.

I was hoping for a simple way to apply a custom modifier in the GS to existing town growth algorithm, much like the growth-speed advanced setting, also with a "randomise" option. But it looks like this function is designed for a more "hands on" implementation, with stations, cargo, city, etc, out of the scope of my GS goals.

Actually a good thing that as this question came from thinking I had to manually set a 2x growth for founded cities (as their size is also not doubled on creation automatically), but I assume from the explanation that this IS accounted for in the GSTown.TOWN_GROWTH_NORMAL algorithm.