Reduce size of free (green land) area for random maps
It's been a while! I've been thinking about an improvement for the in-game random maps based on the feedback of my last PR (from last year or two years ago?). Hopefully, next year I'll have a bit free time I can spend on the project again :-)
So this is the issue I would like to attack: Currently (especially for larger maps) there's a lot of more or less empty space (green land with trees/granite piles) and some mountains around the centre of the map (depending on the type of map).
My idea how to improve this:
- Calculate distance to mountain or water (“inner land”)
- If highest value > CONST [minimum free green land to keep]
- Add tile for highest value to queue
- While collected tiles < CONST [tiles per mountain] * FUNC [decrease mountain size with increasing iterations] AND queue not empty
- Collect tiles (via “brush”) around current tile
- Distance to highest value tile
- Distance to mountain or water
- Add new tiles to collected tiles
- Add new tiles to queue
- Collect tiles (via “brush”) around current tile
- Add collected tiles to new mountains list
- Continue with 1.
- Apply height values to collected tiles in new mountains list
Let me know what you think! There's plenty of time to discuss before I start - intentionally ;)
The CONST values do not need to be real constants but could be random to add more variation to random maps.