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.
GSTown.SetGrowthRate ?
Moderator: OpenTTD Developers
Re: GSTown.SetGrowthRate ?
There are two aspects of town growth.
A) First thing is, whether a town growths at all. This depends on
Note:
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)
- 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.
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 ?
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.

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.
Who is online
Users browsing this forum: No registered users and 20 guests