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
New setting: Grow cities around stations #9089
Comments
One thing to bear in mind is that the centre point must be a road tile as the algorithm follows roads, so you'd need to find a suitable road tile near the starting point. Doing so would also help the long standing issue (that is probably used deliberately by some players) that if the central road tile is removed a town cannot grow. |
On that same method, there is already logic for that using data on lines 1692-1706. That same logic would apply here with stations. |
There are many (good) ideas on how to improve town growth. No doubt there :) Sadly, an implementation for this is not trivial. This because we would like to have a generic solution where people can write their own town growth algorithm for. The main motivation here is that there are many of these ideas, and we cannot implement them all. In the past we used to do that, which resulted in many many settings, which are very hard to maintain and hard to make sure the game isn't broken in any combination of them. Additionally, we tend not to leave feature-requests on our issue-tracker. We have our forums for that, which is a much better incubator for ideas. Normally I would say: if you want to learn C++, let us know, and we can see if we can help you out, but if I am being honest: this is not a good starting point :P It isn't easy to add a generic interface for it. But for now, sadly, I will be closing this ticket. If any developer ever picks up making town growth scriptable, we will for sure keep this usecase in mind! Tnx! |
Version of OpenTTD
All future versions
Expected result
A new setting is introduced: "Grow cities around stations". When enabled, the city growing algorithm uses a random passenger-accepting station belonging to this city to use as a center-point to grow the city. As a result, cities will not look just like circles, but have a small "blobs" around each station.
In this random station selection, keep the city's center-point still as one of the options.
While i'm not too good at C++, i believe town_cmd.cpp file, method "
GrowTown(Town *t)
" on line 1690 needs an update on lines1711:
TileIndex tile = t->xy; // The tile we are working with ATM
1727:
tile = t->xy;
Where instead of always choosing town's center point, it should find all appropriate stations + adds its own center point just as one option, and use random option from the result.
In addition, configuration panel needs some updates to enable or disable this option.
Actual result
Setting is not (yet) present today.
The text was updated successfully, but these errors were encountered: