Robust town growth algorithm #12639
JoostvanPinxten
started this conversation in
Features
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The town growth algorithm currently does a random walk over roads from the town center to determine which tile to expand the city (road or building). If after a certain number of iterations, no tile is found, the algorithm gives up. This makes sense, bht ai feel the current implementation is not so efficient for large cities, as the algorithm gives up often. This hampers thw growth of the city.
In a grid-based city layout, there will be many cycles that will be traversed often. Therefore, a single road seems to become preferable for very arge cities.
Potato Mc Whiskey and Master Hellish both have YouTube videos demonstrating this effect: https://youtu.be/sRT1jgeIpCk?si=Eyal56AcaHtTddkv
My suggestion is as follows: create a new version of the algorithm that keeps track of (a subset of) visited tiles, which will then no longer be considered in the random walk. Instead of choosing a new tile adjacent to the current tile, pick a tile that is adjacent to the visited tiles (if any of them are road tiles). That will help to eventually cover all road tiles from the town.
Now, I have a few questions regarding this:
Beta Was this translation helpful? Give feedback.
All reactions