Importing HeightMaps in OpenTTD?
Moderator: OpenTTD Developers
Just postet a scenario of Japan made from a height map on the topic "World Scenario" ... they are both made from the maps on:
http://www.ngdc.noaa.gov/mgg/topo/globegal.html
http://www.ngdc.noaa.gov/mgg/topo/globegal.html
@Born_Acorn: Your palette's in the wrong order. Unfortunately, I don't have any good ideas on how to fix that.
@batman, you need an indexed PNG (not true-color) that is the same size as the map you are creating. The GIMP can make indexed PNGs.
Idea: generate a palette entry -> height table, so the palette order is not important? This should be do-able, since [0][0] is required to be height 0, and all other heights are higher. (Image->Mode->Indexed, I believe)
things_to_do.enqueue(palette_to_height_table_for_PNG);
@batman, you need an indexed PNG (not true-color) that is the same size as the map you are creating. The GIMP can make indexed PNGs.
Idea: generate a palette entry -> height table, so the palette order is not important? This should be do-able, since [0][0] is required to be height 0, and all other heights are higher. (Image->Mode->Indexed, I believe)
things_to_do.enqueue(palette_to_height_table_for_PNG);
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Would be cool if it could manage anything we throw at it, like for example a true color PNG with more than the allowed height levels.
It should interpolate the Min -> Mid -> Max height levels of the true color PNG and create a map with corrected values. Very noob friendly, heh.
Or is this beyond the point of the tool?
It should interpolate the Min -> Mid -> Max height levels of the true color PNG and create a map with corrected values. Very noob friendly, heh.
Or is this beyond the point of the tool?
Yes, it should be able to take anything. I think the plan for 24-bit color is to convert to greyscale first, and then map brightness->height.
OK, so I can imagine some particularly perverse PNGs (4-bit color with 9 different values in a square of 3x3 pixels, for example (even better: the center pixel is the same color as [0][0])) that may never be valid, but that would probably qualify as a pathological case.
OK, so I can imagine some particularly perverse PNGs (4-bit color with 9 different values in a square of 3x3 pixels, for example (even better: the center pixel is the same color as [0][0])) that may never be valid, but that would probably qualify as a pathological case.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Tips for creating a map using GIMP:
1. If the image is colored, use: Tools->Color Tools->Levels and adjust the tree colors. Geographic heightmaps are normaly from low->blue->green->red->high, so reduce the blue a lot, green a little and red a bit. In step 3 only the brightness of a pixel will count.
2. Resize the image to the openttd size: Often it looks better when using NO interpolation.
3. Convert the image to greyscale, and then to Indexed-16-colors (Image->Mode->Generate Optimum Palette, max colors: 16) so the colors are in the right order.
... hope to see some cool scenarios soon =)
1. If the image is colored, use: Tools->Color Tools->Levels and adjust the tree colors. Geographic heightmaps are normaly from low->blue->green->red->high, so reduce the blue a lot, green a little and red a bit. In step 3 only the brightness of a pixel will count.
2. Resize the image to the openttd size: Often it looks better when using NO interpolation.
3. Convert the image to greyscale, and then to Indexed-16-colors (Image->Mode->Generate Optimum Palette, max colors: 16) so the colors are in the right order.
... hope to see some cool scenarios soon =)
Here's a patch for rescaling maps of any size, keeping the aspect ratio (method 3 that I described earlier). It uses nearest neighbor resizing, which seems fine for scaling down, but results in a "pixelated" map if you scale something by a factor of 2 or more. I suppose better rescaling/filtering could be added later, but I think this is fine for now.
The code could probably be cleaned up a little too.
The code could probably be cleaned up a little too.
- Attachments
-
- pngmap6.patch
- map resizing patch - images of any size can be used now
- (11.21 KiB) Downloaded 372 times
For US data you just need to get the freely avaiable DEM's from the USGS
http://data.geocomm.com/dem/
You may need to convert some of the data to grayscale and so on. For other countries, I am not sure where to find this kind of data.
Also, if anyone would like to implement an SDTS to OTTD import:
http://mcmcweb.er.usgs.gov/sdts/source.html

http://data.geocomm.com/dem/
You may need to convert some of the data to grayscale and so on. For other countries, I am not sure where to find this kind of data.
Also, if anyone would like to implement an SDTS to OTTD import:
http://mcmcweb.er.usgs.gov/sdts/source.html

- lucaspiller
- Tycoon
- Posts: 1228
- Joined: 18 Apr 2004 20:27
Guess I need to pull another compile run.
The patch is in cccp's last post.
I heard a report that unrar doesn't always work in Linux, so I've started posting source 7z archives instead.
The patch is in cccp's last post.
I heard a report that unrar doesn't always work in Linux, so I've started posting source 7z archives instead.
- Attachments
-
- trunk.7z
- (1.88 MiB) Downloaded 321 times
-
- PNGLoadv6.zip
- (431.58 KiB) Downloaded 449 times
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Sorry if ive been ignorant, but could someone please explain exactly how they get this to work, from downloading the patch to playing on a map in Openttd.
Cheers
James
Cheers
James
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
Works for meSmudge wrote:-How comes I can't edit the created scenario's of Heightmap in the OTTD scenario editor.
James:
If you want to compile it yourself, download either pngmap6.patch or trunk.7z (already patched). Apply the patch, if you downloaded it, and then compile.
If you don't want to compile, or can't, download PNGLoadv6.zip, and extract the executable and lng file to the appropriate places.
Create an indexed PNG with no more than 16 colors, call it map.png, and place it in your OTTD directory. Then start OTTD and click the "Load Land" button in the scenario editor. Proceed as normal for creating a scenario.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
OTTD asks for a 4-bit map, but I can only make 8-bit maps. Irfanview can make 4-bit map but the map is totally wrong. How do I create a proper 4-bit map?
- Attachments
-
- What OpenTTD makes...
- screenshot.png (46.92 KiB) Viewed 2530 times
-
- The 4-bit conversion by IrfanView
- map.PNG (13.86 KiB) Viewed 8522 times
-
- The original map (with high quality)
- Kopie van map.PNG (18.67 KiB) Viewed 8523 times
Contributor to the The 2cc Set and Dutch Trainset. Inventor of the Metro concept. Retired Graphics Artist.

Download TT | Latest TTDPatch | OpenTTD | OpenTTDCoop | BaNaNaS: OpenTTD content system | 2048² OTTD scenario of the Netherlands
GRF Codec | GRF Crawler | GRF Maker | Usefull graphics & tools sites | NML Documentation Wiki | NFO Documentation Wiki
All my graphics are licensed under GPL. "Always remember you're unique, just like everyone else."
Download TT | Latest TTDPatch | OpenTTD | OpenTTDCoop | BaNaNaS: OpenTTD content system | 2048² OTTD scenario of the Netherlands
GRF Codec | GRF Crawler | GRF Maker | Usefull graphics & tools sites | NML Documentation Wiki | NFO Documentation Wiki
All my graphics are licensed under GPL. "Always remember you're unique, just like everyone else."
The problem with ur Highmap is the palette order.
The colors are not in the order u have paint there, because of conversation i thing.
Reopen it and change the colors to one in the order u want to have on the map.
Foxy
Edit: I have edited ur Map and i thing this is what u want to have
The colors are not in the order u have paint there, because of conversation i thing.
Reopen it and change the colors to one in the order u want to have on the map.
Foxy
Edit: I have edited ur Map and i thing this is what u want to have
- Attachments
-
- perhaps not the exact thing u want but near by i think
- map.png (13.69 KiB) Viewed 8484 times
Last edited by FoxAlpha on 16 Jul 2005 15:43, edited 1 time in total.
I knowFoxAlpha wrote:The problem with ur Highmap is the palette order.
The colors are not in the order u have paint there, because of conversation i thing.
How?Reopen it and change the colors to one in the order u want to have on the map.
ThxFoxy
Contributor to the The 2cc Set and Dutch Trainset. Inventor of the Metro concept. Retired Graphics Artist.

Download TT | Latest TTDPatch | OpenTTD | OpenTTDCoop | BaNaNaS: OpenTTD content system | 2048² OTTD scenario of the Netherlands
GRF Codec | GRF Crawler | GRF Maker | Usefull graphics & tools sites | NML Documentation Wiki | NFO Documentation Wiki
All my graphics are licensed under GPL. "Always remember you're unique, just like everyone else."
Download TT | Latest TTDPatch | OpenTTD | OpenTTDCoop | BaNaNaS: OpenTTD content system | 2048² OTTD scenario of the Netherlands
GRF Codec | GRF Crawler | GRF Maker | Usefull graphics & tools sites | NML Documentation Wiki | NFO Documentation Wiki
All my graphics are licensed under GPL. "Always remember you're unique, just like everyone else."
Who is online
Users browsing this forum: No registered users and 0 guests