top of page

The Hex Map is almost a work of art, not bad for a programmer.

  • Writer: Kevin G
    Kevin G
  • Aug 11, 2017
  • 2 min read

Over the last few weeks I've been working on the hex map a bit more. So far, I've greatly improved the hex map generator, added trees, radial texture blending, and a time of day manager.

After trying number of different procedural hex map generation methods I've settled on a rather unorthodox approach. Commonly used techniques using Perlin noise failed to create convincing landmass shapes without becoming over complicated. After a bit of agonizing, I realized that I needed more control over the map generation and noise generators based on landmass height didn't offer me that.

With a bit of research, I decided that I would try to replicate landmasses using randomly generated polygons. I then wrote a function to do just that.

GenerateRandomPolygon(randX, randY, radius, irregularity, spikeyness, verts);

The function allows you to specify polygon irregularity, radius, number of corners, and spikiness. This function turned out to be the exact solution I was looking for, as it provides granular control over the shape of the landmass.

The above function was then used to generate a random number of tectonic plates on the hex tile grid. Then, hills are created at the locations (hexes) where tectonic plates overlap. Mountain tiles are subsequently created from hill tiles that are surrounded by hills. As you can see, this approach produces satisfying mountain ranges.

At this point each tile is assigned a wind direction that is determined by its latitude. Then, default precipitation and temperature levels are set. Mountains are cooler and water tiles are warmer. Tiles in rain shadows are determined by examining nearby mountain tiles and their wind directions. As you can see from the screens above, this approach creates deserts on one side of the mountain and forests on the other.

The maps are rather small at this point, but I do plan on making them much larger by adding biome regions (savana, tundra, taiga etc.). Creating biome regions shouldn't be too hard now, considering I have all the data I need (temperature, precipitation, wind, etc).

There are still many more features I want to add like, rivers, roads, settlements, beaches, coast line water foam, and the list goes on. I figure there is at least another month of solid coding to go. Working on the hex map wouldn't be so difficult if Unity terrains were much more intuitive and fully documented. The coordinate systems used by a terrain's trees, heightmaps, alphamaps, are all different and that makes it an obtuse beast to work with.


 
 
 

Comentários


THE GAME: 

 

Project XSYS is an untitled RPG Indie game that features world map HEX crawling, tactical turn based combat, and a multi-character party adventuring.    

 UPCOMING EVENTS: 

 

 FOLLOW THE GAME: 
  • Facebook B&W
  • Twitter B&W
  • Instagram B&W
 RECENT POSTS: 
 SEARCH BY TAGS: 

© 2023 by The Artifact. Proudly created with Wix.com

  • Facebook B&W
  • Twitter B&W
  • Instagram B&W
bottom of page