Jump to content
Sign in to follow this  
Nicholas Bell

An Alternate Method to Creating Height Maps

Recommended Posts

This is not as difficult or time-consuming as it might appear.

First, you need a topographic map, at least 1:50,000 scale. Of course 1:24,000 or less is even better. You can find plenty on the internet. You can also purchase them in paper or digital versions. I've got a massive amount of topos available through my own collecting and because of my map making for HPS Simulations, so finding something interesting wasn't difficult for me. smile_o.gif

Starting with a fairly extensive urban area on my Bluefields, Nicaragua map has tempered my enthusiasm for such projects, so I've decided to select a more rural area dotted with small towns easy to replicate in Visitor, with mixed open terrain and scattered forest to keep up the frame rate while playing. The interest in the Cold War, coupled with the fact that I served in the US Army in 1980's in Germany makes it "no-brainer" for me to pick out a map from central Germany.

The map:

Map.jpg

A scan of the map area I choose to depict:

SchmalfeldenMapScan.jpg

I scale the scanned image so each pixel equals one meter. This is a 5120 x 5120 map.

Zoomed in you can see the contour lines - 20 meter base with 10 meter intermediate lines.

SchmalfeldenMapScanZoomed.jpg

Determine the high an low points on the map, and assign greyscale values to the contour lines to correspond. Since the elevations range from 410 to 490 meters, I use an RGP value of the elevation minus 400 to keep it simple (ie elevation 450 is assigned color value R:50 G:50 B:50). The max and min height in the PBL file define the actual in game elevations of course.

I create a separate layer for each contour which makes finding and correcting mistakes easy.

Image1-1.jpg

The areas enclosed in contour lines are filled with the same color.

SchmalfeldenContoursFilled.jpg

Share this post


Link to post
Share on other sites

If used as is, the map would have terraced plateau elevations - they need to be smoothed. I use various methods in Paint Shop Pro and Wilbur to achieve this. Gaussian Blur is quite useful, but one must be careful not to lose the high or low points in the blur. Narrow valleys and ridges can get reduced, so some smoothing "by hand" along the slopes, but not at the bottom and top of those slopes, is required.

Also, I rescaled the image to 512 x 512 pixels to work in V3.

In Wilbur:

Wilbur.jpg

Eventually I did some adjustments in the narrow valleys in V3 and Bulldozer, exported the changes to a new PNG file, re-smoothed the areas and then reimported into V3. Final terrain.png looks like this:

terrain.png

Share this post


Link to post
Share on other sites

Although not related to making a height map, I'll continue the process a bit further.

Using the nifty Google Map Image Downloader I created a high-res image of the area and scaled it to match my map.

sat_lco.png

Although this image is going to require a lot of retouching to make it usable as the sat_lco file, this will be easier than creating the satellite image from scratch. Plus it makes placing objects like roads easy:

RoadConstruction.jpg

Share this post


Link to post
Share on other sites

Maybe I'm not very smart but I cant understand How to do this with photoshop. It will be very interesting to explain your method step by step !

Share this post


Link to post
Share on other sites

Eh what did he just post then ?

This is a great find on doing it mate, and i think its well described here.

Great job, keep it up,

Allie

PS; learning Photoshop is done in the photoshop forum.

Share this post


Link to post
Share on other sites

can I ask where you got the RGB values for the corresponding heights? I just started trying to get a height map made with Photoshop + Wilbur but I just have no idea where to find height in RGB code

Share this post


Link to post
Share on other sites

Hey, thanks!

I made some research around this very same topic maybe 4 years ago. You want to know what I found back then? I found a program which takes a contour map image and creates a heightmap out of it! It of course required manual input like setting some parameters, so it was not an automatic conversion certainly.

I found it after I had been thinking how I could best get my local area modelled into the game. I couldn't find appropriate satellite data for my area so I started looking at generating a terrain from an old-style map. And eventually I found that program, and I have a feeling that there were even more than one program which could be used to convert a contour image into a heightfield.

I stopped doing that kind of research and haven't touched the subject for a long time. I have no idea if I have that program still somewhere, or any other stuff I collected back then.  But it should be found with search engines if someone wants to find it, I think.

Best Regards,

Baddo.

Share this post


Link to post
Share on other sites

Guys, Nicholas Bell is using Paintshop and not Photoshop in this tutorial.

Share this post


Link to post
Share on other sites

To pick a color across the whole image (just mucked around with photoshop till I found out how).

1. Eye Dropper Tool

2. Select -> Color Range -> Fuzziness = 0, and it should select everything under that RGB code, however to fill in the contours you may have to simply select the inverse and colour in yourself, simply doing the same thing as described above, start off with a bass color (perhaps %30 white or something), then apply it to a black background, with %5 opacity, then slowly do an extra "overun of white for each inner contour.

This is just temporary till I find any easier way of course. Great Tutorial and Information anyway buddy, thanks!

Share this post


Link to post
Share on other sites

Heightmap is in greyscale, so BLACK is lowest point and WHITE is highest point.

So its a gradient from BLACK to WHITE !!

Photoshop, Paintshop, Coffeeshop........ whats the difference smile_o.gif

Later,

Allie

Share this post


Link to post
Share on other sites

thanks man. So when I set minimal height at -100 and max height at 100 the scale is black= -100 50%Gray= 0 and white= 100 right?

Share this post


Link to post
Share on other sites

I don't have Photoshop, but as Allie points out they all work the same.

The essence of the process is:

1. Scan and scale topo map to correct size for use in V3 in accordance with the parameters and island size you are using.

2. Convert scan to greyscale.

3. Create raster layers on top of topo map image which should be your background layer. Each of the new raster layers should correspond to a contour elevation (main or intermediate - you can also create your own intermediate contours by interpolation to help better define elevations)

4. Assign each layer an RGB value to correspond to the contour elevation. Darker is lower in elevation. RBG value ranges from 0,0,0 (black) to 255,255,255 (white). It is not necessary to use 255,255,255 as the layer equalling the highest elevation, as V3 will take the max & min elevation from the PBL file. If you export the terrain.png from V3 you will see that V3 has changed the heightmap so that the highest point is 255,255,255. But you don't have to work that out yourself.

Instead I just make the RGB value easy to determine based on the range of elevations on the map.

For example:

Elevation RGB

450 45,45,45

440 44,44,44

430 43,43,43

420 42,42,42

You can use any scheme as long as the interval between elevations has an equal interval between the RGB values.

5. Use the pencil (or a brush set to 100% hardness) to prevent anti-aliasing when you trance the contour lines. You want solid color.

6. In each layer, use flood fill (or paint bucket) to fill the elevation within the contours lines with the same RGB value as the contour line. Understand that contour lines will either be enclosed shapes or will run off the map. I guess you need to understand how to read a topographic map. If you don't, this process probably has you pretty confused. Google topographic map and you will get plenty of help.

PSHelp.jpg

Hope this helps get you started a little better.

Share this post


Link to post
Share on other sites

Sorry for the Thread Necromancy...

Is it possible someone describe it again with pictures? Or does someone know another way to create a heightmap from contour lines?

Or a newer tutorial? Because i cannot find a good one - the problem is, that i wanna create a 5x5km map from a real city. Not that big ^^

But it would be nice if there is an easy way to create a hight map from the contour lines...

Greets

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×