Boost city growth
Moderator: OpenTTD Developers
Here's the definitive answer!
Each "tick", one town is checked. So that it remembers which town it is checking, there is a global variable called _cur_town_ctr. This is incremented each time a town is checked meaning that the next one will be checked.
However, _cur_town_ctr is only a byte, meaning only a maximum of 256 towns will ever be processed - in an 11x11 map there can be around 2000 towns, meaning that 1750-odd of them will never ever grow. Changing _cur_town_ctr to a uint solves the problem and everything grows nicely!
Jonathan
Each "tick", one town is checked. So that it remembers which town it is checking, there is a global variable called _cur_town_ctr. This is incremented each time a town is checked meaning that the next one will be checked.
However, _cur_town_ctr is only a byte, meaning only a maximum of 256 towns will ever be processed - in an 11x11 map there can be around 2000 towns, meaning that 1750-odd of them will never ever grow. Changing _cur_town_ctr to a uint solves the problem and everything grows nicely!
Jonathan
- Gorre
- Transport Coordinator
- Posts: 322
- Joined: 03 Jan 2004 10:28
- Location: Somewhere over the rainbow
- Contact:
Well, in my current game, i have about 150 cities, all of my cities are connected with at least one bus. (i must say i really hate having 4, or 5 stations in one city which is ugly).
The world population raises from 45k to only 60k during almost 50 years.
And the worst thing is, that I was delivering 1000+ cargo per month to some city and its population lower from 1600 to just 600. This really drives me ill...
The world population raises from 45k to only 60k during almost 50 years.
And the worst thing is, that I was delivering 1000+ cargo per month to some city and its population lower from 1600 to just 600. This really drives me ill...
Compilers are probably not that good for searching...Horse wrote:I have searched in the soucre code with my compiler but i have not found it.
Easier just to look here: http://svn.openttd.org/cgi/viewcvs.cgi/ ... iew=markup
Then try edit and search for "static void UpdateTownGrowRate(Town *t)" from the internet explorer menu.
Håkon
Well if Jonathan is correct the the source has been fixedorangemoo wrote:Here's the definitive answer!
Each "tick", one town is checked. So that it remembers which town it is checking, there is a global variable called _cur_town_ctr. This is incremented each time a town is checked meaning that the next one will be checked.
However, _cur_town_ctr is only a byte, meaning only a maximum of 256 towns will ever be processed - in an 11x11 map there can be around 2000 towns, meaning that 1750-odd of them will never ever grow. Changing _cur_town_ctr to a uint solves the problem and everything grows nicely!
Jonathan

well _cur_town_ctr used to be a byte type, it is now a unit.
Tested using the 1914 build on big maps and although it takes slightly longer to grow, as soon as its over the ~2000 Mark then the town springs into growth action. Tested on a 10*10 Map, with 3 random town's the test subjects and watched the world population as well. No town shrinkage beyond the normal fluctuation.
Got to have plenty of roads for the town to grow into though as i'm not sure what's happened to the town's road building ability...
It did take around 10 years for it to get to the 2000 mark with 3 buses going to 5 depots. Increasing the amount of buses helped as did laying more roads down.
Test it, just cheat to give yourself 10 Million, flattern the area around the town, build 5 bus depots and 4 buses and some roads then run it in fast forward mode. After shrinking/changing loads around the first 10 years it then grew normally
Hope that helps
Tested using the 1914 build on big maps and although it takes slightly longer to grow, as soon as its over the ~2000 Mark then the town springs into growth action. Tested on a 10*10 Map, with 3 random town's the test subjects and watched the world population as well. No town shrinkage beyond the normal fluctuation.
Got to have plenty of roads for the town to grow into though as i'm not sure what's happened to the town's road building ability...
It did take around 10 years for it to get to the 2000 mark with 3 buses going to 5 depots. Increasing the amount of buses helped as did laying more roads down.
Test it, just cheat to give yourself 10 Million, flattern the area around the town, build 5 bus depots and 4 buses and some roads then run it in fast forward mode. After shrinking/changing loads around the first 10 years it then grew normally

Hope that helps
I just played a single player game on a 10x10 map. Cities seem to grow very well, good job fixing it (although I never had a problem with this)
- Attachments
-
- metropolitrans.jpg
- (716.24 KiB) Downloaded 479 times
#################
- kilo.dollar
- Traffic Manager
- Posts: 161
- Joined: 02 Jul 2007 08:45
- Location: Harare
Re: Boost city growth
Well, I am struggling to regain my lost city status, oops, growth rate. Shrinking cities.
But, why do I have cities with enormous populations yet everything is dwindling except roads? Passengers have fallen drastically, buildings are reducing.
See attached pic.
But, why do I have cities with enormous populations yet everything is dwindling except roads? Passengers have fallen drastically, buildings are reducing.
See attached pic.
I think that I may never see,
A billboard as lovely as a tree.
Perhaps, unless the billboards start to fall,
I may never see a tree at all.
A billboard as lovely as a tree.
Perhaps, unless the billboards start to fall,
I may never see a tree at all.
Re: Boost city growth
Hi there.
IIRC OpenTTD can handle only 65536 houses per city. If you reach that number of houses it drops back to 0 (overflow). The number of passengers a city can generate depends on the number of houses. To increase the number of passengers you have to grow the city even more although this city has reached an impressive size.
Kind regards
Zombie
IIRC OpenTTD can handle only 65536 houses per city. If you reach that number of houses it drops back to 0 (overflow). The number of passengers a city can generate depends on the number of houses. To increase the number of passengers you have to grow the city even more although this city has reached an impressive size.
Kind regards
Zombie
- kilo.dollar
- Traffic Manager
- Posts: 161
- Joined: 02 Jul 2007 08:45
- Location: Harare
Re: Boost city growth
So why that big population in my city, and so few houses. It appears like each house can acommodate 100,000 people.
Is that right?
Is that right?
I think that I may never see,
A billboard as lovely as a tree.
Perhaps, unless the billboards start to fall,
I may never see a tree at all.
A billboard as lovely as a tree.
Perhaps, unless the billboards start to fall,
I may never see a tree at all.
Re: Boost city growth
Thanks for your help in this thread folks. I increased (for no real reason) Mansfield's population from 680-ish to about 950 within a year using the tips.

Now I might try something more worthwhile.
Ed - Now, five years later, Mansfield is a town of 5,650 people. Makes me wonder where they all come from. I've also made Elgin grow from 133 to 1,102, and have had a similar increase on Douglas, Isle of Man.

Now I might try something more worthwhile.
Ed - Now, five years later, Mansfield is a town of 5,650 people. Makes me wonder where they all come from. I've also made Elgin grow from 133 to 1,102, and have had a similar increase on Douglas, Isle of Man.
Re: Boost city growth
Hi.
The population can have any value from 0 to 4,294,967,295 and according to your screenshot you are damn close to the upper limit, too.
I hope that helps.
Kind regards
Zombie
The number of people and the number of houses are two different values not completely linked together. Let us pretend you have a city with a population of 1,000,000 and 65,535 houses. That's about 15 residents per house. If the game adds another house and 15 more residents you will have a population of 1,000,015 but you won't have 65536 houses because OpenTTD can't store this value. The number of houses can be anything from 0 to 65535. Therefore you are back to 0 houses and you have to continue growing the city to get more passengers a month.kilo.dollar wrote:So why that big population in my city, and so few houses. It appears like each house can acommodate 100,000 people.
Is that right?
The population can have any value from 0 to 4,294,967,295 and according to your screenshot you are damn close to the upper limit, too.
I hope that helps.
Kind regards
Zombie
-
- Traffic Manager
- Posts: 253
- Joined: 22 Apr 2005 15:40
- Location: Ipswich U.K
Who is online
Users browsing this forum: No registered users and 11 guests