You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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:
Should this become a new algorithm and a new game setting for town growth?
How to unit/regression test that the old algorithm still works the same?
is there an easy way to highlight sets of tiles in a debug mode?
How do you feel about adding this algorithm option/making this change to the existing algorithm?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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