Friday, April 24, 2015

libHexPlanet

I'm always interested in world building, and I saw some talk about generating entire spheres of hexes.  This is not straight forward, since you can't make a sphere entirely out of hexes (you usually get twelve pentagons).

I saw one guy who embraced the variation, and would randomly make more pentagons (with a septagon to balance each past twelve).  He also moved the points around, so the whole map is a little irregular.

There is another project - HexPlanet, which just has the twelve pentagons.  I've found that code a lot easier to work with, and when you have 100k+ hexes, twelve pentagons is hardly noticeable...

I've finally got it into a state where I can easily generate some map data.  Here is sphere 9, which is nearly 200k hexes.  I should be able to get sphere 10 working (nearly 600k hexes), with an stretch goal of sphere 11 (should be over 1.5M hexes).

The terrain is a little hard to see, since it is entirely random.  But you can see how small the hexes are in sphere 9.