2d Hex Map Generation

Godot Version

Godot 4.4,

Question

I am trying to make 2D hex map generation for 4x strategy. I stuck on part where i need to place 5 continents on hextile map 190x135 tiles, that already been generated. Placement work bad cause continents placement works not effectivly. Often managed to place only 2 continents, cause script didnt find suitable place for next land part. I generate continents 8-15% of map tiles random continent, then 4 more and tryong to find the way place it to have interesting combination for 4[ strategy game. Is there any effective way to handle such task?

This is not an easy task, and there are probably many ways of doing that, depending on many parameters (such as your game design, your programming skills, etc.).
You should probably have a look at procedural generation algorithms in general and try to make something simple and working out of them. Or, please share some more details on what your map should look like so that we can help a bit more precisely.

Also, here’s a very good tutorials collection for hex map generation, it’s made in Unity, but you could apply the same concepts to Godot:

1 Like

Thank you! I saw this unity tutorial earlier, but didnt get how to use ideas from there. But today i decided to check one more idea that came to my mind: to devide map on 9 sectors and try to place generated continents into them additionaly prerforming rotation steps, and it worked very well. now in 10/10 tries I ve got all 5 continents placed, still need to work on more effective proportional placing. but now it works and a lot better loking

1 Like