Terrain, homemade DEM/contour maps and HOG

knight44

New member
Gidday,

Like Jerry in his recent thread (Need a better way to grade the ground), I too have had trouble in trying to get smooth terrain over large areas. The area I am modelling is set in an area where the height ranges from 100m to over 600m. I tried DEM (it is available) but the detail wasn't sufficient plus I then shortened the real route so the DEM data couldn't be used anyway. I tried all the usual ways of forming terrain but nothing would give me anything approaching a realistic look for this area.

I then decided to make my own DEM map, or more accurately, my own contour map for the area, run this through HOG to get a gnd file, and then see what it would look like in Surveyor. At the start, I had no idea if this would work. After some trial and error, I am very pleased with the result and the speed with which I could cover an 8x22 board layout. About a day, with lots of trial and error.

I have not seen any reference to this method, but if I am repeating somebody else's description, my apologies.

I didn't take screenshots while doing this, but the following two images illustrate the technique I just used to cover 3x3 boards - this took just over 1 hour from start to finish.

This method can also be used to prepare a large number of boards, all set to a particular height. It took less than 5 minutes to set 8x11 boards to a uniform 100m.

Throughout this, I used Paint.net, but any decent paint program will be suitable, provided that it allows layers and a user-defined colour scheme. The contour map you finish with will be coloured in shades of grey - I defined 16 shades (from black to white) to suit my need.

Prepare a simple topograhic map that shows the stream pattern and the major ridge lines. You will need to know some spot heights. Add another layer and on this sketch in contour lines at reasonable intervals (in my case, every 100m) until you are satisfied with the look. If you aren't familiar with contour maps, get one and study how the contours flow around streams (lows) and ridges (highs). Then fill in with other contour lines to suit. The reason for the second layer is so that you can see the underlying stream/ridge pattern as you sketch the contours.

Taking care how you do this, fill in the lowest contour "band", eg less than 100m, with black (HOG recognises black as the lowest in height and white as the highest). Fill in each subsequent band, eg between 100m and 125m, with the appropriate shade of grey, with white in the highest band.

When finished, save this second layer, as a .tga file (for HOG), without the underlying stream/ridge pattern. You will need to resize this image to suit yourself, and it seems that 72x72 pixels will represent one board in Surveyor - plus you need to add 2 pixels all around, so 10x10 would be 724x724 pixels.

Some of you will now be saying "displacement maps", and you're right. At the moment this is simply a displacement map, but after running it through HOG, you will have a multi-board topographic map.

To avoid obvious steps in the topography in the final product, I used an effect in Paint.net called "Gaussian blur", to smooth the contours. This takes some trial and error to get the final effect you want. The smaller the contour interval, the smaller the steps, so keep this in mind when deciding on your contour interval.

Start HOG, select "Grey scale", not "Chroma depth colours", enter your height range, eg 100m to 600m, or just 100m to 100m if you want flat terrain, and let HOG do its thing.

Place the HOG-generated *.gnd file into the folder of the route you are building, delete the existing mapfile.gnd and rename your file to mapfile.gnd.

Load the route. Some fine tuning of the topograhy will almost certainly be required, but the ground-work (so to speak) is done.

Caution. I do not know of any way of copying track etc from one route to another, so this technique can only be used at the start of route building.

The first image shows the contour map partly done, with the stream pattern in dark blue and the ridge lines in dark green. Contour lines are in various colours (only for clarity). Some grey shading has been applied.

http://img519.imageshack.us/my.php?image=demotopolx0.jpg

The second image is a screenshot from Surveyor of part of the above map.

http://img108.imageshack.us/my.php?image=screen006zt6.jpg


Cheers

Richard

PS This is the first time I've tried adding images - I hope it works!!

EDIT.
Bugger, the images aren't visible, but the links work.
 
Last edited:
What was wrong with the original DEM-based terrain? An ordinary SRTM 3 arc sec DEM will provide us with a horizontal grid width of about 70 x 90 m, not too bad for hill terrain. That's the DEM. Now, depending on the way of processing it, some of the DEM information may be lost.

The conventional HOG approach, particularly when using the standard color palette transfers, will definitely contribute to the loss in vertical accuracy. The reason has been mentioned: Limited color range. 255 for grey scale but only 128 for "chroma depth". For a vertical range of 100 to 600 m this means about 2 m accuracy with grey scale or only 4 m with chroma depth. That's why I always avoided this technique, even when I employed HOG.


The smoothness of the terrain shown here is the effect of the low pass filter applied, the "Gaussian Blur".


Contour line tracing off a topographic map has been done several times before. One of the first tools with this feature was TSTF, originally written for MSTS and later added with a function to create Trainz-compatible displacement maps, in 2002. There are other and more advanced tools as well.

In my eyes, contour line tracing does make sense if a decent DEM is either not available (for the far North, above 60° latitude) or when a DEM is not detailed enough in some places. But I would start with the DEM as the basis and then refine it at those spots. This would save a lot of work.

geophil
 
Geophil,

Thanks for your reply.

What was wrong with the original DEM-based terrain? An ordinary SRTM 3 arc sec DEM will provide us with a horizontal grid width of about 70 x 90 m, not too bad for hill terrain.

The DEM data for this part of Australia is, I believe, only 10 arc secs. And as I'd shortened the real route, trying to cut,paste and blend DEM data to reflect the shortened route just didn't work. :(

The smoothness of the terrain shown here is the effect of the low pass filter applied, the "Gaussian Blur".
Quite correct, that's why I used it. :)

Contour line tracing off a topographic map has been done several times before.

And I apologised in advance if I was repeating known information. :)

In my eyes, contour line tracing does make sense if a decent DEM is either not available (for the far North, above 60° latitude) or when a DEM is not detailed enough in some places. But I would start with the DEM as the basis and then refine it at those spots. This would save a lot of work.

geophil

Yep, couldn't agree more. But in this particular case, the DEM data was unsuitable and this method worked for me - it may not be suitable for everybody.

Cheers

Richard
 
The DEM data for this part of Australia is, I believe, only 10 arc secs.

This could be DTED Level 0, 30 arc sec. The only free source when Trainz appeared in 2001.

SRTM 3 arc sec DEM data (60-70 x 90 m), however, is available for the entire continent of Australia since late 2003.

geophil
 
Hi all,

I created a route using the contour lines method and it worked out not too bad. I had issues with proportions however, for some reason everything was more spread out than it should have been. Im working on that right now. I did about 10 baseboards using this method but kind of got sloppy and tired of doing it. Works good with Photoshop however I couldn't figure out how to define the grayscale scheme.

Anyway with that aside I tried the DEM approach but ran into a big glitch, in canada, there is no TIGER data which, in the tutorial, is used to match up the lines with the DEM terrain. I could not figure out where the roads or anything went on my DEM generated terrain so it was totally useless, at least with the topo map method I was able to draw the lines and use my custom TIGER data.

If anyone has tips on the above mentioned challenges I ran into it would be great to hear.

thanks,
robby
 
Hi,

I am working right now on a fictitious route (for which of course there is no DEM), and I am using TransDem to create the terrain using contour tracing. Of course the contours are fictitious as well. Before geophil published TransDem there was only TSTF available. The program still is, but very recently the only forum for TSTF I know of was gone when UKTrainSim closed down (r.i.p.). I am doing things by trial and error.
During my TSTF time I found out that the idea of the program and the approach is good, but as it was only beta, it is by no means usable because the program crashes to desktop every time the user makes an error, as for instance forgetting to lift the pen when one wants to trace contours for the same height but on different peaks, or exceeding one of the limits of the program. Getting TSTF created terrain into Trainz would not be the problem, even when I don't use displacement maps, which are a bit tricky to create with TS2010. I would have used the UTF export whose output I would have put into TransDem using xyz import. So that is why I use TransDem directly.

Greetings,

Dralex
 
The contour line tracing methods originate from the pre-DEM times. The main reason for using them today is to alter or refine prefabricated DEMs. You can use them to create fictitious DEMs, too, of course.

I remember TSTF - I translated its user interface into German. Its one-dimensional interpolation delivered reasonable results, but I found it a bit limited. I searched for an alternative and ended up with the TIN algorithm and Barycentric interpolation which I implemented in TransDEM.
 
Another tool to use for the Virtual Terrains-Bryce 7 - Free on Cnet site

Hi,

I just made a post, after this one was done. I could not help to notice this one as, I was searching the net or hours today looking for similar information, as I merged two routes together, with very very different elevations.

I tried laboriously to get a slope between them and getting looking natural, but became discussed. Then I got hooked on the idea of using USGS data and DEM files, and creating virtual terrain models.

Here is a link to my post, a few above this one.

http://forums.auran.com/trainz/newreply.php?do=newreply&noquote=1&p=246880

If you are looking to make virtual worlds, Bryce 7, freeware on the Cnet site, may be a good place to start. I am new to this concept, "working outside of TRS to create terrain data."

Maybe you can add this to your tools. I know that it can export in DEM format.
 
Back
Top