Skip to content

Feature/map generator#1723

Draft
bacox wants to merge 22 commits intoKeriew:masterfrom
bacox:feature/map-generator
Draft

Feature/map generator#1723
bacox wants to merge 22 commits intoKeriew:masterfrom
bacox:feature/map-generator

Conversation

@bacox
Copy link
Copy Markdown

@bacox bacox commented Apr 4, 2026

Hi all,

It took me a bit more time to fix the biggest problems after showing the initial generator in #1557 .
Here is the pr but keep in mind it is still a work in progress.
There is enough that can be improved/fixed.
The code that I added in core/random and map/random really could some improvement.

However, sharing the code gives you the opportunity to give feedback as well :)

The generator has the following options:

  • Select map size
  • Change climate
  • Set seed for deterministic map generation.
  • Select generator algorithm.
  • Edit win criteria
  • Set initial funds.

After generation there are two options: Open in the editor to further change the scenario, or start game to directly play the scenario.
Screenshot from 2026-04-04 11-07-21
Option to change climate:
Screenshot from 2026-04-04 11-15-41
Large map with river generator:
Screenshot from 2026-04-04 11-08-01
Scenario after using the start game option:
Screenshot from 2026-04-04 11-09-06

Most of the added lines of code are in the ui of the map generator window.
The river generator uses a combination of perlin noise for the trees, rocks, and meadows, as well a random walk for the river. The river algorithm creates a path for the river and is widened using a somewhat random kernel that move over the path of the river.

Known problems:

  • The ocean and lakes algorithm is there as well but do not work well.
  • The entry and exit points can be buggy and need some more work.
  • The path between the entry and exit points carves through the water and destroys the river.
  • The win-criteria is pure random and not based on any of the map features.
  • The available building, resources, and empire map is currently ignored.
    I'll keep working on improvements.

I'm looking forward to any feedback :)

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

Successfully merging this pull request may close these issues.

1 participant