Author Topic: Automatic terrain generation from geographical data (a tool I created)  (Read 23092 times)

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: Automatic terrain generation from geographical data (a tool I created)
« Reply #30 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?
« Last Edit: October 22, 2013, 04:04:51 PM by ghostdancer »
X.O. 29th TFT, "We Move Mountains"
CM Terrain Team

Offline artik

  • Silver Member
  • ****
  • Posts: 1907
      • Blog
Re: Automatic terrain generation from geographical data (a tool I created)
« Reply #31 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.
Artik, 101 "Red" Squadron, Israel

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: Automatic terrain generation from geographical data (a tool I created)
« Reply #32 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).


X.O. 29th TFT, "We Move Mountains"
CM Terrain Team

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: Automatic terrain generation from geographical data (a tool I created)
« Reply #33 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).
X.O. 29th TFT, "We Move Mountains"
CM Terrain Team

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: Automatic terrain generation from geographical data (a tool I created)
« Reply #34 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:

X.O. 29th TFT, "We Move Mountains"
CM Terrain Team

Offline artik

  • Silver Member
  • ****
  • Posts: 1907
      • Blog
Re: Automatic terrain generation from geographical data (a tool I created)
« Reply #35 on: October 23, 2013, 09:07:44 AM »
I'll check...

Thanks for beta testing  :rock
Artik, 101 "Red" Squadron, Israel

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: Automatic terrain generation from geographical data (a tool I created)
« Reply #36 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
X.O. 29th TFT, "We Move Mountains"
CM Terrain Team

Offline Dux

  • Aces High CM Staff (Retired)
  • Platinum Member
  • ******
  • Posts: 7333
Re: Automatic terrain generation from geographical data (a tool I created)
« Reply #37 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?
Rogue Squadron, CO
5th AF, FSO Squadron, Member

We all have a blind date with Destiny... and it looks like she's ordered the lobster.

Offline artik

  • Silver Member
  • ****
  • Posts: 1907
      • Blog
Re: Automatic terrain generation from geographical data (a tool I created)
« Reply #38 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.
Artik, 101 "Red" Squadron, Israel

Offline mrmidi

  • Aces High CM Staff
  • Silver Member
  • ****
  • Posts: 1879
Re: Automatic terrain generation from geographical data (a tool I created)
« Reply #39 on: October 23, 2013, 03:12:46 PM »
Hey there Dux. good to see your still around  :salute
In charge of nothing.
C.O. 29th TFT, "We Move Mountains"
It is what it is!

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: Automatic terrain generation from geographical data (a tool I created)
« Reply #40 on: October 23, 2013, 03:51:59 PM »
 :salute Dux.
X.O. 29th TFT, "We Move Mountains"
CM Terrain Team

Offline artik

  • Silver Member
  • ****
  • Posts: 1907
      • Blog
Re: Automatic terrain generation from geographical data (a tool I created)
« Reply #41 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
Artik, 101 "Red" Squadron, Israel

Offline 68falcon

  • Aces High CM Staff (Retired)
  • Platinum Member
  • ******
  • Posts: 6440
      • 68th Lightning Lancers
Re: Automatic terrain generation from geographical data (a tool I created)
« Reply #42 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:
Commanding Officer
68th Lightning Lancers
Fear the Reaper no more. Fear the Lancers

Offline artik

  • Silver Member
  • ****
  • Posts: 1907
      • Blog
Re: Automatic terrain generation from geographical data (a tool I created)
« Reply #43 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.
« Last Edit: October 24, 2013, 03:11:44 AM by artik »
Artik, 101 "Red" Squadron, Israel

Offline artik

  • Silver Member
  • ****
  • Posts: 1907
      • Blog
Re: Automatic terrain generation from geographical data (a tool I created)
« Reply #44 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.

« Last Edit: October 24, 2013, 06:23:30 AM by artik »
Artik, 101 "Red" Squadron, Israel