Skip to content
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

Reduce size of free (green land) area for random maps #1530

Open
vader1986 opened this issue Jul 4, 2022 · 1 comment
Open

Reduce size of free (green land) area for random maps #1530

vader1986 opened this issue Jul 4, 2022 · 1 comment

Comments

@vader1986
Copy link
Contributor

vader1986 commented Jul 4, 2022

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:

  1. Calculate distance to mountain or water (“inner land”)
  2. 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
    • Add collected tiles to new mountains list
    • Continue with 1.
  3. 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 ;)

@vader1986
Copy link
Contributor Author

The CONST values do not need to be real constants but could be random to add more variation to random maps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant