Feature: Make town bridge max length a function of its population #8439
Make new town bridge max length a function of its population.
Motivation / Problem
Really small towns can build disproportionately long bridges, all the way up to 11 tiles. To make it more realistic, the max number of tiles for a built bridge should be a function of its population.
In order to prevent small towns from building disproportionately long bridges, this change makes the max allowed bridge length a function of its population, while letting every town build at least a town as long as 4 tiles. The max length is defined as a min of 4 plus 1 for each 1000 population, rounded down.
Checklist for review
This PR is safe, and backwards compatible, since saved games won't be affected other than towns will build bridges with a variable max length as opposed as the current fixed hard coded max length.
2TallTyler left a comment •
I think 20 tiles is a bit excessive and would lead to large cities building ridiculous bridges. What about keeping the current 11 tile length?
The max bridge length mentioned by James103 is for player-built bridges, which defaults to 64 tiles. Far too long for a town-built bridge, IMHO.
@michicc: I like population over number of houses because a small island of skyscrapers may have more population (and thus need for a bridge) than a sprawling town of cottages. This is probably more meaningful with a house NewGRF like Improved Town Layouts where population doesn't necessarily grow linearly with number of houses.
@James103: The max bridge length chosen in the settings is checked by the DoCommand which actually builds the bridge.
As a small update, we would like to include this PR for our 1.11 release, but there is some small work from our side to do first before we can include it. Mostly, we want to align it with #8473 , and make sure we like the values etc. No work required from your side just yet, but just so you know this is in the works :)
@perezdidac : I made some minor changes to your code: renamed
I kept it depending on population rather than houses; I think this is a good first iteration to make towns a bit more playful.