Hey all. Some of you are probably familiar with Zeustiak and his impressive work making a hex based world map generator. If not, enjoy the read:
Map Generator 3.0 - Please Critique! - Blueprint - Unreal Engine Forums!
I just happened to be wanting to kick the rust off my content creation skills at the time I came across that thread so I reached out to Zeustiak asking if he needed any help creating assets. As it turned out, he did. Since Z is doing all of his work in blueprint, procedurally generating the terrain seems a bit outside the realm of feasibility, so he’s been placing static meshes for each hex tile. I offered to make new, high quality tiles for him. So I’ve spent the last few weeks working out ways to create decent looking terrain tiles for a hex based map, as one might find in Civilization V for example. Follow me on my journey.
First off, here’s an obligatory image to catch your eye:
This is not using Z’s system, this is just me placing things in a level by hand to see how they look.
I’m going to use this thread to go through the process of how I make one of these tiles, both for posterity and to see if I’m insane for doing it this way.
First, a caveat. Most of the tools I use are dictated by the fact I am working on a Mac. This does limit the availability of some of the more popular tools so I’ve had to find other ways of doing a few things. I know I can install Windows or run a VM but part of my desire to do this is to see just how viable the Mac is as a games production platform. Until very recently, unless you were making a 2D iphone game, the Mac really couldn’t be taken seriously. I am happy that this is changing. But, I don’t mean this thread to be, or become, a platform discussion. I just want the facts to be known to avoid spending time on unnecessary questions. Now, on to the process.
Since I needed to make terrain, I turned to my longtime favorite terrain making program, Terragen. Using a combination of heightfield and displacement shaders, all masked through a hexagon mask image, I was able to extract good quality EXR height maps that I could then use to create the actual geometry.
Here’s the shader network I am using:
By right clicking on the Save Me node, I can save out the height field as a 32-bit EXR. Here’s an example (converted to an 8-bit PNG):
Figuring out what to do once I had this EXR took a little more doing… I tried a few different things, like using Terragen’s own micro-exporter to try and get a FBX mesh directly out of Terragen. Alas, it became very quickly obvious that Terragen’s output is not intended for use in a realtime environment. Even with details turned WAY down, the output contains hundreds of thousands of triangles and there are myriad issues with the mesh, including random holes in the mesh, lamina faces, non-manifold geometry, etc. Not something easily dealt with. So, I decided to try and use the EXR as a displacement map within Maya. This got me where I needed to be. By using Maya’s Modify->Convert->Displacement To Polygons function, I was able to take a flat hexagonal mesh:
and get a very mountain-y looking mesh:
Now, this looks good, but at 3.24 M polygons, it’s a bit too hefty for the purpose it is intended for. So, by tweaking down the values in the Displacement Map section of the attribute editor, going from:
to
I was able to reduce the output mesh down to 2304 tris without it looking too horrible:
I’m reaching the limit of a post now so I’ll break here and pickup on the process in the next post.