Sunday, August 21, 2011

Making a Height map, part 1 – Height units

Many of the guides to make Height maps I have read were based on the use of Fractal mapper, TES4 Construction Set or GeoControl. These tools make new or random maps, which you can then change. I already had a world planed out and it felt like a lot of work to redraw everything again. I will start by going throught the trial and errors I have tested to figure out how to make my map functional in TES4 Oblivion. So I did a basic simple height map in PhotoShop/Gimp2. A height map is an image file where the color value corresponds to a height in the landscape. Black is low and white is high.
Height units used in Oblivion
This can be a bit confusing (not sure I have completely figured it out get). The Construction set wiki has a good over view.
Now I also have to mention a really useful tool TESAnnwyn, a program that can among other things converts height map images in to esp files (see Link list). It’s a lot faster than the CS (Construction Set) and avoids the painful CS crashes.
According to the TESAnnwyn help file, a 16-bit RAW image file has a range of 65536 (-32768 to +32767) TES Height Units (THU), 524 288 (-262 144 to +262 136) Game Units (GU) and 7 471m. 1 THU is 8 GU and multiplying GU by 0.1428767293691635 will give the height in cm.
Testing my Height map
I started by using a 16-bit grayscale RAW, that goes from 100% (black) to 3% (almost white). I made it by using the gradient tool in PS. After running it with the TESAnnwyn to make an .esp, I check it out in the CS with the height map editor (right). I got some puzzling effects, not a nice hill as expected.
Each color represent a height in THU, from 0-65535. If the height differens in the map is to great it introduses rips in the textures around 20 000 units. This makes the map starta at minimum levels instead of continuing up (dark blue).
The color map from the heightmap editor:
In TESAnnwyn it is possible to scale the height values with the –s function. I tried scaling with 0.125 (1/8), but as you see the height still hits the roof and starts at minimum, but just once (left, the dark lilac color). Scaling more 1/16 (-s 0.0625, middle) and 1/32 (-s 0.03125, right) does not fix this problem, only makes the height range more flat.
The only thing I can figure out that solves this is not using the full range of color in the original height map. I made a new RAW file ranging from 100% to 51% black. Now the slope is less, and I get the full 65 535 GU. The height still hits the roof and turns negative (left). With scaling of 1/2 (-s 0.5) and the use of another function, height alteration, -h of -8192 units, I have a height map that uses full range of GU and don't flip to min in height (right). According to the TESAnnwyn the height range of my map is -116 to 3544m without scaling and -116 to 1713m with. This is with the setting -h -8192, without this adjustment the map will flip to negative, and there will be nothing at sea level (-h - 4096).
Now I just have to see if this works with my real map :)

Well it turned out I needed to do some more testing to make things work, see the next post.

No comments:

Post a Comment