Map Database  •  FAQ  •  RSS  •  Login

[TUTORIAL] Height Maps in Krom's Editor

<<

Siegfried

User avatar

Knight

Posts: 494

Joined: 24 Jul 2009, 22:00

Post 11 Oct 2011, 07:27

[TUTORIAL] Height Maps in Krom's Editor

Making realistic landscape heights with Krom's Map Editor

There is a feature hidden in Krom's editor that allows you to use realistic height maps, for example the SRTM data of earth.

Step 1:
Look for the region of earth that you want to build your map of. This can be done with google earth for example. The SRTM plugin for google earth can be found here (scroll down).
Or, if the googleearth plugin does not work for you (it did not for me, but you find tons of users that claim that it works), then you can directly download it from the google maps application on this website (or, if you know the coordinates and do not need the visual map, go directly to the download portal).

You must know, that the files from the latter download location have the size of exactly 6000 x 6000 pixels - this corresponds to a real size of 5x5 degrees on earth' surface.
Or, in other words, each pixel stands for 90m x 90m in real.

11px x 11px therefore gives you 1 square kilometer. Keep this in mind as this is important for your map size.

Step 2:
The tif-file inside the downloaded zip ist a 16bit GeoTIFF-file. You can directly open it with photoshop (version >= CS2). Unfortunately, because of lacking 16bit-support, I could not find a open source or freeware program that is able to work with it properly. So if you have problems, maybe ask someone who has photoshop, or as the very last instance, ask me, I could convert it for you.


For example, the map of northern England would look like this:
Image

You can only see black and grey. This is because the height information is in 16bit, but your display only shows as much as 8bit, so all height information is hidden in the black area.

To make it visible, you need to play with the curve adjustments.

Step 3:
Drag the curve to the left - this corresponds to an increased contrast. You will notice, that the mountains become white.
Image

On this point, it is necessary to understand the meaning of the colors. A white pixel means, that this tile will be elevated to the maximum, a black pixel means a minimum elevation. Gray pixels lie between. The brighter the gray is the more elevated will it be at the end.

Step 4:
Select the area, that you will finally want to make your map of. At this point, you must decide what size your map shall have. In my example, I want to have a 128x112 map, therefore I select a 96x84 rectangle (I will tell you later why I want the map to be larger than the selection).
Image

Step 5:
Now comes the fine tuning of the curve adjustments. Open the histogram and the curves adjustment and play with it the way you want. If you want to have the full height scale that is available in KaM, then the histogram should have bars distributed all over the horizontal line. If you want to have a flatter map, keep the bars in the left region.
Image

Step 6:
If you have chosen a rectangle of a different size than your final map, you must resize this. You should pay attention to the resizing method. For example the free Paint.NET allows to choose the interpolation. If you choose 'bilinear' or 'bicubic', you will end up with a totally smooth map - which may be wanted or not. In my case, this would totally destroy the look of the map because all slopes would be completely smeared out. So I choose 'next neighbor'.

Step 7:
Look through your height map as it can have some distortions. This is because of measuring errors that are normal and can be found on nearly all SRTM maps. You find them for example in white pixels inside a black region. Just take a pen and make those pixels black. That's fine. Then save the file as bitmap (.bmp), because Krom's editor can only read bitmaps for good reasons!

Step 8:
Now your height map is ready. Go to Krom's editor, open a new map with the wanted size, go to "Relief" (below the overview map) and click "Load Image".

And voila, there you are:
Image



Tipps and Tricks:
- Increase the size of you height map, just like described in step 4. The reason can be seen in the following two pictures:

Test 1:
ImageImage

Test 2:
ImageImage

if you just have one pixel, then you end up with a graphically totally messed up spike - not very realistic, is it?
But if you have a whole bunch of pixels representing a mountain, it looks better. Either way you have to go through the whole map and fix the graphical glitches.

- Of course, you can not only work with SRTM height maps, but you can take every picture that you want as a height map. Just make sure, that it is a grayscale (8-bit) bmp file of the exact size of your KaM map.
See? Look at the borders to the left and right. The gray pixels there make a nixe transtition. But the abrupt transtition on the top ends in graphical glitches.
ImageImage

- if you beg Krom to add a new function inside his map editor - an export function that saves the height information in a bmp file - you could drastically increase making symmetrical maps. Then you would only need to make mountains for one player, export the height map, clone the part of the player in a picture editor, re-import them and you're practically done.

Have fun!

*edit: thumbnails added - please click the pictures to enlarge
<<

T*AnTi-V!RuZz

User avatar

Former Site Admin

Posts: 1826

Joined: 03 Jan 2007, 23:00

KaM Skill Level: Fair

Website: http://www.knightsandmerchants.net

Location: The Netherlands

Post 11 Oct 2011, 11:32

Please fix the screenshots (use thumbnails).

Great tutorial !

Edit: thanks!

Return to “Map Design”

Who is online

Users browsing this forum: Google [Bot] and 27 guests