Jump to content

Editing Height Maps


Guppycur

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 comment
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 comment
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 comment
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 comment
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 comment
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.

Link to comment
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 comment
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 comment
Share on other sites

  • 1 month later...

Wow so okay this is an old ass tutorial for back when TFP used a different method.

 

My current work flow is to work directly with the .raw file in Photoshop CS6, which reads it just fine.  NitroGen has a nice .raw to .png converter for when you want to use NitroGen on your height map...

 

Once TFP settles on a method, I'll do another tutorial, but in the meantime, I recommend finding CptKrunch's discord link on here, as he has a discord dedicated specifically to map creation.

 

@Cpt Krunch 's discord is https://discord.gg/YrC7bAzh9J

Link to comment
Share on other sites

  • 1 month later...

could someone possibly help me figure out why my towns and cites are not getting spawned on the actual map  https://imgshare.io/images/2021/05/06/oie_713840C4aTXMbw.jpg

the nitrogen is generating new pieces of land to place towns... this is the height map i'm using https://imgshare.io/image/pyem8K

have tried several settings but it never spawns anything on main part of the map

Link to comment
Share on other sites

  • 4 weeks later...
On 2/17/2021 at 7:09 AM, KingSlayerGM said:
  • imagemagick works fine to convert a 16bit grayscale png to raw and the world will be smooth

THANK YOU for the note on converting 16bit greyscale to raw to get a smooth world. I spent 5 hrs trying to figure out what the heck was going on. :)

Link to comment
Share on other sites

  • 6 months later...

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...