Aces High Bulletin Board

General Forums => Terrain Editor => Topic started by: artik on October 16, 2013, 08:54:52 AM

Title: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 16, 2013, 08:54:52 AM
Hello,

Back in AH1 days there was a tool called MapMaker that used both GTOPO30 Digital Elevation Map (DEM) and the ground coverage types from USCG to create realistic maps.

Unfortunately it is not relevant for AH2 any more also the database used had quite a low resolution. Currently designers set different ground types according to altitude with both not correct and it very problematic for areas with large ground type differences, like dessert, rivers, forests etc.

I had written a new tool called "makeahmap" that creates elevation files, water file and ground type files using more up to date database: GlobCover.

It has much higher resolution and allows to setup fine details of the ground.

For example, this is a color coded distribution of the ground coverage I had used for 512x512 miles map:

http://cppcms.com/pics/cov.png

It has very fine grained details like Nile, Suez Channel, exact position of Dead sea and Sea of Galilee boundaries that are impossible to derive from the altitudes alone (dead sea is -1200 feet below the surface of the sea). You can see the rich agricultural areas of Delta Nile and desert areas.

Now I combined it with the elevation database and could create the map.

Note it is very initial version and probably buggy:

Download from: http://cppcms.com/files/makeahmap.zip

You will need to download the GlobCover database file and DEM files (links in README)

Unzip, read README.txt, edit config.ini to configure the setup and run to create gndtype.bmp, mapname.elv and water(d/c).bmp

Notes:

- it does not have GUI, you rather edit config.ini and double-click on the exe. It should be straight forward to use. (I would not implement GUI at this point)
- You need the coordinates of the area you want to create, it is very useful to work with google maps to configure them.


Sources are included. User input is more than welcome.

The software licensed under MIT software license.


Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: USRanger on October 17, 2013, 02:02:18 AM
Very cool.  I'll check it out. :aok

 :salute
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 17, 2013, 11:32:52 AM
Will take a look at this later in the week. Thanks for the effort.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: bbosen on October 17, 2013, 12:49:17 PM
Wow Artic! This sounds WONDERFUL. I will look for a time soon to exercise it. Thanks!
 :salute
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 17, 2013, 04:39:46 PM
Some update,

I'm working on the support of GSHHG database to support more accurate shore lines.

For a map of 512x512 miles:

Elevations: map.elv is 1024x1024: 1/2 a mile resolution GTOPO30 DEM is more than file.
Ground cover: gndtype.bmp is 4096x4096: ~200m resolution - GlobCover is fine - as approximately same resolution .
Water: waterd.bmp 16384x16384: ~50m resolution - the GlobCover is not good enough apparently the coast lines look too square. One option is to run some filter (like low pass Gaussian blur + threshold. Other option I'm working is to use shoreline database.

I'm working on support of the GSHHG database that keeps the shore lines in vector format to create waterd.bmp raster such that the data would be much more accurate and smooth - so the shorelines, also it would allow to distinguish between ocean/sea and lakes and rivers.

(It works but need some optimization to be done)

To be continued...
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: 715 on October 17, 2013, 09:50:54 PM
I'm impressed! 

I tried looking at the shoreline data ESRI shapefile format as a possible way to generate high res water data, but the format was so obtuse, I immediately gave up.  The generation of those vector data water files was based on bitmap DEM file analysis; it's a shame they didn't spit out a pixel water binary file to go along with the matching DEM file.  Since it's a single bit (water or ground) it would have added very little to the zipped file size.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 18, 2013, 12:42:59 AM
I'm using GSHHG binary format... It is way simpler to read. The only problem you need to solve is to convert polygon to bitmap at scale of Earth efficiently  :D
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: 715 on October 18, 2013, 02:14:52 AM
artik: is the GlobCover data really just one huge TIF file covering the entire Earth (GLOBCOVER_L4_200901_200912_V2 .3.tif)?  How do you read that?  My PhotoShop elements chokes on it.  Or is GeoTiff a different thing from .tif?
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 18, 2013, 07:46:25 AM
artik: is the GlobCover data really just one huge TIF file covering the entire Earth (GLOBCOVER_L4_200901_200912_V2 .3.tif)?  How do you read that?  My PhotoShop elements chokes on it.  Or is GeoTiff a different thing from .tif?

Don't open this file on PS. Most of editors and other tools fail frequently even on waterd.bmp.

I read it using libtiff, row by row (There is an API for that) and select specific parts I need using the code.

For same reason I don't load all files in DEM, I load a single row in a time (about 20-80 mb depending on latitude/map-scale/dimension).

Most of tools just can't handle such huge amount of data.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 18, 2013, 09:18:04 PM
Shorelines are a pain. As you point out the various formats don't give you really good / exact shoreline detail. Basically you have two manual ways to deal with this at the moment.


1) Go into the Terrain Editor and clean them up by hand making them look more organic and less blocky. Problem here is you still don't get exact shorelines but they do look natural and most players won't complain about them. Especially if the terrain is not a historic / real world terrain.

2) Or you can go into waterd.bmp and work on the shore lines directly in a program like Photoshop. If you do that you can very detail shorelines by going into say google maps zoom down to the say the 1 mile, 2 mile or 5 (depending on your scale) mile take a screen shot, paste as a new layer in photshop over your existing land created by the DEM and then use this as a stencil to trace and clean up the shore lines.

Yes this is VERY tedious and horrendously manual method but it has given me good results on several terrains on creating exacting shorelines for terrains. Of course a drawback is that the shorelines are based on current info not 1930s-1940s info.


So a shoreline database would be quite helpful.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 19, 2013, 03:23:36 AM
Quote
Shorelines are a pain. As you point out the various formats don't give you really good / exact shoreline detail.

Ok some progress report..

There is a wated.bmp I created automatically using shoreline and river database.

http://cppcms.com/files/waterd.zip

It is quite amazing, there is Nile, there is Jornan river, amazing Suez channel, take a look on the North Egypt shore...

And it is smooth...

I hadn't done any gradients yet, it is all 0 or 255, but it is work in progress.

Quote
Basically you have two manual ways to deal with this at the moment.

I'm too lazy to do it manually :D ... So I write a program for it.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Bruv119 on October 19, 2013, 07:23:19 AM
artik you are the man.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 19, 2013, 07:45:55 AM
Quote
I hadn't done any gradients yet, it is all 0 or 255, but it is work in progress.

Remember that gradients in the waterd.bmp file does not create land. It creates water depth which allows textures painted by gndtype.bmp to show through the water to the players flying above. Most people will be happy with what you have done here and not care about water depth.

Going to go load up your waterd.bmp file in the editor and take a look.

I would say I am to lazy to but its more a case of not having a program to do it for me. ;)


Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 19, 2013, 08:03:04 AM
Very nice results and lots of rivers. Those might give you a head ache when you start working on elevation.

Oh quick question so does this program only handle a scale of 1:1 (1 game mile equals 1 real mile) or can handle differing scales say 1:1.5 (1 game mile equals 1.5 real miles) and so on? Some times for game play reasons designers you differing scales from 0.75:1 to 2:1.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 19, 2013, 08:27:39 AM
Quote
I would say I am to lazy to but its more a case of not having a program to do it for me.

I'll release the next version ASAP... Not need to wait but need some touches to made.

Quote
Oh quick question so does this program only handle a scale of 1:1 (1 game mile equals 1 real mile) or can handle differing scales say 1:1.5 (1 game mile equals 1.5 real miles) and so on? Some times for game play reasons designers you differing scales from 0.75:1 to 2:1.

Any scale you want, you give central point latitude and longitude, dimensions and scale - you get a data.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 19, 2013, 11:15:53 AM
UPDATE

Version 0.1 released:

- Added support of shoreline database for accurate map generation
- Simplified coordinates specifications: put center latitude and longitude and the scale - that's it.

Download: http://cppcms.com/files/makeahmap_v0.1.zip

Note the link: http://cppcms.com/files/makeahmap.zip is valid as well and points to the latest version.

Examples of a map I created:

Suez Channel

(http://cppcms.com/pics/makeahmap/suez.jpeg)

Compare for example with this:

(http://eol.jsc.nasa.gov/EarthObservatory/Ship_Traffic_on_the_Suez_Canal,_Egypt_files/ISS013-E-44847_lrg.jpg)

Delta Nile example:

(http://cppcms.com/pics/makeahmap/nile.jpeg)


Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Easyscor on October 19, 2013, 11:30:15 AM
Looking good.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 19, 2013, 11:40:19 AM
Color really plays a big part on how we interpret things. On your screen shot looks like buildings off to the side but on your build there is water there. I check google maps and it shows water but when I go to satellite view looks like grassy to me until I zoom in and see it is very, very, very green water.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 19, 2013, 11:56:03 AM
What set of SRTM did you use? SRTM3 or SRTM30?
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 19, 2013, 12:01:06 PM
Quote
What set of SRTM did you use? SRTM3 or SRTM30?

SRTM3 - it should be in README, config.ini and in the directory itself.

Color really plays a big part on how we interpret things. On your screen shot looks like buildings off to the side but on your build there is water there. I check google maps and it shows water but when I go to satellite view looks like grassy to me until I zoom in and see it is very, very, very green water.

I wonder... According to globcover database, this area is

    
Quote
Artificial surfaces and associated areas

But according to the water lines database it is a water... Maybe it is possible to combine such an information and make a waterc.bmp with higher values
at these areas to make them look greenish?

Interesting...  :x
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 19, 2013, 12:09:58 PM
It does say SRTM3 in your readme file ... I just need to slow down and read things thoroughly instead of skipping to where to get the files to download.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: 715 on October 19, 2013, 03:18:49 PM
Wow!  I'm impressed... again!

You coded, in a single day, a way to not only read the vector water data but also rasterize it as well?

If you really include all real world water features in AH terrains you're gonna have to build a lot of bridges or GVers are going to get stuck.  ;) 
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 19, 2013, 06:31:32 PM
Been playing around with your program. very cool but couple of things.

1) For the waterc.bmp file your are writing the land area to the file (white pixels). This is unnecessary the only thing that should be in this file is the different colors for water. So if you do not change any of the water colors the whole file should be black. If you change just say one lake to a different color then everything should be black but that lake.

2) On the scaling of the maps. Not sure if I am doing something wrong (or missed reading something) but I picked a central point, set map size to 512, and set the scale to 0.75, 1.0, and 2.0 but the output was the same each scale setting (changing the scale from 1.0 to something else didn't seem to do anything). At least for my test of centering a map on Tokyo.

lat 35.6895
lon 139.6917
scale 1.0


I can get it to scale if instead of using a central point I set lat1, lat2, long1, long2 ... basically know before hand what a 1.5 scale would be and pick the correct points for them. Just the central point method doesn't seem to only do a scale of 1.0.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 20, 2013, 04:47:06 AM
1) For the waterc.bmp file your are writing the land area to the file (white pixels). This is unnecessary the only thing that should be in this file is the different colors for water. So if you do not change any of the water colors the whole file should be black. If you change just say one lake to a different color then everything should be black but that lake.

Ok. But if I would paint the ground with white and water black - it should not interfere? Right? So this way if a user would want to adjust the color on his own he would be able to see the lake that is black and change its color.

Am I right?

2) On the scaling of the maps. Not sure if I am doing something wrong (or missed reading something) but I picked a central point, set map size to 512, and set the scale to 0.75, 1.0, and 2.0 but the output was the same each scale setting (changing the scale from 1.0 to something else didn't seem to do anything). At least for my test of centering a map on Tokyo.

lat 35.6895
lon 139.6917
scale 1.0


I can get it to scale if instead of using a central point I set lat1, lat2, long1, long2 ... basically know before hand what a 1.5 scale would be and pick the correct points for them. Just the central point method doesn't seem to only do a scale of 1.0.

Yes... you are right, it is a bug.

I missed scale parameter in the calculations of latitude and longitude range, I'll fix it in the next release.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 20, 2013, 07:05:43 AM
I don't know if what affect it will have. Will have to test it out. Normally the waterc.bmp is pure black when you start a fresh terrain. Your right it shouldn't make a difference since the area is land but I have never see what effect if any have the land in the waterc.bmp (white) does or doesn't do.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: jedi25 on October 20, 2013, 12:15:06 PM
Artik,

This is a awesome and great development you have going here..

I have never try the map making, but this has sparked my interest..

The game is in dire need of new maps - real world map that is..

Great work man.. :rock  :aok  :salute
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: 715 on October 20, 2013, 01:29:55 PM
I don't know if what affect it will have. Will have to test it out. Normally the waterc.bmp is pure black when you start a fresh terrain. Your right it shouldn't make a difference since the area is land but I have never see what effect if any have the land in the waterc.bmp (white) does or doesn't do.

If he leaves waterc.bmp all black then how would a user find lakes, rivers, lagoons, etc. to manually paint them a different color (in PhotoShop for example, not the Terrain Editor)?
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 20, 2013, 02:05:03 PM
In photoshop you create a duplicate layer above your base layer (black) and cut in paste your waterd.bmp into that layer to use as a stencil. Then select and delete the black areas of that layer. Then create a layer under it and start coloring there.

As for if the white does anything in waterc.bmp I don't know because by default when you create a terrain in AH terrain editor everything is black until you start painting things. Generally most designers don't really change the water color very often. So right now I don't know if having a the white in the waterc.bmp will have any impact or not. It might (such as increase the file size of the terrain) or it might not, have to test to see if there is any result.

For example we found out that if under say the sea on the map if you use the grass texture instead of deep ocean texture it dramatically increased the file size of the terrain even though players see no difference (they see water since the grass texture can't be seen at deep water depths). Just have to test to see if there is any impact or not is all.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 20, 2013, 02:42:05 PM
Actually terrain size is very good point. Fully black waterc.bmp is easily compressed.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 22, 2013, 10:55:31 AM
New version v0.2 Released: http://cppcms.com/files/makeahmap_v0.2.zip

Major changes:

- Fixed map generation in Western Hemisphere
- Added support of smaller and easier to download/use elevation datasets with 30 arc-second accuracy (900m): GTOPO30 and SRTM30, additionally to existing SRMT3 support (the elevation resolution of AH map is around 800m - so it should be more than fine for any practical purpose)
- You can alter how many rivers are added (i.e. how major river should be to be present)

Full Changelog

Bug fixes:

- Fixed bug of not generating shores in Western Hemisphere
- Fixed bug of the scale parameter not being used.
- Fixed elevations near sea-shores - set to 0 to reduce water slope problems
- Removed rivers near edges of terrain - reduce water slope issues
- All rivers now pass over beach ground type

New features:

- Added support of SRTM30/GTOPO30 elevaion database (that is much smaller but yet accurate enough for most purposes)
- Added selection of river levels to draw
- Added suppport of gz compression of GSHHS and DEM files such that DEM/hgt and gshhs files can be gz-compressed
- Added custom globcover to AH tiles mapping (groundmapping.csv)
- Initial clipboardmap generation (not really useful)



Known Issues

1. There is known problem of slight misalignment of the rivers and shores, so it is good idea to check and manually fix them before you continue. It seems that the problem in the rivers database itself. I had e-mailed the person responsible for the database, hopefully he would help.
2. Not all elevations are automatically corrected - so if you have many rivers you may have to do many manual corrections, but you can reduce amount of rivers by setting river_level option to small values or even do not generate them at all with river_level 0
3. The map that has area that includes the E180 - W180 meridian are not supported.
4. The areas below latitude S60 are not supported. (Not much WW2 action thou) due to lack of the relevant data from GlobCover database



Consultation Needed

How to fix river slopes?

1. Set all water to 0 - bad would create huge unnatural canyons over high altitude rivers
2. Remove rivers segments/rivers that have big slopes (bad idea as well)
3. Live it to user to do it manually?
4. Do not fix it, i.e. build a terrain with high slopes...  What kind of problems can it cause?
5. Any other idea?


P.S.: Any comments and suggestions are welcome
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 22, 2013, 04:03:10 PM
Thanks for all the work, especially adding other formats besides srtm3. I was testing stuff over in the Pacific and it looks like srtm3 is not fully complete for that area. Had some hgt files but not others that your program was looking for. Will try it with the srtm30 now.

Oh, it would be nice if when you ran the program it also created a text file with the name of all the elevation files that are needed. For instance if I was using srtm3 ... well there are a TON of them. So instead of downloading all of them if your program spit out a text file with  the names of the ones need then can just download those ones.

In regards to rivers I would leave it up to the person. The problem is HTC editor only allowing water to rise/fall a few feet per mile. Which makes it impossible to do a river coming down from the mountains (on high slopes) unless you create a grand canyon effect. So probably more of design aesthetic ... do you want a grand canyon or not for the river?
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 22, 2013, 11:50:01 PM
The latest version includes an updated README. It should be more clear what do you need to download.

For SRTM30 and GTOPO30 there is a very nice gif file that shows what you need:

ftp://edcftp.cr.usgs.gov/data/gtopo30/global/tiles.gif

And with these databases there much less files so in most of cases you'll need only one.

With SRTM3 there is an image as well:

http://dds.cr.usgs.gov/srtm/version2_1/Documentation/Continent_def.gif

Note, that SRTM3 does not include files that contain water area only, so it is OK that some files are missed. In case of the Pacific it would be the most of them.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 23, 2013, 06:55:26 AM
Not sure if I explained myself clearly earlier. Even with the link to http://dds.cr.usgs.gov/srtm/version2_1/Documentation/Continent_def.gif it is very difficult figuring out what SRTM3 files you need for a given area. For instance if I center on Rabaul (in New Britain) to create my map the GIF map really doesn't tell me all of the files I need to download. I have included a snap shot of the GIF map and the your programming telling me all of the missing HGT files.

It would be nice if this list of missing files was exported out to a text file (what is listed as missing in the screen shot since I don't have any of the HGTs for that area).

(http://dgideon.org/aceshigh/srtm3-hgt-files.png)
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 23, 2013, 07:58:14 AM
Btw, this is not a major deal for me since it works perfectly with the srtm30 files, which as you say, are more than good enough for our purposes. Just a minor thing for the srtm3 files (would be helpful is all).
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 23, 2013, 08:21:18 AM
Okay the program world perfectly with BOB coordinates (I am using srtm30 ... downloaded all the files).

However, when I do my test using the coordinates for Rabaul in New Britain and Tokyo it crashes when it comes to elevation.

#rabaul
lat -4.2
lon 152.183
scale 1.0

#Tokyo
lat 35.6895
lon 139.6917
scale 1.0

I have attached a screen shot of what happened when I used the Rabaul coordinates to see if you can reproduce:

(http://www.dgideon.org/aceshigh/elevation-error.png)
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 23, 2013, 09:07:44 AM
I'll check...

Thanks for beta testing  :rock
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 23, 2013, 09:55:23 AM
No problem. I figure you are doing the heavy testing of actually writing the code so the least I can do is help with the beta testing of it.  :salute
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Dux on October 23, 2013, 02:58:01 PM
Hello good people. yes, I do check in here still every now and then.  :)
Artik, this looks really promising. Great work. Are you affiliated with MIT?
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 23, 2013, 03:12:27 PM
Quote
However, when I do my test using the coordinates for Rabaul in New Britain and Tokyo it crashes when it comes to elevation.

Ok, I found this bug, was something really stupid.

I'll release fixed version soon, also I'm working now on solution for river slopes correction.

Quote
Are you affiliated with MIT?

No, I just release the software under popular permissive Open Source license: http://en.wikipedia.org/wiki/MIT_License
It is easy to understand and use, also MIT license allows you to do almost anything with the source code, including embedding it to other products.

Being an author of multiple Free/Open Source projects I always provide a license for my products - even small ones.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: mrmidi on October 23, 2013, 03:12:46 PM
Hey there Dux. good to see your still around  :salute
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 23, 2013, 03:51:59 PM
 :salute Dux.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 23, 2013, 04:19:31 PM
Version 0.3 Released

Download from: http://cppcms.com/files/makeahmap/makeahmap_v0.3.zip

Bug fixes:

- Fixed crash when rendering terrain at far east globe locations, thanks to ghostdancer for pointing to this bug

New features:

- Added support of automatic terrain altitude corrections such that:

  (a) The water slopes of rivers are below 120 feet per mile
  (b) Lake water has same altitude all over the lake
  (c) Altitude corrections near sea shores are much more accurate

  Now the terrain contains correct slopes. This feature can be disable in config.in by setting fix_river_slopes to "no"
 
- Added support of automatic rivers removal if they create too big
  terrain changes - create to deep canyons. It is turned off by default.
 
  By setting parameter river_correction_limit to some positive value you can remove
  rivers that change the terrain altitude by more than specified limit.
 
  The program would run two passes - first to detect the rivers during
  altitude correction and second actual correction after removing problematic
  rivers.


Known Issues

1. Trees are visible over rivers in TE... Fix needed

2. There is known problem of slight misalignment of the rivers and shores, so it is
   good idea to check and manually fix them before you continue.

3. The map that has area that includes the E180 - W180 meridian are not supported

4. The areas below latitude S60 are not supported. (Not much WW2 action thou)
   due to lack of the relevant data from GlobCover database





Inputs are welcome
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: 68falcon on October 23, 2013, 05:29:41 PM
Hi Dux   :salute

Artik this looks like it is going to make our lives a lot easier  :cheers:
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 24, 2013, 03:07:48 AM
Ok

More known issue...

Apparently I misread the documentation and thought that elv, gndtype.bmp waterd.bmp/waterc.bmp change their side according to the map size.

 :bhead :bhead :bhead

They don't, they just filled inside - the size remains 512x512 miles.

So currently generating maps that have size below the 512 miles would actually create incorrect files - that would cause TE to crash...

HTC... please please... provide more clear documentation than this simple TEreadme.txt. And make TE little bit more crash resistant - like for example not to crash when the given input is incorrect...

Fix to be released soon.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 24, 2013, 06:20:29 AM
Version 0.4 Released

Download from: http://cppcms.com/files/makeahmap/makeahmap_v0.4.zip

Bug fixes:

- Fixed incorrect file generation for terrains of size < 512
- Fixed trees appearing over the water

New features:

- Added an option to shift river position globally in attempt to correct
  alignment issues

Known Limitations

1. The map that has area that includes the E180 - W180 meridian are not supported

2. The areas below latitude S60 are not supported. (Not much WW2 action thou)
   due to lack of the relevant data from GlobCover database

3. There is known problem of slight misalignment of the rivers and shores.
    You can try to use river_north_shift/river_east_shift options to
    amge global corrections and it is good idea to check the rivers
    ends before you start working on terrain objects.


Summary

It looks like I get to the my first goal:

Create a tool for fully automatic generation of accurate terrain including fine grained shore lines, ground type
mapping to AH tiles and elevations.

The program should be simple to use as long as you read the README.TXT...

There is more things to do, but they aren't very critical:

(a) Add water depth variation for seas, lakes and rivers.
(b) Nice clipboard map generation
(c) Improve user friendliness (list missing data files and maybe download them automatically)
(d) Create a GUI

But I think at this point it had already become a useful tool.

I would like to get more of your inputs and problem reports before I continue implementing new features.

It is more important to fix bugs than add new features.

Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 24, 2013, 06:52:10 AM
I'll download and do some more testing today and tomorrow. However, so far so good, I am able to build far east locations with no crashes.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 24, 2013, 07:39:41 AM
I would love to hear your opinion about the following options:

river_level how major river should be to be rendered... Or disable rivers at all
river_correction_limit eliminate river that require too deep canyons. i.e. if during the elevation slope correction the river needs an altitude drop above X feet, it wouldn't be rendered - allowing user to prefer having more rivers or having deeper canyons.
fix_river_slopes - would user want to turn it off all at all?


Also take a look on following files:

water_altitude_correction.bmp - a file that represent elevation changes required to fit all slopes TE requirements (<=120 feet per mile)
removed_rivers.bmp that lists all of the rivers that had been removed due to high altitude changes, it is created when you use the 2nd option reiver_correction_limit

Thank You!
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Easyscor on October 24, 2013, 12:38:10 PM
In the config file, a nice touch is to include a path name to the default AH terrain folder OR it can also be altered if the user uses a different location.
This is the default path right now, however the spaces in the path name are not readable by the program.
C:\Hitech Creations\Aces High Editors\ahiiterr

I particularly like what you've done with the ground types. Yes, the ground clutter showing along the shore in the TE is distracting but it won't show in the final terrain in-game. If you don't want to see it in the TE, uncheck the box Cell Overlay On (it shows the clutter). I always do this when working on a terrain in the TE.

Paint the shorelines with the ground type or beach instead of deep water; I've said this before. Open your output files in the TE to see the whitish deep water along your current shorelines and rivers. This change will allow finished looking output right away and the user can still go back into the TE and paint beach or whatever they choose. To me, seeing deep ocean anywhere on land is the sign of an unfinished terrain. This is particularly important along the rivers. You'll see what I mean after you've made this change when you open two version of the same output in the TE.

 :aok
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 24, 2013, 02:25:20 PM
Quote
This is the default path right now, however the spaces in the path name are not readable by the program.

I didn't want to create the output in the ahiiterr by purpose - because you need to run import of the water in any case
and you need to close the TE before the gndtype.bmp and mapname.elv is written to make sure it does not interfere.

Also the case of spaces it is just something stupid, it is trivial to fix it... just need to rewrite the config.ini parsing code a little bit

Quote
I particularly like what you've done with the ground types.

Besides the beaches and deep water, you can alter the ground covering mapping using groundmapping.csv (see config.ini for details)

Quote
Yes, the ground clutter showing along the shore in the TE is distracting but it won't show in the final terrain in-game.

Ok than I'll recheck it to see what effect it has in real game to make sure.

Quote
To me, seeing deep ocean anywhere on land is the sign of an unfinished terrain. This is particularly important along the rivers.

Note, you can change a color of lakes and rivers - so your rivers would look more natural. In any case I wanted to add
some water depth reduction but hadn't time to implement it yet.

Thanks for inputs!
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ImADot on October 24, 2013, 02:37:32 PM
Quote
To me, seeing deep ocean anywhere on land is the sign of an unfinished terrain. This is particularly important along the rivers.

Note, you can change a color of lakes and rivers - so your rivers would look more natural. In any case I wanted to add
some water depth reduction but hadn't time to implement it yet.

I think he's referring to the land showing the "deep ocean" texture - which basically shows as white "untextured" terrain.
 You would either see a whole section with no ground texture, or you would see the corners/edges of the parts that "stick out of the water's edge".

I haven't tried your app yet, but it sounds fantastic. The whole community should be very pleased with the relative ease with which new maps can be created. Although, for main arena purposes, real-world maps rarely make for easy 3-sided and balanced maps.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 24, 2013, 02:41:12 PM
Will check out all the options in more detail over this weekend. However, I am particular interested in:

Quote
river_correction_limit eliminate river that require too deep canyons. i.e. if during the elevation slope correction the river needs an altitude drop above X feet, it wouldn't be rendered - allowing user to prefer having more rivers or having deeper canyons.

Sometimes a canyon makes sense and other times, well it doesn't at all. This seems like it will be a nice feature where you can control things preventing to deep a canyon being made and instead just getting rid of the river. In many terrains rivers are more eye candy since most of the player action on the terrain is in the air and not GV battles. Not to mention for GVs a designer still needs to put in place bridges so they can cross. Resulting in rivers being more "eye candy" for want of a better term. Where many decide that no river is better than a canyon with almost sheer vertical cliffs.

So I look forward to testing this functionality out since then I wouldn't have to go in and erase water and reset elevation for areas like that. Will get back to you on how it goes when I do the testing of that part.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 24, 2013, 02:48:02 PM
Quick question on the river_correction_limit does it eliminate the whole river or does it eliminate the just the sections of the river that don't fit the correction limit you picked?

If it removes the whole river then I definitely like that you supply a removed_rivers.bmp that lists all of the rivers that had been removed. That way as a designer can go back and restore parts of the river on more flat terrain if I like (do a partial restore).
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Easyscor on October 24, 2013, 03:13:06 PM
Yes ImADot, that is exactly what I was saying.

Artik, Deep Ocean is both a color in the gndtype.bmp, and the final determination for the texture drawn in the terrain. You don't want Deep Ocean drawn anywhere on land.

I suspect that you initiate the gndtype.bmp to 00 00 00 everywhere. Instead, initiate it to 11 11 11 grass and continue unchanged.

When you set the gndtype.bmp color for land along a water edge to 00 00 00, that is an error. Use the globcover value if you can. HTC solves this problem by setting the underlying ground type at all water = grass. It's not perfect but it's not as annoying as making it deep ocean and it also works at rivers reasonably well. So if you set the gndtype to grass initially, when the globcover calls for water, use grass instead.

I hope that helps.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 24, 2013, 03:29:24 PM
Quick question on the river_correction_limit does it eliminate the whole river or does it eliminate the just the sections of the river that don't fit the correction limit you picked?

If it removes the whole river then I definitely like that you supply a removed_rivers.bmp that lists all of the rivers that had been removed. That way as a designer can go back and restore parts of the river on more flat terrain if I like (do a partial restore).

Yes it does remove an entire river (as it appears in GSHHS).

But from what I had seen, most of rivers consist of several section (in the DB) so you generally loos some parts, it is unlikely that you loose some major rivers.

Quote
I suspect that you initiate the gndtype.bmp to 00 00 00 everywhere. Instead, initiate it to 11 11 11 grass and continue unchanged.

Actually it is very bad... The problem that if user turns off detailed water option he gets greed water - and it is annoying... I have seen this happening
at several MA and once happened to me as well.

I usually fly with lowest graphics settings to have highest FPS, and this particular stuff makes the water look very bad.

So no setting entire gndtype to grass is bad. The only question is what to do along the boundaries. If in game there is no clutter (like in TE) than I would set it to grass or beach, but only on boundary not in general.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Easyscor on October 24, 2013, 03:42:32 PM

... than I would set it to grass or beach, but only on boundary not in general.


That is the preferred answer anyway.

And yes to your other question. We often will set a single water pixel in a cell to turn off all the clutter for the entire cell. A cell is a square that is 1 mile by 1 mile. A cell is the square you see in the TE outlined by red lines with a number in the middle.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: mrmidi on October 24, 2013, 06:12:35 PM

When you set the gndtype.bmp color for land along a water edge to 00 00 00, that is an error. Use the globcover value if you can. HTC solves this problem by setting the underlying ground type at all water = grass. It's not perfect but it's not as annoying as making it deep ocean and it also works at rivers reasonably well.

This is in fact a false statement. The default for all water is RGB value 0,0,0  which is deep ocean. Suds and I discussed this about 2 years ago. The ONLY time it is changed to grass by default is when you erase water. The default texture applied to the area you just erased is grass.

midi
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: USRanger on October 24, 2013, 07:25:49 PM
Break time!

(http://img268.imageshack.us/img268/6056/rx2.gif) (http://imageshack.us/photo/my-images/268/rx2.gif/)

Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: 715 on October 25, 2013, 06:33:57 PM
For river pixels that have too steep a slope to be legal why not just change that pixel to ground and set the corresponding ground type to rock to make it look like non-navigable rapids or cascades or a dam, while allowing the upstream river pixels to stay if they don't violate the slope limit?  In other words, after rasterizing the vector water data post process the pixel data to fix the too steep water.  Of course that would mean PT boats would be limited to traveling upstream only to the first such obstacle, but I doubt that would be an important limit, and the real river might not be navigable at that point anyway.

Personally I think carving a narrow deep canyon for the river would look really odd.

Also, do you have an answer yet about the registration problems with shorelines.  If you read the info file about how the water vectors were generated they were purposely correlated with the SRTM elevation data to insure shorelines had at least a 1 m elevation change to "contain" the water and this analysis is what lead to the water vector data.  (It would have made it so much easier for us if they had just saved the water as pixel data of the same resolution as the SRTM elevation at that point, but they didn't.)
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 26, 2013, 03:53:51 AM
For river pixels that have too steep a slope to be legal why not just change that pixel to ground and set the corresponding ground type to rock to make it look like non-navigable rapids or cascades or a dam, while allowing the upstream river pixels to stay if they don't violate the slope limit?  In other words, after rasterizing the vector water data post process the pixel data to fix the too steep water.  Of course that would mean PT boats would be limited to traveling upstream only to the first such obstacle, but I doubt that would be an important limit, and the real river might not be navigable at that point anyway.

Personally I think carving a narrow deep canyon for the river would look really odd.

Interesting point. I need to think about it - how to do it. In many cases it actually makes scene to steep the water.

Also, do you have an answer yet about the registration problems with shorelines.  If you read the info file about how the water vectors were generated they were purposely correlated with the SRTM elevation data to insure shorelines had at least a 1 m elevation change to "contain" the water and this analysis is what lead to the water vector data.  (It would have made it so much easier for us if they had just saved the water as pixel data of the same resolution as the SRTM elevation at that point, but they didn't.)

Can you please give me the reference so I can read about it as well?

Also note - there is no correlation problems with shorelines (i.e. sea, lakes, isles)  the problem with the rivers that is a separate dataset in the same collection (GSHHS)
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 26, 2013, 07:47:47 AM
You would also need to use another terrain type than rock since you would want to create a custom texture that looks like water / rapids when painted on land. Rock is used a lot of places in terrains and default texture looks nothing like rapids or water. You would probably want to ntt0011 river bed and create a custom texture tile for this. This might work for rapids, cascades but wouldn't work for a dam.

Interesting idea but probably an aesthetic choice, not sure how it would look but can easily try it out now on test terrain without the programming (just go into TE and erase water and then paint on something else for sections with two steep slope issues and see how it looks). Will try it out on my test terrain later and post up a screen shot.

Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Easyscor on October 26, 2013, 10:52:30 AM
Water is 165 feet wide while a ground type is 660 feet wide so painting a narrow river on a single texture won't work because a river will run in any direction. The terrain builder should choose how to deal with breaks in the rivers. With snow, and desert as well as ETO and PTO texture sets, Artik shouldn't be burdened with artwork. In truth, players will rarely notice or care about such a river break and will quickly dismiss it as unimportant.

Not @ Ranger lol:
I should think that anyone who appreciates Artik's work, and would like him to finish his tool, would not want to distract him with anything that might get in his way. Therefore it should be pretty clear that someone not trying to contribute in this thread or to its project must have a separate personal agenda of their own. Yes, I was in error about the ground type under water being grass but he'd already stated he wasn't going to choose that option.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: mrmidi on October 26, 2013, 11:54:06 AM
Wasn't trying to be snark about anything, was just trying to make sure people where not getting incorrect information.

I to like what Artik is doing here. This will make for an awesome addition to the terrain creation tool box.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 26, 2013, 01:54:57 PM
I wasn't suggesting creating a texture with a river running through it and land all about in the same bmp file. I was suggesting setting the ground type below the river to river bed. Then a designer can replace the river bed texture (ntt0011.bmp) with something else that works better visually. It would be up to the individual designer to get artwork and decide what he thinks visually works. Artik's program would just set that track of river to land instead and make the ground type river bed (if he thinks 715 suggestion is worth further exploration ... river bed ground type would work better than the rock ground type that 715 suggest imo).

715 made a suggestion on how to handle rivers. Since Artik said he would consider it I added if he goes that route to be visually convincing to player flying over head they would need a land texture that looks like water even though it isn't. Personally I don't think it will add much to the experience (although I do find the concept intriguing enough to experiment with manually in the TE) and would say he just remove the river like he currently does via a variable in his config file and let designers decide what to do about directly in the TE.

Ultimately, it is Artik's program, he asked for suggestions and they were given (in this case a suggestion by 715). It is up to Artik about what wants his program to do (what new features), what advice or opinions he wants to take / finds valid, and what he considers a burden or not.

Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 26, 2013, 02:11:20 PM
Quote
I should think that anyone who appreciates Artik's work, and would like him to finish his tool, would not want to distract him with anything that might get in his way

Actually the most important thing for be besides many useful input - is actually testing to program, trying it and looking if there something that may be problematic.

Finally I do appreciate the suggestions even if they are "far going" as it gives me a bigger picture.

Bottom line, the most important help I can get is actually people downloading the program and Using It

Now to clarify all the non-clear stuff about the gndtype, waterd and boundaries.

I created two terrains, in one mixed ares of water-non-water marked with gndtype = water (left column) and other one with land (beach)...

I changed the graphics option from top to bottom:

1. Detailed water & Detailed terrain
2. Detailed water & NOT detailed terrain
3. Neither water nor terrain are detailed.

(http://cppcms.com/files/makeahmap/images/compare.png)

Now the biggest problem of having ground on the area where water should be is not seeing the water where it should be with low details. I used to fly till last week with the lowest detail to import the FPS. Now I understand why on MA I had seen an aircraft carrier floating over grassy area!!! On the left you can actually see the water.

For example, the P-51D shooting to the ground and see water splashes (3rd row at the right). Now what would happen if I would actually try to land there?

Now if I look on the first row - I actually like the way water looks in the left column much more - no unnatural gradient seen (square edges in the water) - but this is a matter of taste. The only case that I think having the ground type for water when you have detailed water but non-detailed terrain.

To be honest. I don't know what is better - as somebody who has a low grade graphics card I think that actually left column is better.

So... I made an option... what happens on boundaries of water and land. So user can set the option. The default would be the thing that happens on the left column - i.e. if there is a mixture it would be water.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 26, 2013, 02:35:36 PM
Doing a Halloween party tonight, so I will post up my testing results of the new program tomorrow.

So far as for 715's idea, I haven't come up with visually pleasing way (ntt0011.bmp) for land area connecting river segments via land textures that look rapids. Also as pointed out earlier the pixel resolution for waterd is different than for gndtype (165 feet per pixel in waterd and 660 feet per pixel for gndtype) which results in fuzzy edges. Which might not be to bad if you are thinking of the area as swampy or rapids or something with an ill defined water edge. Personally I haven't come up with anything I like (others might be fine with it, will post screen shots later).

You also have a good point on this that with details on this might be workable but with details off yeah, not so much. Good thing you pointed this out since I always fly with details on, so didn't even realized I had that bias.

As for the supplying the removed_rivers.bmp when that option is selected. After playing around with things I really like this featured you built in. I am able to see what the rivers would have been like and it makes it very easy for me to reconstruct just the bits I want that don't cause problems.

One thing I haven't gotten around to testing yet is the water width variable. If I set say the width to 3 pixels is it this width for the whole river? Or will it taper down to 1 pixel near the head waters of the river?



Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ImADot on October 26, 2013, 02:41:31 PM
Now if I look on the first row - I actually like the way water looks in the left column much more - no unnatural gradient seen (square edges in the water) - but this is a matter of taste. The only case that I think having the ground type for water when you have detailed water but non-detailed terrain.

I'm guessing the "unnatural gradient in the water" is because you have no water-texture version of the ground texture, so the blending is poor. Also, in the left one that you like, you see all that white ground around the edges of the river? That's the "deep ocean" texture, and is also probably why there is no gradient where the water meets the land.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: 715 on October 26, 2013, 03:22:47 PM
Can you please give me the reference so I can read about it as well?

Also note - there is no correlation problems with shorelines (i.e. sea, lakes, isles)  the problem with the rivers that is a separate dataset in the same collection (GSHHS)

There is a document file (Product Specific Guidance v2.0 12 Mar 03jas.doc) added to every single SRTM water body data zip file (the vector data in shape file format).  There is also a much more detailed explanation in another file included with every shape file zip (SRTM Edit Rules v2.0 12 Mar 03.doc).  These both mention rivers as having 1 m "banks" as well as the DEM data being guaranteed to be monotonic for rivers (i.e. guarantees water flows continuously downhill).  (This second doc file is ridiculously large and it, rather than the actual shape file data itself, is what sets the size of the zip download.)
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 26, 2013, 03:26:09 PM
So far as for 715's idea, I haven't come up with visually pleasing way (ntt0011.bmp) for land area connecting river segments via land textures that look rapids. Also as pointed out earlier the pixel resolution for waterd is different than for gndtype (165 feet per pixel in waterd and 660 feet per pixel for gndtype) which results in fuzzy edges. Which might not be to bad if you are thinking of the area as swampy or rapids or something with an ill defined water edge. Personally I haven't come up with anything I like.

To be honest I still have no idea how to implement. I need to think about some smart algorithm to make these brake points - i.e. how to select points that would be optimal.

I am able to see what the rivers would have been like and it makes it very easy for me to reconstruct just the bits I want that don't cause problems.

What exactly do you change to improve the situation?

One thing I haven't gotten around to testing yet is the water width variable. If I set say the width to 3 pixels is it this width for the whole river? Or will it taper down to 1 pixel near the head waters of the river?

The rivers are stored as set of lines so I don't know how wide the actual river is and how its shape changes. So when I draw the line of the river (i.e. rasterize a single line I add N additonal pixels on each side so if the river_width is 2 than actual width would be 1 pixel for central line and 2 pixels for each side so totally it would be 5 pixels width when I render the line. By default the value is 1 so the default river width is 3 pixels (i.e. line with)

It is not the best but I don't have too much information about exact river properties.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: 715 on October 26, 2013, 03:28:47 PM
Doing a Halloween party tonight, so I will post up my testing results of the new program tomorrow.

So far as for 715's idea, I haven't come up with visually pleasing way (ntt0011.bmp) for land area connecting river segments via land textures that look rapids. Also as pointed out earlier the pixel resolution for waterd is different than for gndtype (165 feet per pixel in waterd and 660 feet per pixel for gndtype) which results in fuzzy edges. Which might not be to bad if you are thinking of the area as swampy or rapids or something with an ill defined water edge. Personally I haven't come up with anything I like (others might be fine with it, will post screen shots later).


Yeah, I had forgot about the different resolution for water and land.  How about just replace the too steep water pixel with the same land type as the surrounding terrain?  Would that blend in and not give a big blob breaking up a thin river, just a break in the river?
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Easyscor on October 26, 2013, 03:31:09 PM

1. Detailed water & Detailed terrain
2. Detailed water & NOT detailed terrain
3. Neither water nor terrain are detailed.

There is yet another option you might check first.

4. Detailed water OFF & Detailed terrain ON.

This is my preference and it accomplishes the same thing. Furthermore, the terrain slider allows the user to fine tune the load on his graphics card.

We've all seen posted films of people flying with detailed terrain OFF and they are better able to track their bandits. My impression is that some of those doing this have sufficiently capable hardware but are seeking an advantage that negates aircraft skins and background (textures) noise.

For special event terrains like those being built for the AvA, a builder can actually defeat this advantage and force choice 4 with the color choices you mentioned early in this thread.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ImADot on October 26, 2013, 03:43:12 PM
Here's a sample I put together a while ago, from my Canyon terrain, showing different combinations of terrain detail. I used various textures around and under the water.

(http://i289.photobucket.com/albums/ll239/ViperDriver/AcesHighII/Terrain%20Samples/GraphicDetailResults.jpg) (http://s289.photobucket.com/user/ViperDriver/media/AcesHighII/Terrain%20Samples/GraphicDetailResults.jpg.html)
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 26, 2013, 04:55:49 PM
Basically Artik I just do an abbreviated river. I just reconstruct the river  up to the point I just start to run into to many elevation issues that I think are to extreme (creating grand canyons). So basically I am able to reconstruct rivers that start at the foot hills of mountains and then run down a plain to the shore. I just do without the river part in the mountains.

I can't really think of anything you could do in addition to what you have already program since this is more of designers call of how deep a canyon he is willing to put up with.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 27, 2013, 03:11:14 AM
Quote
There is a document file (Product Specific Guidance v2.0 12 Mar 03jas.doc) added to every single SRTM water body data zip file (the vector data in shape file format).  There is also a much more detailed explanation in another file included with every shape file zip (SRTM Edit Rules v2.0 12 Mar 03.doc).  These both mention rivers as having 1 m "banks" as well as the DEM data being guaranteed to be monotonic for rivers (i.e. guarantees water flows continuously downhill).  (This second doc file is ridiculously large and it, rather than the actual shape file data itself, is what sets the size of the zip download.)

@715...

Note, I'm using GSHHS database, not SRTM Water Body Data - they are different databases. GSHHS is much easier to read/use. Its data is not split across hundreds of files. For example in GSHHS the Africa and Eurasia represented each one as a separate single polygon.

Also once you change the resolution of the elevations grid, you can not maintain the monotonic slope property of rivers.

Quote
There is yet another option you might check first.

4. Detailed water OFF & Detailed terrain ON.

This is my preference and it accomplishes the same thing

Interesting. I actually had found that detailed water has almost no effect on FPS, on the other hand
detailed terrain reduces FPS significantly. Also I must admit that I can see enemy planes much better
over detailed terrain. I can't explain why.

Basically Artik I just do an abbreviated river. I just reconstruct the river  up to the point I just start to run into to many elevation issues that I think are to extreme (creating grand canyons). So basically I am able to reconstruct rivers that start at the foot hills of mountains and then run down a plain to the shore. I just do without the river part in the mountains.


Actually it is very good way to reconstruct rivers...

Maybe I can automate this process. i.e. once I eliminated all rivers I start drawing each one from the from the bottom to the hill until I "hit the wall" i.e. when the corrections become too severe and than stop - instead of doing this manually.

It may actually work nicely and I think even better than what 715  had proposed.

And than if somebody wants mountain rivers can really add them manually.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 27, 2013, 09:18:24 PM
Okay been bouncing around and making test maps to see how things work. So far so good. I have made a map based on Manila, Stalingrad, Palopo (Celebes in Indonesia), Rabaul, etc.

No build issues so far. Although I do have to agree with you that when it comes to rivers and lakes you have to take things with a grain of salt because they don't actually sort of line up all the time with real lakes. Either that or some lakes have come and gone since the dataset was done. For instance the lakes up around Manila are good but when I moved down to the island of Negros there were some issues when comparing it against google maps. But then it did a good job on Mindano.

So my hunch is some areas have better info than others and that a designer really should double check lakes and rivers like your recommend. I think area 2 might me be river looping back and forth (when I went into satellite view I saw a lot of switch backs there and then it went into a stream).

Area 1 is bunch of marine ponds, its hard to make out the size exactly in satellite view but seems like things are a bit off.

Anyway just confirming what you already warned about, thought you might want to know that things seem fine in major areas just off in less develop areas you have to take with a grain salt. Your program is working great so far just the data is suspect in some cases.

#Manila
lat 11.3333
lon 123.0167
scale 1.0

(http://www.dgideon.org/aceshigh/lakes-negros.jpg)
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 27, 2013, 09:30:31 PM
I also played around with the river width variable.


# Specify the width of the river in pixels
# ----------------------------------------
#
# river_width 1

I set it to river_width 4 which resulted in all rivers being 9 pixels wide on waterd.bmp. I was expecting it to be 4 pixels but what seems to have happened is that it took the original river (1 pixel wide) and then added 4 pixels to each side resulting in 9 pixels. Not sure if that is the proper behaviour / functionality but it wasn't what I expected.

(http://www.dgideon.org/aceshigh/river-segment.jpg)

Also the whole river was the same width. I did expect this but would probably go in after your program creates the waterd.bmp file and manually taper the river at its header waters down to one pixel to give it a better aesthetic look.


Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Easyscor on October 27, 2013, 10:16:13 PM
You might choose to use the same river width system I developed. The width is in pixels.
// Width   Type   Count
//   5      0  (-55) x Unknown INVALID Type, there are no river type zero anymore.
//   5      1   2381 x Permanant Major River
//   4      2   4438 x Major River
//   3      3   7553 x Additional River
//   2      4   8985 x Minor River
//   1      5  (+55) x River Lake
//   2      6    246 x Double line river
//   4      7    877 x Intermittent River - major
//   3      8    977 x Intermittent River - additional
//   2      9      0 x Intermittent River - minor
//   2      10   107 x Major canal
//   2      11    93 x Lessor canal
//   0      12     0 x not used
//   2      13   242 x Irragation canal
//   0      14     0 x Users Local Stream
Ignore the counted segments. I don't think they're accurate since I've rebuilt the database for my personal use and if I remember correctly, I took the counts in the middle of that project.

It's the best publicly available database and gives great results but in addition to problems already mentioned, some of the rivers are missing.

Oh, and keep in mind that rivers change their course all the time, and new dams are built.

If I remember correctly, the river database was put together by the CIA in the '60 during the Cold War.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 28, 2013, 08:35:33 AM
Quote
Also the whole river was the same width. I did expect this but would probably go in after your program creates the waterd.bmp file and manually taper the river at its header waters down to one pixel to give it a better aesthetic look.

Ok... this does not work with current data-set. Rivers are not continuous... It is a problem. they are constructed from several segments which makes
the process not really possible without complex topological sorting or something like that.

Take a look on this image http://cppcms.com/files/makeahmap/images/variable-river-width.png

I tried to add variation across the river length and got quite unexpected result.

Quote
I set it to river_width 4 which resulted in all rivers being 9 pixels wide on waterd.bmp. I was expecting it to be 4 pixels but what seems to have happened is that it took the original river (1 pixel wide) and then added 4 pixels to each side resulting in 9 pixels. Not sure if that is the proper behaviour / functionality but it wasn't what I expected.

It is correct but not obvious - it is border width so the size is 1+w*2 i.e. in case of 4 it is 1+4*2 =9 (explained in config.ini) I probably should change it to make more obvious.

Quote
You might choose to use the same river width system I developed. The width is in pixels.

Ok this seems to be good idea, I thought of it but hadn't implemented yet.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Easyscor on October 28, 2013, 09:26:55 AM
Be sure to check the documentation. As I said, I rewrote my copy of the river database. IIRC Type 0 was originally for river segments like the  mouth of the Amazon where the segment is drawn the same way as a lake.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 28, 2013, 10:52:49 AM
No problem on the tapering of the river by the head waters. Didn't know how difficult that would be or not but as I said it is an aesthetic thing and easily something a designer can do themselves within the TE. Not to mention they already know they need to review rivers and lakes and such anyways.

Hmm, the variable width does do some unexpected things. Wonder how it looks on the TE in the TE where the rivers are rendered (whether it looks as abrupt or not as it does when looking directly at the waterd.bmp).

Yeah, I missed the description in the config.ini and just went down to the variable and the commented text there:

# Specify the width of the river in pixels
# ----------------------------------------
#
# river_width 1

Changing the text there to say or something like this would be nice for people like me that tend to skim documents. ;)

#Specify the width of the river in pixels. Following formula is used to create river width, 1+W*2
# -----------------------------------------------------------------------------------------
#
# river_width 1

Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: 715 on October 28, 2013, 03:00:32 PM
I don't see the problem with the variable width rivers in artiks image.  Real rivers don't just always monotonically increase in width down stream, they get wider and narrower according to topography: i.e. wide and shallow or slow moving, and narrow and deep or fast moving.  You're always going to get "quantum" effects because rivers are such narrow things and AH's resolution is kind of coarse.  Personally I think a single line constant width river would be a bit weird looking, more like a canal.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 29, 2013, 05:14:28 PM
Version 0.5 Released

Download from: http://cppcms.com/files/makeahmap/makeahmap_v0.5.zip

Bug fixes:

- Fixed river rendering to have correct width for rivers at NW/SW directions
- Fixed river width meaning now it really river width in pixels not 1+2*w
- Fixed support of spaces in path names

New Features:

- Added support of fully automatic data download - all files you need will be downloaded automatically when needed. You can disable this feature by setting download=no (see breaking changes below)
- Improver river removal algorithm such as a part of river is removed rather than entire river. You can return to old behavior by setting river_removal_policy=full.
- Added support of water depth variation near shores - you can specify a range on which a water becomes deep ocean.
- Added support of custom gndtype for the areas were water and land are mixed or not ocean depth water exits. This allows specification of custom tiles for various types of water boundaries.
- Added support of river width per river level, for example you can define river_width[2]=5 - which sets the river width of 2nd level river to 5 pixels(see breaking changes)
- By default river width changes with river majority - river level.
- Improved config.ini syntax and error reporting
- Improved error reporting in case of problems with file access

Breaking Changes

- Parameter river_width had changes its semantics
- Parameters river_water_color, land_water_color, sea_water_color and lake_water_color had been removed. User water_color[river], water_color[sea], water_color[land], water_color[lake] instead.
- Default name of globcover TIFF file had changed to "data\globcover.tif". So rename the file or change the option, otherwise it would be downloaded once again.

Known Limitations

1. The map that has area that includes the E180 - W180 meridian are not supported

2. The areas below latitude S60 are not supported. (Not much WW2 action thou)
   due to lack of the relevant data from GlobCover database

3. There is known problem of slight misalignment of the rivers and shores.
    You can try to use river_north_shift/river_east_shift options to
    amge global corrections and it is good idea to check the rivers
    ends before you start working on terrain objects.


Summary

There are many improvements - how makeahmap deals with water boundaries, water depths etc. Fully automatic file download was added to simplify program usage.

Enjoy... And report problems.

I'd really like to get feedback about water depth, gnd-types and river width changes.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 29, 2013, 05:43:43 PM
When you say fully automatic downloads does this also include the srtm3, srtm30, etc. elevation files? Or just the other files used to figure out land versus water, coastlines, rivers, etc.?

Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Easyscor on October 29, 2013, 06:44:22 PM
I can tell you that about every year or two, the USGS has changed the address for downloading these data files. I strongly recommend that all the paths be placed in the config file instead of in the code so that they can be changed by the user in the future.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 30, 2013, 12:07:58 AM
Quote
When you say fully automatic downloads does this also include the srtm3, srtm30, etc. elevation files? Or just the other files used to figure out land versus water, coastlines, rivers, etc.?

All of them are automatic: globcover, gshhs, gtopo30, srtm30, and even srtm3 which is very hard to download them manually.

Quote
I can tell you that about every year or two, the USGS has changed the address for downloading these data files. I strongly recommend that all the paths be placed in the config file instead of in the code so that they can be changed by the user in the future.

I already did. Every URL information is stored in the download_sources.txt. I also plan to put this particular file on the makeahmap web site so you will be able to update it separately.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Easyscor on October 30, 2013, 02:03:28 AM
I hadn't noticed that but there is a problem with it, the download_sources.txt file.

When opened with Notepad, unlike your other txt files which open fine, the download_sources.txt file's endOfLine value doesn't seem to be quite right.

It opens correctly in many programs but not Notepad. I'll try to duplicate part of what I'm seeing by removing the linefeeds here:

## Format# code type file1 (file2|-) url### Globcover## http://due.esrin.esa.int/globcover/#globcover tiff - - http://due.esrin.esa.int/globcover/LandCover2009/GLOBCOVER_L4_200901_20....

instead of

#
# Format
# code type file1 (file2|-) url
#

#
# Globcover
#
# http://due.esrin.esa.int/globcover/
#

globcover tiff - - http://due.esrin.esa.int/globcover/LandCover2009/GLOBCOVER_L4_20


As you see in this example, the linefeeds are missing. I haven't looked at your code, so I can't point to the offending line but it should be easy to find and fix.

I hope this helps. You've done impressive work here in an amazingly short time.

 :cheers:
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 30, 2013, 02:44:48 AM
I hadn't noticed that but there is a problem with it, the download_sources.txt file.

When opened with Notepad, unlike your other txt files which open fine, the download_sources.txt file's endOfLine value doesn't seem to be quite right.
...

It is Notepad... The only text editor that does not handle Unix line endings (i.e. instead of Windows CR-LF only LF). Any other (normal) editor like Notepad++ knows to handle them well.

In any case I'll fix the line endings so notepad would know how to handle it.

Most of major development and preliminary testing I run on Linux, as it is much more developer friendly environment. Only than I build and do final testing that actually require TE and AH on Windows.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 30, 2013, 03:06:39 AM
I also want to make an automatic clipboard map generation tool, such that nice looking maps would be created that would show both ground cover and altitude visualization, so you would be able distinguish between different areas. Current mapname.bmp is too simplistic and lacks grid.

However I don't really want to draw the grid lines and numbers manually, just too complicated - handle fonts, add a bunch of libraries, etc.

Can somebody please create plane grid images with sector numbers and sub-sector marks (i.e. numpad like markings) so I can merge them into automatically  generated map?

I need:

- Images of size 1024x1024 pixels that only contain grid and sector numbers, in any loseless  format like tiff, png or bmp (not jpeg).
- I'd like to have tham in B/W format, i.e two colors only
- I need 4 such images, for map sizes of 512, 256, 128, 64 miles.
- I need them in public domain (i.e. if you create them, just write a notices that these images in PD)

I assume there are enough map makers that can do such grids for me  :D
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 30, 2013, 06:45:28 AM
What email address you want them sent to?
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 30, 2013, 07:40:24 AM
artyomtnk@yahoo.com

Thanks!
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 30, 2013, 11:42:04 AM
There are some samples of automatically generated maps...

Battle of Britain: http://cppcms.com/files/makeahmap/images/bob.png
Israel: http://cppcms.com/files/makeahmap/images/israel.png
Black Sea: http://cppcms.com/files/makeahmap/images/black-sea.png

I used some simple grid I extracted from one of the textures, it lacks numbers. So once I get these grids I'll have the full support...
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 30, 2013, 12:45:36 PM
Very nice.

Once you have the grid numbers for the sectors though you might need to do some tweaking on those to make sure they are legible against the terrain (differing colors and such). Grid lines are fine while you might need a slightly darker color for the sector numbers once you have them.

A possible future enhancement would add variables to the config file or to a csv (like you did for gndtype) that allows the designer to set color values for various parts of the clipboard map. What you have is great and is really all most need. Just for the people who like to tweak it would be a thought.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 30, 2013, 01:22:03 PM
Very nice.

Once you have the grid numbers for the sectors though you might need to do some tweaking on those to make sure they are legible against the terrain (differing colors and such). Grid lines are fine while you might need a slightly darker color for the sector numbers once you have them.

A possible future enhancement would add variables to the config file or to a csv (like you did for gndtype) that allows the designer to set color values for various parts of the clipboard map. What you have is great and is really all most need. Just for the people who like to tweak it would be a thought.

The colors are fully configurable: you can define color for 5 types of ground forest, farm, grass, dessert, snow - the actual color would vary according to the brightness (for shade like effect) you can also  specify colors for water, shoreline and grid.

Also I start thinking that probably it is better in the grid templates to have numbers and actual grid colors be different so I can provide color for grid and numbers
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 30, 2013, 02:40:15 PM
I agree having the numbers and grid be separate is a good idea.

On the rest ...  :rock   :salute
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: ghostdancer on October 31, 2013, 07:28:50 AM
So I have done some tests on the latest version v0.5 and so far so good. I left everything in the config.ini alone except for inputtng latitude and longitude coordinates for various areas. I also didn't move over the ground cover tif, river files, or strm30, etc. files from v0.4 to v0.5. I wanted to test out the new download functionality from scratch.

- The globcover.tif takes forever to download (over 20 minutes for me) but it download successfully (automatically) and the program ran fine.

- First test I selected gtopo30 dem files. Successful automatic download and program created the terrain with no problem.

- I then switch to srtm3 for the same terrain (lat and long) and re-ran the program. No problem here either it sucessfully identified and got all the hgt files needed.

I will say that comparing the different elevation files that srtm3 is now the way to go. Much, much, much better detail and resolution (you easily see the difference in the elevation file and the CBM map created). I never really used this format before because it was pain to figure out all the hgt files needed and then a pain to download them all and unzip them. The automatic feature makes this a breeze and I would recommend that basically everybody use this format now since it is a breeze to use in Artik's program.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on November 02, 2013, 11:25:37 AM
Quote
I will say that comparing the different elevation files that srtm3 is now the way to go. Much, much, much better detail and resolution (you easily see the difference in the elevation file and the CBM map created)

Small note about SRTM3... The biggest problem with SRMT3 that it lacks a data above N60. Basically this means, for example, that we can't create maps for Murmansk area - and recreate for example PQ convoys. Also SRTM3 more accurate (i.e. less blurred when you look to elevation file) I'm not sure how important it is. Finally the accuracy of our maps in elevations is 1/2 a mile + many corrections required to contain the water.

See: http://dds.cr.usgs.gov/srtm/version2_1/Documentation/Continent_def.gif

Additional note about the advantage of automatic download - it saves disk space - all individual files after being extracted from ZIP are compresses with gzip saving disk space (gzip compressed files are much easier to read directly in comparison to zip)
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on November 02, 2013, 01:07:44 PM
Version 0.6 Released

Download from: http://cppcms.com/files/makeahmap/makeahmap_v0.6.zip

Bug fixes:

- Changed download_sources.txt line endings to CR/LF to make them more windows friendly

New Features:

Implemented automatic clipboard map generation. Thanks for Ghost Dancer for the grid templates.

The colors of different parts of map are fully configurable (see config.ini for details). The difference
in elevations can be marked using "shading-like effect" or "altitude-color" variation. The strength
of these effects is configurable as well.

Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on November 03, 2013, 05:03:38 AM
Added a wiki page: http://www.hitechcreations.com/wiki/index.php/Terrain_Generation_From_Geographical_Data and added the link to it from http://www.hitechcreations.com/wiki/index.php/Terrain_Editor

Maybe it is time to create a sticky discussion with a link to the wiki page?
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: jeffdn on November 04, 2013, 04:36:08 PM
Artik -- what language is this written in? Can you possibly put the code on GitHub (http://www.github.com) so that other people can contribute? I can help if it's in C/C++/C# or compiled Python.  :salute
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on November 04, 2013, 05:25:16 PM
Artik -- what language is this written in? Can you possibly put the code on GitHub (http://www.github.com) so that other people can contribute? I can help if it's in C/C++/C# or compiled Python.  :salute

It is C++. Source code is provided.

I'll put it probably on source-forge as I already actively use SF account (for several projects).
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: dantheman on December 15, 2013, 07:10:55 PM
very interesting, are you considering updating this tool for the new terrains when they come out?
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on December 16, 2013, 03:03:34 AM
very interesting, are you considering updating this tool for the new terrains when they come out?

Yes I am. However we don't know a thing about new terrain file formats. So it is hard to tell what, if at all, would require changes.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: 715 on December 16, 2013, 03:07:47 PM
Well, you do know the altitude resolution will probably go to 4K but that's an easy change as the SRTM3 files are already about 8K.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on December 17, 2013, 04:20:41 AM
Well, you do know the altitude resolution will probably go to 4K but that's an easy change as the SRTM3 files are already about 8K.

The general knowledge does not really help...

Need accurate data formats, TE etc.

Once HTC releases the new TE and AH I'll be able to work on it.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on April 30, 2014, 12:56:32 AM
Hi Guys... Few questions

- Have anybody used this tool for creating an AH Map (besides me)?
- Can this thread be sticky, or maybe create a new sticky thread?
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Easyscor on September 09, 2014, 02:43:58 PM
Hi artik,

I hope you've been well.

As htc moves closer to a release of their new engine, I thought it time to point you at better GIS ELEVATION data for your terrain generating program.

Take a look at Global Multi-Resolution Terrain Elevation Data 2010, aka GMTED2010.

The data files are free IF you can find the right USGS site(s). They are also listed at sites which charge you money for the download or limit the scope of coverage (smaller files) so skip those sites and keep searching with the file name be75_grd.zip etc.

The site I prefer is:
http://topotools.cr.usgs.gov/gmted_viewer/gmted2010_global_grids.php

It is originally based upon the srtm(?) data but has been reworked by GIS professionals to correct the missing or erroneous output data. It includes resolutions of 30, 15, and 7.5 arc seconds.

These full, zipped data files for 7.5 arc seconds are ~2.9 GB for the whole earth.

Greg Bagby
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on June 15, 2016, 03:56:35 PM
Currently I had dropped support of makeahmap for AH2 - there is some stuff that does not work right now but I don't think I need to waste my time on it.

Updates for AH3 there: http://bbs.hitechcreations.com/smf/index.php/topic,379777.0.html
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Kanth on March 29, 2017, 11:34:15 AM
posting elsewhere just ignore this.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Randall172 on June 09, 2017, 08:10:57 PM
You should put this on Github so that others can see source and fork it
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on June 10, 2017, 07:37:47 AM
You should put this on Github so that others can see source and fork it

It is https://github.com/artyom-beilis/makeahmap

this is quite an old thread and should be replaced with more recent one.
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: captain1ma on August 16, 2018, 11:38:32 AM
if you need to download his makemap program, use the following link. program works great!!! version 1.12 was the last one.

http://cppcms.com/files/makeahmap/ (http://cppcms.com/files/makeahmap/)
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: CptTrips on October 18, 2018, 09:35:31 AM
Wow!  This is an excellent piece of coding.   :salute Artik!!
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Ciaphas on January 29, 2019, 11:51:41 PM
Artik,

I found an alternate source for the GTOPO30 resource that was taken offline at
Quote
edcftp.cr.usgs.gov/data/gtopo30/global/

Try this URL:

http://www.webgis.com/terr_world.html (http://www.webgis.com/terr_world.html)

The global cover link needs to be updated to:

due.esrin.esa.int/files/GLOBCOVER_L4_200901_200912_V2.3.color.tif (http://due.esrin.esa.int/files/GLOBCOVER_L4_200901_200912_V2.3.color.tif)
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on January 30, 2019, 03:04:51 AM
Artik,

I found an alternate source for the GTOPO30 resource that was taken offline at
Try this URL:

http://www.webgis.com/terr_world.html (http://www.webgis.com/terr_world.html)

The global cover link needs to be updated to:

due.esrin.esa.int/files/GLOBCOVER_L4_200901_200912_V2.3.color.tif (http://due.esrin.esa.int/files/GLOBCOVER_L4_200901_200912_V2.3.color.tif)

It was fixed to webgis.com at the github, so latest version 1.12 contains the correct URL.

Regarding globcover, the 1.12 version already points to latest version (zip also not tiff)

Also today I suggest to use SRTM3 unless you have to do something above N60 in such case it is better to use SRTM30 that has slightly better quality for data below N60 than GTOPO30
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on January 30, 2019, 03:07:28 AM
Make sure you download latest version from there:

http://cppcms.com/files/makeahmap/
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Ciaphas on January 30, 2019, 07:28:25 AM
ah, was definitely looking at a different version. my bad.

Thanks!


Sent from my iPhone using Tapatalk
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Ciaphas on January 30, 2019, 09:11:23 AM
There is a silver lining to looking up information for an out of date version, my research skills are on point  :rofl
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Easyscor on April 20, 2019, 08:26:08 AM
Artik,
Any part of this you like can be used in any way you like!
Ex: The config.ini file can be opened with MS. Notepad.exe
That might be good at the top of your README.txt file?

Easy  :salute

Last Thursday I was asked if there was a tutorial for Artik’s program.
Artik’s original posting was on 2013 Oct 16, or ~6 years ago, at the top of this thread. Here’s the link for reference:
https://bbs.hitechcreations.com/smf/index.php/topic,355152.msg4704503.html#msg4704503

Since then, Artik’s answered many questions over the years, and I wouldn’t wish this thread to disappear without being linked by any new thread, but respectfully, maybe it’s time for a new sticky thread with current links to the program and instructions at the top?

Short of that, I’m responding to the request from 1eye.
In the post a few above this, Artik linked his latest version of his program at:
http://cppcms.com/files/makeahmap/
Edit:
As of April 2019
You want: makeahmap-1.12.zip   2017-Feb-17 22:02:01   2.9M   application/zip
/Edit

#______________________________________________
#  The first thing you need to know is that
#  the config.ini file can be opened with MS Notepad.exe
#  The program reads the config file for all its input!
#  Anytime a line in the config file sees the ‘#’ character, the program ignores
#  the rest of that line. This is very useful as explained later.
#
#  The config file is where you set such specifications as your terrain name, lat/lon, scale,
#  etc.
#
#  The program automates many aspects of terrain building but requires data files.
#
#  The config.ini file contains the explanation that the files, such as the Digital Elevation
#  Model (dem) data files are on the web, and that the files and their source addresses
#  are contained in the download_souces.txt file.
#  The information, that the DEM file addresses and other source file address are in
#  in the download_souces.txt file isn’t particularly important today, 2019 April,
#  but as the USGS and others tend to change the http paths every couple of years,
#  you should understand that if the files can’t be found by the program, it’s probably
#  because of the sources' web admin has changed the path.
#  Unfortunately, the USGS often changes the path, about every couple years in the past.
#  This will break the internal link and require that the user manually update the paths
#  or wait for a program update.
#  Until a new release of the program, with a new download_souces.txt file is released
#  the program won’t be able to find the sources. No worry though.
#  As of 2019 April, the links still work. But if they don’t, the paths in the
#  download_sources.txt file can be manually updated.
#  A Google search on the final file names, as found in the download_souces.txt file,
#  should find the new path to the needed sources.
#  The beauty of the program is that once downloaded, the user will not need to
#  download, or wait for a particular source file again unless he deletes the program
#  folder.
#______________________________________________

#  By the way, this next entire dummy block can be pasted as is into the config.ini
#  document as is, so long as it is the last active input data in the file.
#
#  Why is this important?
#  This means that apparently ALL the config data for any particular
#  terrain can be kept together in one block.
#
#  To be clear, something like lat= or lon=, works the same way.
#  Helpful while narrowing down the exact target lon/lat.
#  Example follows:

map_name=newteran   # 8 char alphanumeric only, no “_” etc.

map_size=64
dem=srtm3
output_dir="newteran "   # MUST manually create the dir ie. a new folder inside the "makeahmap-1.12" folder
lat=50.000000      # will be over-written by next lat=
lat=51.000000      # new legal target latitude
lon=3.000000
lon=4.000000      # same situation for longitude
scale=1.0
river_level=11      # otherwise, some of the water courses won't be drawn. Your call, search config notes.
#______________________________________________

IMO, the AH AvA, SEA, and terrain building community owe a great debt of gratitude to Artik for his unselfish work on your behalf. I can say this as someone who has programed a similar program in the past.
 :cheers:
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on April 20, 2019, 11:46:33 AM
btw there is very detailed tutorial here
https://www.hitechcreations.com/wiki/index.php/Terrain_Generation_From_Geographical_Data

and it is 100% community editable

And thanks
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Easyscor on April 20, 2019, 11:51:34 AM
Cool. I'll be looking at it myself.

Thanks again!

 :cheers:
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: 1ijac on April 22, 2019, 01:19:04 AM
Thank you Artik and Easyscor.  I'm new at this and appreciate the help.

One-eye   :aok
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: bustr on April 22, 2019, 02:41:36 PM
In your tutorial the section about lakes at altitude, if you don't need really complicated shoreline shapes, you can use the new river path object. Create many segments then stretch their individual widths. The bed for it to lay on has to have the shores(boarders) flat so you don't get intersection interference from the surrounding polygons.

Here I ran one river and created several lakes.


(https://i.postimg.cc/1XQy2fZq/medtst789.jpg) 


Wanted to bomb a dam with a Lancaster.


(https://i.postimg.cc/XvBTB1L8/medtst794.jpg)
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on April 23, 2019, 01:33:32 AM
when I created this program the lakes hadn't been implemented in AH, so... I need to do some/many  changes to the program
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: captain1ma on November 01, 2019, 09:22:50 AM
I still love the program Artik, its great!!!!
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: popeye on April 16, 2020, 01:32:00 PM
Just experimenting and get this error:

https://www.ngdc.noaa.gov/mgg/shorelines/data/gshhg/latest/gshhg-bin-2.3.6.zip

The file doesn't exist on the noaa site.  Is there a fix?
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: Easyscor on April 16, 2020, 04:37:09 PM
Just experimenting and get this error:

https://www.ngdc.noaa.gov/mgg/shorelines/data/gshhg/latest/gshhg-bin-2.3.6.zip

The file doesn't exist on the noaa site.  Is there a fix?
These files get moved every year or two. Look in the "download_sources.txt" file for the the sources list. You will need to do a web search for "gshhg-bin-2.3.6.zip" Once you find the new link-location, fix the line in the text file.
For every error, rinse and repeat.

C:\...\UnZipped\makeahmap-1.12  4GB\makeahmap-1.12
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on April 16, 2020, 11:54:30 PM
One more note, latest download_sources.txt can be found on github there:

https://raw.githubusercontent.com/artyom-beilis/makeahmap/master/download_sources.txt
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: popeye on April 17, 2020, 10:50:56 AM
Replaced download_sources.txt and it is working fine now.  Thanks!

 :salute
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: popeye on October 13, 2020, 10:37:43 AM
The last couple of terrains I've generated include very large areas of 1 foot elevation.  Is this due to insufficient elevation data in the SRMT3 dataset?  I've tried adjusting the solver_threshold.  Is there some other setting that would increase elevation resolution?  Is there a way to offset the 1 foot elevation areas to make them water?

The area I'm currently working on is:

lat=29.7
lon=116.0
scale=0.8

Thanks.  I've been having a blast with this program!   :salute

Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on October 21, 2020, 03:00:07 PM
1st I suggest open another discussion rather than using this thread. What do you mean 1 foot. AFAIR I always add 100 foot to all ground area to make sure it does not become water see water_to_land_range/water_to_land_slope but in general can you describe your problem more precisely?
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: artik on April 02, 2021, 05:16:37 AM
New Release 1.13

- Updated download sources with correct URLs
- Added support of OpenCL GPU platform selection for water optimization
- Added support of altitude offset according to user requests: altitude_offset parameter that is added to actual elevation
- Fixed grid for 256 miles map

Download from there: http://cppcms.com/files/makeahmap/
Title: Re: Automatic terrain generation from geographical data (a tool I created)
Post by: captain1ma on April 02, 2021, 07:42:54 PM
thank you so much artik. i know theres only a few of us that use your terrain but we are really grateful!!! thanks for all you do to help us and the game!!   :salute