Author Topic: Makeahmap 1.3Alpha for AH3 terrain editor  (Read 3883 times)

Offline artik

  • Silver Member
  • ****
  • Posts: 1908
      • Blog
Makeahmap 1.3Alpha for AH3 terrain editor
« on: June 13, 2016, 04:47:33 PM »
Available at: http://cppcms.com/files/makeahmap/makeahmap-1.3alpha.zip

One of the major change in this version is an approach to water/elevation relations.

The biggest change with AH3 update from my point of view is requirement that all water being at 0 altitude and that beaches need so have some slope to look nice... So a entirely new method is provided:

1. All ground "Starts" at +30 feet (configurable water_to_land_range/water_to_land_slope) and beaches are created at range of -30 to +30 feet giving accurate representation of shore lines.
2. All rivers and lakes moved to 0 altitude (from both above and below sea level)
3. Terrain elevations are modified to rather preserve the gradient and not absolute elevation values. (see notes below)
4. You can control the maximal allowed elevation for lakes/rivers to prevent to big altitude modifications (lake_alt_limit)
5. River width is now specified in feet and by default only major rivers are drown
6. In order to calculate the altitude modifications makeahmap now depends on a GPU that supports OpenCL (most recent GPU does by default), if makeahmap fails to start telling that no OpenCL.dll found - just run makeahmap_cpu.exe (also it would run slower - typical altitude optimization will take 1-2 min on CPU vs 10-15 seconds on GPU)

Additional changes: Reverted back generation of splat types and clipboard maps.

What I need from you:

1. See how acceptable good water generation is. You can find "mem.pgm" image that is generated during makeahmap.exe run in its directory to see altitude modifications made for water handling
2. Please see how splat types look well, try to edit groundmapping.csv suggest improvements
3. Please Post the textual output of makeahmap runs (the elevation optimization stuff timings) see example

Quote
- Latitude, longitude range and scale
    Lat:     27.542     34.958
    Lon:     29.433     38.107
  Scale:      1.000
- Loading custom ground type mapping
- Loading GlobCover Data.
- Loading Digital Elevations Model data.
- Loading & processing shores data.
-- Total segments:1450523, maximal segment lenght:70.704
- Loading & processing rivers data...
--- Total river segments: 6612; max river segment length 7.940
  Complete
- Updateing altitudes...
-- Converting water bodies to elevations map
--- Iceles and Lakes
--- Rivers
-- Calculating elevation modifications to bring water to 0 feet
   Using:OpenCL solver running on GPU: GeForce GTX 960; computing units=8

         Grid|  Vertices| Time (s)|Iterations| Bandwidth GB/s
      256x256|     42261|    0.034|       223|   14.392
      512x512|    168587|    0.060|       346|   49.144
    1024x1024|    673420|    0.263|       536|   67.378
    2048x2048|   2691852|    1.440|       809|   73.943
    4096x4096|  10763723|    8.645|      1253|   76.032

    Total optimization time 10.442 s
    Maximal correction  range max=1678.000 min=-1368.000
    Maximal land modificationt to below 0 alt 623
- Fixing ground types according to shorelines shapes... Done
- Saving ground types: splattype.bmp... Done
- Saving elevation data .raw and .bmp... Done
-- Maximal altitude (for use with TE bmp import) is 9977 feet
- Generating clibboard map... Done

NOTE:

How altitudes are modified, we create a huge "membrane" over water areas (the boundary conditions) and see how it scratches between rivers lakes and sea (mem.pgm) - once it is calculated we extract it from the elevations to bring the water down to 0. The membrane is calculated to minimize the "stretching energy" thus trying to preserve the gradient - it allow to create very gradual altitude modifications too keep natural "terrain texture" look.

Waiting for comments
Artik, 101 "Red" Squadron, Israel

Offline artik

  • Silver Member
  • ****
  • Posts: 1908
      • Blog
Re: Makeahmap 1.3Alpha for AH3 terrain editor
« Reply #1 on: June 14, 2016, 01:43:43 AM »
I'm adding an illustration that describes the elevations modifications
that preserve local terrain features



We stretch a new sea level over known water bodies using a 'rubber membrane'
Now we can gradually modify the elevations keeping all local terrain features.
Also absolute altitudes are changed but total perseption of the terrain is preserved

It works in both ways for positive and negative altitudes like Dead Sea.

There is an image called mem.pgm that shows the new calculated reference altitude that becomes the
new sea level
Artik, 101 "Red" Squadron, Israel

Offline artik

  • Silver Member
  • ****
  • Posts: 1908
      • Blog
Re: Makeahmap 1.3Alpha for AH3 terrain editor
« Reply #2 on: June 15, 2016, 12:43:53 AM »
Any input please, does it work for you, how the shorelines look like, any issues with running with opencl?

I need some feedback
Artik, 101 "Red" Squadron, Israel

Offline captain1ma

  • Aces High CM Staff
  • Plutonium Member
  • *******
  • Posts: 14388
      • JG54 website
Re: Makeahmap 1.3Alpha for AH3 terrain editor
« Reply #3 on: June 15, 2016, 07:47:01 AM »
im going to try this out as soon as possible.

Offline artik

  • Silver Member
  • ****
  • Posts: 1908
      • Blog
Re: Makeahmap 1.3Alpha for AH3 terrain editor
« Reply #4 on: June 15, 2016, 03:53:28 PM »
Version 1.4 Released:  http://cppcms.com/files/makeahmap/

- Improved documentation and default values of various parameters
- Fixed location of output debug files
- Small improvements in CPU solver.

I had also updated the wiki to reflect the changes in the new version:

http://www.hitechcreations.com/wiki/index.php/Terrain_Generation_From_Geographical_Data


Still waiting for inputs, most important:

1. How does new elevation model works for you
2. ground types mapping I need review and adjustments of globcover to splat index.
3. Does OpenCL version works well and how fast on your HW.
Artik, 101 "Red" Squadron, Israel

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: Makeahmap 1.3Alpha for AH3 terrain editor
« Reply #5 on: June 19, 2016, 09:40:17 AM »
Been traveling for business and family issues. Thanks for doing this and I am downloading this now to try it out. Will report back as I use it.
X.O. 29th TFT, "We Move Mountains"
CM Terrain Team

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: Makeahmap 1.3Alpha for AH3 terrain editor
« Reply #6 on: June 19, 2016, 04:29:09 PM »
Okay my anti-virus and Firewall definitely does not like your program. Simply turning off both though while a build map stopped them from blocking the program.

The splat map needs a little bit of work. I am testing your program by making a new Battle of Britain map. When I go eastward from the French coast the its a mix of sporadic blobs of beach scattered among the farmland for quites a distance inland.

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

Offline artik

  • Silver Member
  • ****
  • Posts: 1908
      • Blog
Re: Makeahmap 1.3Alpha for AH3 terrain editor
« Reply #7 on: June 19, 2016, 11:30:40 PM »
Okay my anti-virus and Firewall definitely does not like your program. Simply turning off both though while a build map stopped them from blocking the program.

It is most likely because of the automatic downloads it does. If you run it again on the same region once all is downloaded does anti-virus still block it? If it is still blocking what is the message it tells?

The splat map needs a little bit of work. I am testing your program by making a new Battle of Britain map. When I go eastward from the French coast the its a mix of sporadic blobs of beach scattered among the farmland for quites a distance inland.

There is a file output/ground_coverage.bmp that describes the original ground types taken from globcover database.

There is a parameter in config.ini

type_mapping="groundmapping.csv"

You can uncomment it and edit the csv:

1st column is the original globcover values
2nd is splattype color
3rd is the globcover database description of the original value

Now you can play with it and adjust globcover data set to tiles and see what works best I indeed need to do more work on the mapping but also I need some input from community.

Also can you please post the output of the program. I want to see how sea level adjustments converges at different HW.
Artik, 101 "Red" Squadron, Israel

Offline artik

  • Silver Member
  • ****
  • Posts: 1908
      • Blog
Re: Makeahmap 1.3Alpha for AH3 terrain editor
« Reply #8 on: June 22, 2016, 03:42:36 PM »
Version 1.5beta  Released: http://cppcms.com/files/makeahmap/makeahmap-1.5beta.zip

Changes:

- Fixed 660 feet (1 edge of ground) alignmnent issue between water bodies and elevations
- Fixed crash when no altitude modifications are performed
- Fixed generation of raw file for maps smaller than 512x512 miles
- Improved debug output to color elevations map


Still waiting for the feedback and the textual output of your runs (I do need them)
Artik, 101 "Red" Squadron, Israel

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10899
Re: Makeahmap 1.3Alpha for AH3 terrain editor
« Reply #9 on: June 22, 2016, 08:32:32 PM »
Did the elevation numbers I passed along for the shorelines help?
Easy in-game again.
Since Tour 19 - 2001

Offline artik

  • Silver Member
  • ****
  • Posts: 1908
      • Blog
Re: Makeahmap 1.3Alpha for AH3 terrain editor
« Reply #10 on: June 22, 2016, 10:23:44 PM »
Did the elevation numbers I passed along for the shorelines help?

What do you mean?
Artik, 101 "Red" Squadron, Israel

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10899
Re: Makeahmap 1.3Alpha for AH3 terrain editor
« Reply #11 on: June 22, 2016, 11:10:24 PM »
Clearly not. nm
Easy in-game again.
Since Tour 19 - 2001

Offline Devil 505

  • Aces High CM Staff
  • Plutonium Member
  • *******
  • Posts: 8998
Re: Makeahmap 1.3Alpha for AH3 terrain editor
« Reply #12 on: June 22, 2016, 11:57:43 PM »
So does this mean that all water in AH3 will be sea level?
Kommando Nowotny

FlyKommando.com

Offline artik

  • Silver Member
  • ****
  • Posts: 1908
      • Blog
Re: Makeahmap 1.3Alpha for AH3 terrain editor
« Reply #13 on: June 23, 2016, 12:22:23 AM »
In AH2 there was a small terrain slope allowed for the areas with water, actually the water markings were separated from the elevations data.

In AH3 the water (sea) is defined as ground elevation below zero. It allows to create smooth beaches but it doesn't hold in real world data as lakes and rivers are almost always located at higher (or sometimes lower) altitude than mean sea level.

So my program needs to adjust terrain elevations bringing all the water bodies to the mean sea level, but also preserve local terrain features
Artik, 101 "Red" Squadron, Israel

Offline hitech

  • Administrator
  • Administrator
  • *****
  • Posts: 12398
      • http://www.hitechcreations.com
Re: Makeahmap 1.3Alpha for AH3 terrain editor
« Reply #14 on: June 23, 2016, 11:05:05 AM »
In AH2 there was a small terrain slope allowed for the areas with water, actually the water markings were separated from the elevations data.

In AH3 the water (sea) is defined as ground elevation below zero. It allows to create smooth beaches but it doesn't hold in real world data as lakes and rivers are almost always located at higher (or sometimes lower) altitude than mean sea level.

So my program needs to adjust terrain elevations bringing all the water bodies to the mean sea level, but also preserve local terrain features

There are other ways to make lakes by simply anding a lake poly object (can be a simple water square) at the lake elevation. And then setting the ground elevation below the poly where you want the water to show.

HiTech