Jump to content

Editing Height Maps


Recommended Posts

I tried opening the DTM.raw file in Photoshop and really wasn't sure what I was looking at. I was expecting something like the POI Height Map, but it looked like there was much more information in there.

 

I have been using NitroGen and love it. Are there any links or information showing how to import the genhm.png and poihm.png to export the DTM.raw file?

 

 

 

(Actually I'm doing some testing with NitroGen now and may have figured out how to do this.)

Edited by dalves69 (see edit history)
Link to post
Share on other sites
  • 2 months later...

I want to share a way to edit dtm.raw without Photoshop, since I didn't want to pirate or buy it. It is definitely a clumsy way, so If someone knows easier way to do it with free software, I would be very glad to know!

Working with dtm.tga not allowing to edit already generated map + integrated smoothworldall command not always work nicely for roads.

 

I do it with GIMP + Rawtherapee plugin.

 

So when you are opening dtm.raw / dtm_processed.raw in GIMP you should check "show all files" and in "select file type" choose "Raw image data". In the next window these parameters:

 

Image Type: Grayunsigned 16 bit Little Endian

Width & Height according to your world size (let's take for example 8192 & 8192)

 

By default map is vertically flipped, so you shoud flip it before & after the editing (Image - Transform - Flip Vertically) and also set up grayscale mode: "Image - Mode - Grayscale". If you want to create heightmap from scratch, you should also check "Image - Precision - 16 bit integer".

 

Then save as .tiff:

Export As: Select File Type - TIFF image (uncheck everything in Advanced window). In the end .tif file should be the same size as .raw file (134.2 MB for 8192x8192 world)

 

Next process is basically converting this .tiff to .raw file:

 

Open .tiff the same way you open .raw (show all files & select file type - raw image data), but with these parameters:

 

Image Type: Indexed

Offset: 8

Width is double from the original (in this case 16384), Height as it is (8192).

 

And then export that as "raw image data" with .raw prefix.

Link to post
Share on other sites
  • 11 months later...

Thanks for this Guppycur, I had to do a biome repair for someone earlier and it worked a treat, then I thought why not learn how to do height maps to, and here I am. Now to find one that allows me to draw rivers. XD

 

Much thanks again.

Link to post
Share on other sites
  • 6 months later...

Hello everyone, Guppycur thanks for the nice tutorial!

 

I cannot make it work though... I generated a 4k world, I created my own dtm.tga file and put it in the world. I also removed the .raw file. But the game doesn't load the world at all. It gives me the exception "Array out of bounds" :(

 

Also it seems that generating a world through the game only generated the .raw file, not the .tga, wth?

 

If anybody can help me it would be very appreciated :)

 

Bonus question: if I generate a 16K heightmap, or maybe even a 32K one, would the game be able to handle it correclty or is it limited to the vanilla sizes?

Edited by KingSlayerGM (see edit history)
Link to post
Share on other sites

Hello KingSlayer,

The DTM.RAW is a grayscale 16 bits little endian binary file.

I don't know about TGA file, but you can use a DTM.PNG file (gray scale: red=green=blue)

And i think that the dtm picture should have the same size than the map.

Look into the "Tools" section, there is a software to check your files.

Link to post
Share on other sites

Thank you for your answer! So can I just use a png file?

 

If  not, I guess I will just discard the TGA file then and just try to generate a raw file. I think I found the software that you mentioned, is it this one?

 

I will let you know if I get it to work :)

 

Edited by KingSlayerGM (see edit history)
Link to post
Share on other sites

Yes you can use a PNG (i use it in my map generator). But a grayscale PNG is 8 bits (0-255) and the raw dtm is 16 bits (0-65535), so i suppose that the ground will be not so smoth.

For the software search for "World Checker".

 

  • Like 1
Link to post
Share on other sites

Thanks for testing. I really supposed that TFP used all the values of the 16 bits pictures and your screenshot shows it.

 

For my map gen, i use a .... flat map ! (for now) so i don't have any problem (it is so nice to drive a car without problem all around the map)

 

For the generation of a dtm, read above. Some use the TIFF format and says that it works.

Also read this:

https://community.7daystodie.com/topic/17041-any-way-to-create-my-own-dtmraw/

https://chrani.net/blog/messing-with-the-world-of-7dtd-part-1-of-3/

 

Hope that this will help you.

And remember when you save the TGA or TIFF file, you need to specify 16 bits grayscale little endian.

If your graphic software doesn't permit to do this, try another one.

  • Like 1
Link to post
Share on other sites

If you can save a 16bits PNG i think that you should work on this.

Verify that the grayscale decrease/increase is smooth on screen, try a smooth function inside your graphic software (or blur)

Link to post
Share on other sites
11 hours ago, 7d2dMP said:

If you can save a 16bits PNG i think that you should work on this.

Verify that the grayscale decrease/increase is smooth on screen, try a smooth function inside your graphic software (or blur)

Yes I am saving 16 bit grayscale png, however it still doesn't work.

 

I have a guess: maybe unity by default converts png to 8 bit?

Edited by KingSlayerGM (see edit history)
Link to post
Share on other sites

CONCLUSION:

If anybody is interested here is what we found:

  • using a grayscale 16 bit dtm.png works, however the game will convert it to 8 bit, so the world will look blocky
  • imagemagick works fine to convert a 16bit grayscale png to raw and the world will be smooth
  • if you are using python to generate the world: you can use numpy to save a uint16 2D array to raw image using ndarray.tofile('dtm.raw') and the world will be smooth
  • i couldn't get any dtm.tga file to work

I hope this will help others too :)

 

Special thanks to 7d2dMP for his patience :)

Edited by KingSlayerGM (see edit history)
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...