Palaxin Posted April 27, 2016 Report Share Posted April 27, 2016 (edited) 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 April 27, 2016 by Palaxin Quote Link to comment Share on other sites More sharing options...
Stan` Posted April 27, 2016 Report Share Posted April 27, 2016 Well yes you need to tweak the import heightmap function, and you then would need to compile wxwidgets as well as atlas (Passing the command flag -- atlas to the build options IIRC) This ticket could be relevant, though it was just a suggestion ticket http://trac.wildfiregames.com/ticket/3096 Quote Link to comment Share on other sites More sharing options...
Palaxin Posted April 27, 2016 Author Report Share Posted April 27, 2016 Added my suggestions to the ticket Do you know where this function is located? However, I currently don't have the environment (and not much experience either) for compilation, so I'm not sure if it's worth the effort... Quote Link to comment Share on other sites More sharing options...
Stan` Posted April 27, 2016 Report Share Posted April 27, 2016 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. Quote Link to comment Share on other sites More sharing options...
Palaxin Posted April 28, 2016 Author Report Share Posted April 28, 2016 (edited) 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 April 28, 2016 by Palaxin Quote Link to comment Share on other sites More sharing options...
Stan` Posted April 28, 2016 Report Share Posted April 28, 2016 Yeah I guesz you can. You might want to post it here before so you can get feedback =) 1 Quote Link to comment Share on other sites More sharing options...
Palaxin Posted April 28, 2016 Author Report Share Posted April 28, 2016 (edited) 3 minutes ago, stanislas69 said: You might want to post it here before so you can get feedback =) Ok I will do when I'm finished Edited April 28, 2016 by Palaxin Quote Link to comment Share on other sites More sharing options...
FeXoR Posted April 28, 2016 Report Share Posted April 28, 2016 It might be simpler is just change the contrast (and mybe brightness and gamma) of the imported grayscale image in an image editor. Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted April 28, 2016 Report Share Posted April 28, 2016 6 hours ago, FeXoR said: It might be simpler is just change the contrast (and mybe brightness and gamma) of the imported grayscale image in an image editor. That is simpler but not comprehensive. Quote Link to comment Share on other sites More sharing options...
FeXoR Posted May 1, 2016 Report Share Posted May 1, 2016 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. Quote Link to comment Share on other sites More sharing options...
Stan` Posted May 1, 2016 Report Share Posted May 1, 2016 Something cool would be to import/export 3dmeshes as heightmaps. 1 Quote Link to comment Share on other sites More sharing options...
Palaxin Posted May 28, 2016 Author Report Share Posted May 28, 2016 (edited) Ok I posted the guide here. Just need to add some graphics to make it more interesting... @FeXoR more Atlas features for height manipulation would definitely help. Both at heightmap import and afterwards... Edited May 28, 2016 by Palaxin 1 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted June 1, 2016 Report Share Posted June 1, 2016 (edited) 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 June 1, 2016 by wowgetoffyourcellphone Quote Link to comment Share on other sites More sharing options...
Palaxin Posted June 3, 2016 Author Report Share Posted June 3, 2016 (edited) 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 Edit: Actually it is independent of brush size/strength Edited June 3, 2016 by Palaxin Quote Link to comment Share on other sites More sharing options...
niektb Posted June 3, 2016 Report Share Posted June 3, 2016 @Palaxin: that's because the pathfinder updates terrain obstruction in a less than optimal way. With the old pathfinder it ran smooth, so it should be a solvable problem (although I don't know how hard it is) Quote Link to comment Share on other sites More sharing options...
Palaxin Posted June 3, 2016 Author Report Share Posted June 3, 2016 @niektb is it really necessary to update terrain obstruction in Atlas in real time? Couldn't it be done when saving or running the simulation test? In Atlas you can place objects anyway without following obstruction rules... 1 Quote Link to comment Share on other sites More sharing options...
niektb Posted June 3, 2016 Report Share Posted June 3, 2016 @Palaxin: I suppose it would be nice to know whether you've just blocked a passage when placing some cliffs / mountains... Quote Link to comment Share on other sites More sharing options...
Palaxin Posted June 3, 2016 Author Report Share Posted June 3, 2016 (edited) 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 June 3, 2016 by Palaxin Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted June 3, 2016 Report Share Posted June 3, 2016 @Palaxin, updating it for Atlas should be quite simple (at least theoretically). The current piece of code just isn't optimised for recalculation of terrain. But @trompetin17 is working on a new Atlas interface, so it's not a good time to change code interfacing between Atlas and the rest of the game, as it will have to be redone anyway. 1 Quote Link to comment Share on other sites More sharing options...
Garaf Posted June 3, 2016 Report Share Posted June 3, 2016 (edited) 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 mapsAnd 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 Rather, there is a fast way to remove the error on both sides or is it a bug Edited June 3, 2016 by Garaf 1 Quote Link to comment Share on other sites More sharing options...
niektb Posted June 3, 2016 Report Share Posted June 3, 2016 @Garaf: Those errors on both sides are a bug Quote Link to comment Share on other sites More sharing options...
Palaxin Posted June 5, 2016 Author Report Share Posted June 5, 2016 @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... Quote Link to comment Share on other sites More sharing options...
Garaf Posted June 5, 2016 Report Share Posted June 5, 2016 (edited) Hi, @Palaxin Is already an excellent guide , 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 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 June 5, 2016 by Garaf 2 Quote Link to comment Share on other sites More sharing options...
Palaxin Posted June 6, 2016 Author Report Share Posted June 6, 2016 (edited) 13 hours ago, Garaf said: Is already an excellent guide 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 June 6, 2016 by Palaxin Quote Link to comment Share on other sites More sharing options...
wraitii Posted June 6, 2016 Report Share Posted June 6, 2016 If you need help with the python script, as part of my markov chains script I have a Python script to load a pmp map which could also be used to write a PMP map if needed. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.