Jump to content

Hacking Atlas Heightmap Import


Palaxin
 Share

Recommended Posts

In Atlas there is no feature to define custom height limits when importing grayscale images. As a result the imported map will be scaled to the full height (which can be changed by editing the heightmap) and shows discrete terrace-like elevation steps (which can't be influenced) because there are used only 256 out of 65536 possible elevations.

Is it possible to hack the Atlas code somewhere to change this? I would need to compile after that, right? May I open a new ticket for this issue (implement custom height limits)...?

EDIT: or would you recommend to read the heightmap data with a script and directly write into the .pmp file?

Edited by Palaxin
Link to comment
Share on other sites

Sorry only know you have to check into "ps/trunk/source/tools/atlas/" I've never had the time to become familiar with that part of the code.

Well it can be worth the effort on a personnal side if that's what you want. Other than that, I don't know many people using atlas on a regular basis. Maybe there are some other tickets you can close before that. 

Link to comment
Share on other sites

Thanks for the reply :)

I couldn't find the function, but I'm making progress with direct changes to the .pmp file with a hex editor. May I create a new wiki page with a tutorial how to create accurate heightmaps from bathymetry and topography grayscale images?

Edited by Palaxin
Link to comment
Share on other sites

IMO to manipulate a heightmap in Atlas the grayscale can be imported as is while there should be tools to globaly manipulate the heightmap like raise all vertices by x meters, (log/exp/linear) height scale, global smooth etc. Than it could always be used, not only at heightmap import.

Link to comment
Share on other sites

  • 4 weeks later...
On 5/28/2016 at 0:11 PM, Palaxin said:

 

@FeXoR more Atlas features for height manipulation would definitely help. Both at heightmap import and afterwards...

Yes, maybe a slider to lessen or increase the effects of the heightmap. +100 points if this can be show in real-time.

Edited by wowgetoffyourcellphone
Link to comment
Share on other sites

On 6/1/2016 at 7:15 AM, wowgetoffyourcellphone said:

+100 points if this can be show in real-time.

Even the existing terrain tools heavily lag on my notebook when I choose the maximum brush size and strength  :self_hammer:

Edit: Actually it is independent of brush size/strength

Edited by Palaxin
Link to comment
Share on other sites

Hm... or toggle steady recalculations either with a simple checkbox in the GUI or automatically when the obstruction overlay is active. BTW how can I make the overlay visible in Atlas (like in the spoiler images here)?

Edited by Palaxin
Link to comment
Share on other sites

 

2 hours ago, Palaxin said:

Hm... or toggle steady recalculations either with a simple checkbox in the GUI or automatically when the obstruction overlay is active. BTW how can I make the overlay visible in Atlas (like in the spoiler images here)?

@Palaxin In the Tab "Terrain" of atlas you can switch in the passability drop-choose of visulization.

By the way I found these indications:
Using real world data "DEM files" to generate 3D maps
And is good this related link for downloading maps DEM and I did some tests.
To remedy that you indicate in the first post I modified relief.clr file using GDAL as indicated in the forum to limit the heights in the transformation in Tiff in this way:

 

100% 55:55:55
0%   2:2:2
nv   0:0:0


Once exported to Tiff opening it in GIMP can be further improved.

This is the result:
 

Spoiler

screenshot0002.png


Rather, there is a fast way to remove the error on both sides or is it a bug

Edited by Garaf
  • Like 1
Link to comment
Share on other sites

@Garaf Thx for the tip and the extra work :)

I haven't worked with DEM-files yet, but it seems to me that

  • there is no height data for ocean floor (bathymetry) available making the in-game ocean very flat
  • in the end you still import a 8-bit grayscale image in Atlas so this does not actually increase precision (in-game height difference between two shades of gray)

In the last section of my heightmap guide I described how to overcome this problem. Basically you need to use a script to write the height data directly to the .pmp file which stores the height data of the map. The guide is not 100% finished though...

Link to comment
Share on other sites

Hi, @Palaxin

Is already an excellent guide B), I quickly posted that data for two reasons:

  • - From the Main Page also get access to a Research Database, where data collection is very rich, has a choice that ranges from 1 to 3 and 15 seconds of arc, one that I linked has some areas of Europe with precision a second of arc.
  • - With GDAL I saw that the data can be extracted with various parameters, but I have not studied further, and more - this could be of interest to programmers - it has a variety of cross-platform API to use and open source, but I do not know how to use them Atlas; It is used in several GIS systems and for the construction of maps in 3D.

When I have a little time on their hands to see further data extraction and various export formats, I also see for bathymetric.
Keep in mind that the test I made was "on the fly" and not to make too harsh heights have limited the range of gray (256) to a number of 52 starting with 2: 2: 2 to 54:54:54 at the time extraction in Tiff.
I made a scaling, and this is the result first test in the mountains where I live and which I know well:

Spoiler

Monte Serra.png

These are the files used (Including those of Atlas): Files Serra.zip

I just tidying things ... will let you know, I think if we can make it as easy as possible the creation of maps close to the real, many will be even more interested in the game and participate in the development ;).

Greetings to all, good job and have fun.

Edited by Garaf
  • Like 2
Link to comment
Share on other sites

13 hours ago, Garaf said:

Is already an excellent guide B)

Thx, I added the link to the database :)

I definitely have to test it and GDAL as well. Actually looks very promising ;)
I just started to learn Python to improve my script from the Expert section in my guide. It already allows you to select a custom height range.

In the fist step I want to directly read binary data from grayscale images or .hgt files. The latter is trivial to read as it contains only a collection of 16-bit integers. Actually we wouldn't need GDAL then (though it certainly provides more than file reading and scaling).
In the second step the height data would be height scaled and flattened with a gaussian blur. Also scaling to different map sizes should be possible. The textures are chosen according to biome (defined by a "biome" map you have to provide together with the heightmap), terrain slope and height, see my height dependent terrain texturing for an early example.
In the last step the height data and the terrain textures are written to the .pmp map file.

In the further process the generation of trees and more objects could be implemented. Of course it would be nice to add such features to Atlas as well. But AFAIK it is currently subject to a bigger (GUI) rework, so we may wait for that. I'm also no real dev with programming experience. However I would be interested where the code for the heightmap import is located. I couldn't find it till now.

The mountains of your map look really authentic. I'm going to map my home region as well (though terrain probably won't be as interesting as yours) ;)

Edited by Palaxin
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...