New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Make town bridge max length a function of its population #8439
Conversation
Suggested commit message: "Feature: Make town bridge max length a function of its population" Also, would it be a good idea to hard cap the town max bridge length at the max bridge length defined in the Advanced Settings? |
James103: Yes that is a good idea. We could hard code a limit of 20 probably. I tried different town sizes and bridge lengths and 20 seems too much regardless of the city size. Is there a max bridge length in settings? Any code pointer? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
I like this idea. One idea to consider is to make the length not depend on the population but on the house count as some kind of proxy for "town area". |
But what if the "max bridge length" setting was set to some really low value like 7 tiles (down from the default of 64)? |
@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 :) |
87b2869
to
a8fdf1d
Compare
Having 4 rails is a pretty common design, and towns now couldn't bridge out of this common design.
a8fdf1d
to
46ff278
Compare
@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. |
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.
Description
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.
Limitations
None.
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.