How To: Generate Superb Heightmaps :)

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Kyzariel
Engineer
Engineer
Posts: 1
Joined: 20 Mar 2015 16:14

Re: How To: Generate Superb Heightmaps :)

Post by Kyzariel »

Hello, everyone!

As I have had a go at generating heightmaps, I thought I'd share this one with you. It is basically an Anatolian peninsula-centric map.
As the CGIAR-CSI SRTM data doesn't handle the Black Sea very graciously, I did some editing in GIMP.

I also tried adding the Nile and Danube at sea level with mixed results (I basically stopped with the Danube at the Pannonian Plains as there is little elevation data to guide you graphically -- due to the remnants of the Ancient Pannonian Sea basin there -- and I am not that good at drawing to reproduce it by hand). Lakes and (notably) the Dead Sea will not have water though. Future retouches perhaps?

It is 2048x2048 pixels, but considering the above I would recommend a 1024x1024 map. Hope this will be of use! :)
Attachments
EastMed+BlackSeas.png
Eastern Mediterranean, Black Sea and some of the Red Sea
(2.25 MiB) Downloaded 4 times
Eisenbaehr
Engineer
Engineer
Posts: 62
Joined: 29 May 2006 06:59
Location: Germany

Re: How To: Generate Superb Heightmaps :)

Post by Eisenbaehr »

n1 this EastMed+BlackSeas-Map. A little bit of africa, of europe, russia... Is it playable for 1024? Can you put a trainstation in italy or greece?
User avatar
SwissFan91
Tycoon
Tycoon
Posts: 2395
Joined: 08 Feb 2009 18:36
Location: Alberta, Canada

Re: How To: Generate Superb Heightmaps :)

Post by SwissFan91 »

Now that we have new height levels - am I right in thinking that heightmaps don't translate into 'good-looking' scenarios because they have too little resolution?

When using a regular heightmap, I get terrain like this:
screenshot#1.png
(110.53 KiB) Downloaded 2 times
Would a higher resolution heightmap actually show definition in these hillsides? Or is it just a game limitation?
Total Alpine Replacement Set: Industry, Town, Objects
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: How To: Generate Superb Heightmaps :)

Post by Eddi »

the problem there is not he resolution of the heightmap, but that openttd is terrible with steep hills.

maybe you can work around that by lowering the contrast on the heightmap, so high and low areas are not that close together
User avatar
Chrill
Moderator
Moderator
Posts: 15972
Joined: 18 Dec 2004 17:35
Location: Stockholm, Sweden
Contact:

Re: How To: Generate Superb Heightmaps :)

Post by Chrill »

Yes, the problem is that OpenTTD can't make mountains climb steep enough for what "real life" represents. Basically, you need a flatter heightmap to get a better-looking scenario.
Image
My Scenarios:
Archipiélago Hermoso (Latest Release: Version 3.2)
Turnpike Falls (Latest Release: Version 0.91)
User avatar
SwissFan91
Tycoon
Tycoon
Posts: 2395
Joined: 08 Feb 2009 18:36
Location: Alberta, Canada

Re: How To: Generate Superb Heightmaps :)

Post by SwissFan91 »

Or a smaller sample area? If you made a 2048x2048 map of just one valley in Switzerland vs the whole of Central Europe, the game would have more 'room' to create the steep hillsides?
Total Alpine Replacement Set: Industry, Town, Objects
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: How To: Generate Superb Heightmaps :)

Post by Eddi »

the size of the map is really irrelevant. within each small area, you cannot have a high difference between lowest (darkest) and highest (brightest) point. you can certainly go lower or higher in other parts of the map.

you can have low plains and high peaks, but you cannot have low valleys between the high peaks. you need to settle for medium valleys.
User avatar
TrainLover
Engineer
Engineer
Posts: 107
Joined: 01 Jul 2015 15:03

Re: How To: Generate Superb Heightmaps :)

Post by TrainLover »

I have a problem because I did everything even the srtm things. The fact is that the elevation things aren't working. The DEM green dots are not showing. What did I do wrong?
Developer of North American Passenger Liveries: viewtopic.php?f=26&t=87228
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: How To: Generate Superb Heightmaps :)

Post by kamnet »

You didn't. The program changed, it no longer functions like it did. Nobody's found a new solution.
User avatar
TrainLover
Engineer
Engineer
Posts: 107
Joined: 01 Jul 2015 15:03

Re: How To: Generate Superb Heightmaps :)

Post by TrainLover »

kamnet wrote:You didn't. The program changed, it no longer functions like it did. Nobody's found a new solution.
What is the last functioning version that I could make good heightmaps?
Developer of North American Passenger Liveries: viewtopic.php?f=26&t=87228
Yoshi
Transport Coordinator
Transport Coordinator
Posts: 278
Joined: 21 Dec 2010 17:24

Re: How To: Generate Superb Heightmaps :)

Post by Yoshi »

You may download the DEMs of the area you want by using this:
http://srtm.csi.cgiar.org/SELECTION/inputCoord.asp
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: How To: Generate Superb Heightmaps :)

Post by kamnet »

TrainLover wrote:
kamnet wrote:You didn't. The program changed, it no longer functions like it did. Nobody's found a new solution.
What is the last functioning version that I could make good heightmaps?
There isn't. The servers that showed the green DEM heights is no longer online.
reidh
Engineer
Engineer
Posts: 1
Joined: 15 Nov 2015 01:13

Re: How To: Generate Superb Heightmaps :)

Post by reidh »

MGSteve wrote:(Can one of the mods make this a sticky, a lot of people may find it very useyfull!)
Thank You I'm gonna try this. :bow:
Keplergamer
Engineer
Engineer
Posts: 7
Joined: 04 Aug 2015 03:05

Re: How To: Generate Superb Heightmaps :)

Post by Keplergamer »

Hey, check out this program!!!!!


http://www.world-machine.com/




It's great to make a world, and it exports a height-map at the end.

I just found out about it watching this video:


There you can learn the basics in 6 minutes. I haven't even tried it myself but I thought I HAD to share this before it.

Another tutorial, this from the official creators:






And some other:




It seems to be an immensely powerful tool, the sky is the limit.


Have fun. :)
arikover
Route Supervisor
Route Supervisor
Posts: 466
Joined: 15 Jun 2007 09:27
Skype: madchimiste
Location: Berlin, Deutschland

Re: How To: Generate Superb Heightmaps :)

Post by arikover »

For those of you who like to create imaginary heightmaps from scratch, you could use Wilbur (completely free software). You can draw heightmaps, generate them (via fractal noise for example) or simply import a png file. Then you can change the sea level, add some erosion... In the end, you can have really cool heghtmaps. There are some additional tutorials at the Cartographers' Guild.
User avatar
Awesometrains
Traffic Manager
Traffic Manager
Posts: 129
Joined: 22 Nov 2015 17:07

Re: How To: Generate Superb Heightmaps :)

Post by Awesometrains »

MGSteve wrote:(Can one of the mods make this a sticky, a lot of people may find it very useyfull!)

Ok, firstly you'll need a reasonably beefy PC to do this, as the data crunching is quite intense.

You will need the following:

* Google Earth (http://earth.google.com)
* MicroDem (http://www.usna.edu/Users/oceano/pguth/ ... crodem.htm)
* SRTM Overlay for GoogleEarth (Run from URL once you've installed Google Earth - http://www.ambiotek.com/topoview).
* A graphics program, such as Photoshop, Paintshop Pro etc.. to covert a TIF to PNG.
* As mentioned above, a fairly beefy PC, esp. if you are trying to generate a map covering a large (continents) area.
* (I have a AMD 64x2 3800 with 2GB of ram and it can take a while on mine!)

OK, before we start, make sure you've installed Google Earth, the SRTM Overlay & Microdem.

Overview
The steps involved are to find the DEM data for the area you're interested in. Load up Google Earth (GE) and if the SRTM overlay has installed correctly, you should have an SRTM2 category in the Places list in GE. Put a tick in the box next to SRTM2 and you should see loads of boxes appear over the globe, each with a green dot in the middle.

If you click on the Green dot, you then have the option to download the DEM data for that cell. Once we have the cell(s) we need, we then need to load them into Microdem, reduce the definition of the data from really detailed to detailed enough for what we want.

Once we've done this, we then merge the thined DEM files into a complete DEM file, which we then load back into Microdem and then export it out as a TIF, convert the TIF into a PNG and then use it in OpenTTD!

Sound simple? Yes? You're mad, its not simple its a ball ache! Anyway, here goes.

Google Earth
Firstly, if you're running NT4, Windows 2000, XP or Vista, you may want to enable folder compression in the folder you're going to save the DEM files to. Zipped the Dem files are 20odd MB, unzipped they're often 150mb, by using the built in file compression within NTFS, you save a fair amount of disk space. To turn it on, right click on the folder you're going to save the DEMS to (I'd recommend c:\Mapdata\DEMs\). Select Properties & then click the 'Advanced' button at the bottom, next to File Attributes. Put a tick in the 'Compress contents to save disk space' and click OK. Done :)

Now, in GE locate the area you want to generate a map for - in this example I'm going to do The Carribean island of Hispanola (Haiti & the Domincan Republic).

Image

Now, on the pic, you'll notice the two green buttons for S_22_09 and S_23_09 - these are the two DEMs we'll need.

Click on the Green buttons and you'll see a page pop up, scroll to the start of the links and you'll want to download either of the first two links (Either from the US or UK Servers, it doesn't matter), its the data file in ARCASCII format.

Save the files into the C:\mapdata\dems\ folder.

Once you've done that for both DEM cells, close GE, you don't need it any more.

MicroDem

Unzip the DEM files from their zips and then fire up MicroDem.

Click on File->Open DEM In the Files of Type box, make sure ASCII Arc Grid (*.asc) is selected, browse to the folder and select either of the two files. Microdem will now load the DEM file.

By default you get all the legends and other stuff you don't need, to turn these off. You'll only need to do this the first time, as it remembers these settings. Right click on the map & select 'Legends / Marginalia'. Click on 'Scale Bar' and untick the 'Include on Maps' box. Do the same with the Elevations button.

Then click OK to close the Map Marginalia window.

Right, by default the DEM files we downloaded are way too detailed to be of use, so we need to 'thin' them. To do this, select Raster GIS->Thin DEM (Decimate). Select a Thin Factor of 3. Then click File->Save DEM->ASCII Arc Grid. Save the file under a new name in the same location as the maps (S_22_09_Thin.asc) is a good suggestion, basically just add '_thin' to the filename.

Close the two Micodem map windows & repeat the process with the 2nd map. (Or as many maps as you need).

You should now end up with a 'thin' DEM file for each of the cells you have.

Note, the next step is to merge the DEM files into one single file. The program does have a limit to the number of columns and rows of data it can handle in a DEM file. If you find that you are exceeding this limit (default at a thin factor of 3 would result in a maximum grid of 12 cells x 12 cells. (24000x24000). If you are needing more cells then you will need to thin by a factor of 4 or even 5. Don't worry about the degration in quality of the map, as you're using so many cells it won't matter.

Ok, from the File menu select 'File->Data Manipulation'. On the new window, select 'Merge->DEMs->DEMs -- pick multiple'. Browse to the 'thin' files you saved and select them all in one go. This will add them into the merge list. When you have added the last file, click 'Cancel' on the Open dialog.

Microdem will then ask you for the name of the file to save to, save it into the same folder under the name of Hispanola.DEM (obviously change this name if you're not doing hispanola).

Image

Close the Data Manipulation window by clicking File->Close.

Now load up the saved DEM file by clicking 'File->Open DEM', change the Files of Type list to 'Any Likely DEM'. You should now see the two DEM cells merged into one.

Image

Right, we now need to crop the map to the area we want. On the tool bar of the Map window (not the main microdem toolbar), you'll see a button which looks like a dotted rectangle with an arrow at the bottom right (7th in from the left). THis is the create subset button, click it and then click and drag across the map area (You must click & drag from the top left to the bottom right of the area, if you do this wrong, you'll get a message anyway.).

Image

Microdem will automatically zoom into the cropped area. If you made a mistake and cropped off an area you want, simply undo the crop (the crop operation is called a subset), by clicking the 'undo subset' button (to the right of the create subset button).

Right, now we need to change this to a grayscale map. Right click on the map and select 'Display Parameter' and then from the popup menu, select 'Elevation'.

Select 'Gray scale' from the list of radio options and then click on the Z Range button. The Z Range basically controls how the heights are mapped onto the grayscale colours, the greater the height, the lighter the colour.

Normally you'll want to select the defaults, but if you find the OpenTTD doesn't get the coast lines right, its probably because the ground is too dark and OpenTTD can't tell what's land and what's sea. If this is the case, lower the Max value until the problem goes anyway. you may also want to lower the Min Value too, as this will effectivly start 'sea level' at a lower position on the map. In this case we need to tweak these values, so enter a min of -150 and a max of 2500.

Update

I've just generated a UK heightmap and the defaults I suggested above left half of East Anglia under water. Perhaps a preview of things to come when sea levels rise!? (You could use these figures to create such an example, btw).

Anyway, I got the best results by leaving those two figures at the MicroDem suggested defaults. It may be worth trying that first and seeing what you get generated in OpenTTD.

/end update

Click OK and then OK again and the map will redraw.
Image

Finally, we need to resize the map to 1:1 pixel mapping. To do this, on the map window's toolbar, you will see zoom and unzoom buttons, between them is a number 1 in a magnifying glass. Click this button. You may or may not get a warning about memory usage, depending on the size of the DEM data, but its not that much of an issue.

Now we need to save this out. Microdem doesn't export to PNG, so we need to export as a TIF file, a GeoTIFF to be precise. Click on 'File->Save Map as Image->GeoTIFF, screen scale'. This will automatically default to the folder c:\mapdata\Images, which is fine. Enter an appropriate name and click save.

Now fire up the image editing software, for this tutorial, I'll be using PaintShop Pro. Photoshop would do as an alternative, but its like using a sledgehammer to crack a walnut! Paintshop pro is great for simple things like this.

Paintshop Pro

Open the TIF file. The next thing we need to do is try and match the resolution of the file to the resolutions of the OpenTTD maps.

Normally you'll probably create a 512 or 1024 longest edge sized map. So you need to work out the best image size.

This particular example is pretty much an obvious 1024x512 map size. (Would be ideal if you could enter a custom map size though!)

For land locked maps (i.e. with no sea on one or more sides, its imperative that you match the image size with the map size, otherwise you'll end up with sea off the side of the map.

We can resize this map to 2048 x 1024 This will need a bit of cropping and resizing to do it, so I'll leave it up to you as to how you do this, as it will really depend on how tightly you cropped the DEM file. What I did was to resize the width to 2048 and then resize the canvas to 1024, so it added more sea to the top and bottom of the image.

Now click File->Save As and save it as a PNG file. Probably best to save this in OpenTTD's heightmaps directory.

There you go, one heightmap! Load it up into the scenario editor in OpenTTD (remembering to select the right map size, in this case a 2048 x 1024 heightmap would equate to a 2048x1024 map for the best quality, or a 1024x512 map or a 512x256 map. As long as the ratio stays the same, it will be fine :)

If you find that the shorelines have crept inland a bit then you'll need to go back to the step where you created the grayscale map and alter the Z range numbers abit. Alternatively, in the image editor software you could try selecting the sea, inverting the selection and altering the gamma of the land, effectivley lightening it.

Image

As you can see from the finished map, by comparing it to the Google Earth image, it hasn't quite got the north coast quite right. its probably quite low lying land. You can either fill gaps like this in by hand or simply retweak the grayscale map and try again.

If you have any questions, feel free to post :) I hope people find this of some use.

[EDITED] - made this a sticky - Bjarni
[Updated 24th Sept 2008, reflected changes to Microdem, v10.0 Build 2008.8.11.2]
[Updated 1st July 2010, updated image URLs following server move, sorry about that - MGSteve]
What would you classify as a "Reasonably Beefy PC" ?
Qa'pla!
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: How To: Generate Superb Heightmaps :)

Post by kamnet »

Awesometrains wrote:What would you classify as a "Reasonably Beefy PC" ?
In 2010 you were probably talking an Intel Core i3 or i5 processor and 8GB of RAM.
User avatar
Awesometrains
Traffic Manager
Traffic Manager
Posts: 129
Joined: 22 Nov 2015 17:07

Re: How To: Generate Superb Heightmaps :)

Post by Awesometrains »

kamnet wrote:
Awesometrains wrote:What would you classify as a "Reasonably Beefy PC" ?
In 2010 you were probably talking an Intel Core i3 or i5 processor and 8GB of RAM.
well im not gonna try this cuz I have 4GB of RAM
Qa'pla!
Chrysa
Engineer
Engineer
Posts: 1
Joined: 08 Feb 2014 00:56

Re: How To: Generate Superb Heightmaps :)

Post by Chrysa »

Is there any way of generating a heightmap of Nunavut I can use? The Google earth thing doesn't work for me.
Timeflyer
Traffic Manager
Traffic Manager
Posts: 156
Joined: 29 Feb 2016 15:24

Re: How To: Generate Superb Heightmaps :)

Post by Timeflyer »

Try this one
Size: 1024x512
Attachments
TryNuna.png
TryNuna.png (48.81 KiB) Viewed 5636 times
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 2 guests