Problem with importing heightmaps

Interesting mapping tools and mapping help.

Problem with importing heightmaps

Postby Rewilon » 07 Aug 2019, 13:17

Hello everyone!

I have a problem with importing heightmaps from World Machine Basic to the FAForever Map Editor(v0.605-Alpha WIP8).
Importing does work, but the distance between the highs and lows of the map in the FAForever Map Editor is much bigger than in World Machine.
How can I fix this?

Can you help me? :)
Attachments
Heightmap Test World Machine.png
The original test heightmap in World Machine Basic (exported as .r16-File)
Heightmap Test World Machine.png (399.55 KiB) Viewed 291 times
Heightmap Test FAF Map Editor.png
The heightmap in FAForever Map Editor (importet from .r16-File)
Heightmap Test FAF Map Editor.png (1.38 MiB) Viewed 291 times
Rewilon
 
Posts: 4
Joined: 23 Dec 2018, 13:29
Has liked: 0 time
Been liked: 0 time
FAF User Name: Rewilon

Re: Problem with importing heightmaps

Postby Morax » 12 Aug 2019, 15:54

Hey there!

It's quite a process to export, import a height map using these tools, so if you want help files and setup will need to be known.

I recommend also joining the M&M discord where a host of people could offer insight: https://discord.gg/eTEYdqT
Maps and Mods Councilor

M&M Discord Channel

Come join us and help create content with the artists of FAF.
User avatar
Morax
Councillor - Maps and Mods
 
Posts: 2720
Joined: 25 Jul 2014, 18:00
Has liked: 1073 times
Been liked: 605 times
FAF User Name: Morax

Re: Problem with importing heightmaps

Postby Rewilon » 13 Aug 2019, 21:09

I'm not sure, what information is needed... :?:
I used the unchanged standard settings in both tools. (As far as I know...)
Attachments
Test01.zip
The original test file.
(428.76 KiB) Downloaded 2 times
export-config-r16-files.png
My export configuration.
export-config-r16-files.png (11.18 KiB) Viewed 196 times
Rewilon
 
Posts: 4
Joined: 23 Dec 2018, 13:29
Has liked: 0 time
Been liked: 0 time
FAF User Name: Rewilon

Re: Problem with importing heightmaps

Postby Lionhardt » 14 Aug 2019, 13:56

Adjust the max height and min height in the editor upon importing. The mapping from grayscale values to height values of WM does not necessarily match the scale of the editor. To work around this I always first export a heightmap from the editor with a plateau of the minimum height I want and a plateau of the maximum height I want. I integrate these numbers into the filename when exporting the heightmap, so I always keep the information bundled with the file itself. Then I edit with WM and import again with the same height settings into the editor. If you don't change the height settings upon export, the only thing you need to do is importing into WM said map with the reference plateaus.

If you started from WM I don't know of a way to get the information needed from WM to put the correct height values into the editor when importing. But in principle there should be a way to get that information. Possible start:

1) Query your maximum and minimum height in WM (don't know how)
2) Measure your maximum and minimum gray scale value of the exported heightmap in PS or something.
3) Adjust your heightmap in PS to cap out at either black or white. Meaning, increase the brightness until the pixel with the highest previous value has value 255 or decrease until the darkest pixel reaches 0.
4) Hope that this translation is linear.
5) reimport into WM
6) measure max and min height again
7) import into editor with the same numbers you just measured + an arbitrary constant

No idea, if that works though.
Help me make better maps for all of us, visit my Mapping Thread.

Maps needing gameplay feedback:
Spoiler: show
[list updated last: 31.1.2018]

(maps available in the vault)

- Hexagonian Drylands
- Fervent Soil and Torrid Suns
User avatar
Lionhardt
Contributor
 
Posts: 1069
Joined: 29 Jan 2013, 23:44
Has liked: 188 times
Been liked: 144 times
FAF User Name: Lionhardt

Re: Problem with importing heightmaps

Postby Morax » 18 Aug 2019, 19:23

Hi, Rewilon,

There are a lot of pieces of info needed to get going [see entire imgur album here: https://imgur.com/a/DXDv2QG?]

1) Show your original height map in the editor so we can have a look.

Here is my settings and height map for a test.

Settings:

Spoiler: show
Image


Height Map:

Spoiler: show
Image


2) Export the height map to your World Machine documents folder:

Spoiler: show
Image


3) Open the exported .raw / .r16 file in an image editing software package like Photoshop and save as a .PNG [so far this is the best known image file format that works with FA maps / World Machine].

Open the file:

Spoiler: show
Image


Save it as a PNG (2 parts to this):

Spoiler: show
Image


Spoiler: show
Image


4) Set up a "File Input" and "Write Output"

Part 1, select the "File Input" from the Generator tab:

Spoiler: show
Image


Part 2, fill up the generators, modifiers, natural, etc devices you wish to use [I will explain those in detail in a different post]:

Spoiler: show
Image


Part 3, add a "Height Output" from output:

Spoiler: show
Image


5) Load the .PNG file you created from image editing software through the "File Input" device:

Spoiler: show
Image


Highlighted in blue: Keep "edge blending" very low as this function will cause issues at higher levels

Highlighted in red: Ensure that "altitude scaling" is "Natural (file) elevations" so there is no conversion of height data

Highlighted in black: Ensure that your input dimensions match you map (eg 5x5, 10x10, 20x20, 40x40 km)

Highlighted in green: This is where you load your file, and yes, you must actually click "Load" to get to the next step:

6) Load the file:

Spoiler: show
Image


7) Check your height map at the device that precedes your "Height Output" one and ensure it looks okay. The World Machine generated height will look a little different, but it translates height with a scale that is not the same as Forged Alliance:

Spoiler: show
Image


8) Use the "Height Output" device by double-clicking it:

Spoiler: show
Image


9) Write the output by clicking "Write Output to Disk":

Spoiler: show
Image


10) Import the height map in the FAF editor:

https://i.imgur.com/ZO9McKs.png

11) When you select import, browse to the World Machine Documents folder [or wherever you selected to save] and find the export .raw / .r16 from World Machine's Height Output:

Spoiler: show
Image


12) Open the height output file and you will have your World Machine generated height map:

https://i.imgur.com/LWbUrA6.png
Maps and Mods Councilor

M&M Discord Channel

Come join us and help create content with the artists of FAF.
User avatar
Morax
Councillor - Maps and Mods
 
Posts: 2720
Joined: 25 Jul 2014, 18:00
Has liked: 1073 times
Been liked: 605 times
FAF User Name: Morax

Re: Problem with importing heightmaps

Postby Morax » 18 Aug 2019, 19:42

Here is an attachment for my "general erosion" world machine device setup.
Attachments
World Machine General_Erosion In and Out.7z
(5.41 KiB) Not downloaded yet
Maps and Mods Councilor

M&M Discord Channel

Come join us and help create content with the artists of FAF.
User avatar
Morax
Councillor - Maps and Mods
 
Posts: 2720
Joined: 25 Jul 2014, 18:00
Has liked: 1073 times
Been liked: 605 times
FAF User Name: Morax

Re: Problem with importing heightmaps

Postby Lionhardt » 19 Aug 2019, 01:28

Can you post a screenshot showcasing the effect? Got no machine to run this atm but still curious.

Edit: Hm, how actually does your first post answer his question? I think you misunderstood what he is asking.
Help me make better maps for all of us, visit my Mapping Thread.

Maps needing gameplay feedback:
Spoiler: show
[list updated last: 31.1.2018]

(maps available in the vault)

- Hexagonian Drylands
- Fervent Soil and Torrid Suns
User avatar
Lionhardt
Contributor
 
Posts: 1069
Joined: 29 Jan 2013, 23:44
Has liked: 188 times
Been liked: 144 times
FAF User Name: Lionhardt

Re: Problem with importing heightmaps

Postby Morax » 19 Aug 2019, 03:49

It's an incorrect transition, Lionhardt. I tested it on a bunch of maps and if you don't do this process fully-100% it results in that imported height map where the lows and highs are multiplied by a factor.
Maps and Mods Councilor

M&M Discord Channel

Come join us and help create content with the artists of FAF.
User avatar
Morax
Councillor - Maps and Mods
 
Posts: 2720
Joined: 25 Jul 2014, 18:00
Has liked: 1073 times
Been liked: 605 times
FAF User Name: Morax

Re: Problem with importing heightmaps

Postby Lionhardt » 19 Aug 2019, 12:16

Hmm... Ok? I don't know if I used your exact settings and never noticed a problem with the way I did it (don't remember exactly).

But besides that I think you did not answer his actual question anyway. I think he stared a heightmap in WM and fails to get it into the editor with the correct height scale. Your approach is essentially the same what I told him. Start with the editor then import into WM, then back into the editor.

I still think your post is valuable though. I will try your settings when I get back to mapping at some point and compare them to what I used to do.
Help me make better maps for all of us, visit my Mapping Thread.

Maps needing gameplay feedback:
Spoiler: show
[list updated last: 31.1.2018]

(maps available in the vault)

- Hexagonian Drylands
- Fervent Soil and Torrid Suns
User avatar
Lionhardt
Contributor
 
Posts: 1069
Joined: 29 Jan 2013, 23:44
Has liked: 188 times
Been liked: 144 times
FAF User Name: Lionhardt

Re: Problem with importing heightmaps

Postby Morax » 19 Aug 2019, 13:15

Whelp, I would have to say you need to adjust the altitude scaling in world machine. That's part of the file input properties, so if you want to make world machine then direct to the editor, you will need to test it, go back to WM, add clamps, modify this and that.

Eh, I just can't recommend it. As you stated, making a simple height map with the low and high value as a reference is the best practice.

Something changed in the ozone editor where the height values are far different from WM expression. I didn't know how to answer this at first because it resulted in a much closer look when I originally used it.

Now, in WM, it barely looks like any terrain is there and you have to trust something happened : /

I don't like using it anymore for this reason, but with the ozone editor you can make erosion details with the "mountain brushes" quite quickly.
Last edited by Morax on 19 Aug 2019, 17:39, edited 1 time in total.
Maps and Mods Councilor

M&M Discord Channel

Come join us and help create content with the artists of FAF.
User avatar
Morax
Councillor - Maps and Mods
 
Posts: 2720
Joined: 25 Jul 2014, 18:00
Has liked: 1073 times
Been liked: 605 times
FAF User Name: Morax

Next

Return to Mapping

Who is online

Users browsing this forum: No registered users and 1 guest