Author Topic: makeahmap Alpha for AH3 terrain editor  (Read 2212 times)

Offline artik

  • Silver Member
  • ****
  • Posts: 1907
      • Blog
makeahmap Alpha for AH3 terrain editor
« on: May 05, 2016, 04:17:58 PM »
Hello,

I released makeahmap version for AH3 - it is very basic version - work in progress

http://cppcms.com/files/makeahmap/makeahmap-1.1alpha.zip

it does:

- Elevation with higher accuracy using SRTM3 - for newer model (vastly improves visual appearance)
- Sea and lakes set to altitude -100 so it isn't best right now

What is missing:

- Globcover support for automatic terrain type mapping
- Rivers in new model
- Proper non-0 altitude lakes

Known - Issues

- Some issues when two land objects are close sometimes water removed (like Suez)
- GTOPO30 does not work (source is gone and I can't find a new one)

For instructions please refer to older version: http://www.hitechcreations.com/wiki/index.php/Terrain_Generation_From_Geographical_Data
Also currently you only case use clipboard map and elevations are imported using signed RAW image file
Artik, 101 "Red" Squadron, Israel

Offline bustr

  • Plutonium Member
  • *******
  • Posts: 12436
Re: makeahmap Alpha for AH3 terrain editor
« Reply #1 on: May 05, 2016, 04:23:00 PM »
Will this eventually be able to reproduce road and train track systems if they are included in the source material?
bustr - POTW 1st Wing


This is like the old joke that voters are harsher to their beer brewer if he has an outage, than their politicians after raising their taxes. Death and taxes are certain but, fun and sex is only now.

Offline Chalenge

  • Plutonium Member
  • *******
  • Posts: 15179
Re: makeahmap Alpha for AH3 terrain editor
« Reply #2 on: May 05, 2016, 05:09:57 PM »
- GTOPO30 does not work (source is gone and I can't find a new one)

You mean the utility to read and convert 30 arc terrain? or is it because the data set is so large?
If you like the Sick Puppy Custom Sound Pack the please consider contributing for future updates by sending a months dues to Hitech Creations for account "Chalenge." Every little bit helps.

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10881
Re: makeahmap Alpha for AH3 terrain editor
« Reply #3 on: May 05, 2016, 05:37:56 PM »
Yes, even the mirror site in Japan has removed them. The package has been replaced by several versions of better data.
I'll try your newest one shortly.
« Last Edit: May 05, 2016, 05:40:02 PM by Easyscor »
Easy in-game again.
Since Tour 19 - 2001

Offline 715

  • Silver Member
  • ****
  • Posts: 1835
Re: makeahmap Alpha for AH3 terrain editor
« Reply #4 on: May 05, 2016, 07:21:25 PM »
Artik:

I've implemented GlobCover in my program.  I've noticed that it creates distracting banding in mountainous areas as AH3 apparently ramps through all the intermediate terrain types between two chosen for adjacent "pixels" (see attached image).  I don't have a solution.  Do you have any ideas?

I've also toyed with the idea of trying to morph the entire altitude file to make all water (say from GSHHG) at -40 alt by subtracting some 2D polynomial fit, or perhaps multiple Gaussians.  That would be a lot of work and the negative alt = water feature doesn't like to make narrow watercourses; they get pinched off (happens to a lot of my coastline estuaries).  I think I'll just wait for Hitech to implement rivers and polygon lakes.

The increased resolution of the terrain alt file, from SRTM3, really improves terrains doesn't it?  It especially improves tanking as there is finer scale topography to give gullies etc. to limit sight range.

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10881
Re: makeahmap Alpha for AH3 terrain editor
« Reply #5 on: May 05, 2016, 07:30:09 PM »
On my end, the program choked in two areas, so far.
At scale values of 2.5 (not a good idea in srtm3 but sometimes necessary) it failed somewhere in the download/conversion process and
At gshhg-bin2.3.5.zip it Failed to rename file ./temp/tmp.zip.part to ./temp/tmp.zip
Easy in-game again.
Since Tour 19 - 2001

Offline artik

  • Silver Member
  • ****
  • Posts: 1907
      • Blog
Re: makeahmap Alpha for AH3 terrain editor
« Reply #6 on: May 05, 2016, 11:28:54 PM »
Will this eventually be able to reproduce road and train track systems if they are included in the source material?

No I don't have historical datasets of roads

Yes, even the mirror site in Japan has removed them. The package has been replaced by several versions of better data.
I'll try your newest one shortly.

To be honest it isn't that critical as srtm30 integrates some of the gtopo30 in the areas where srtm coverage does not exist (like Murmansk area)

 
Quote
I've noticed that it creates distracting banding in mountainous areas as AH3 apparently
ramps through all the intermediate terrain types between two chosen for adjacent "pixels"

Probably you scale the image instead of resampling one

It worked for me fine with ah2 I'll see how it goes with AH3

regarding rivers I want to use existing track system also not got to it yet


Quote
At scale values of 2.5 (not a good idea in srtm3 but sometimes necessary) it failed somewhere in the download/conversion process and
At gshhg-bin2.3.5.zip it Failed to rename file ./temp/tmp.zip.part to ./temp/tmp.zip

Probably I need to clean the temp directory on startup so if previous download failed it wouldn't mess with new one.

Regarding choking,  what do you mean, stuck? Probably some internet related issues

Maybe I'll change the model in future so I'll keep the original zip files and use them directly so it would be possible to download all manually as well
Artik, 101 "Red" Squadron, Israel

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10881
Re: makeahmap Alpha for AH3 terrain editor
« Reply #7 on: May 06, 2016, 04:11:31 AM »
By that I meant I was forced to hit Enter after "Failed to rename file ./temp/tmp.zip.part to ./temp/tmp.zip"

It seemed to continue without error if I manually downloaded and unzipped the missing srtm files to the data folder, at least until it hit the ghhs files. My gshhg files are custom so I couldn't just copy them over. I appreciate that the program downloads all the srtm files necessary without user attention and faster then I can do the downloads manually.

btw, I'm using an SSD drive so it might work better if I moved your prgm to regular hard drive?
Easy in-game again.
Since Tour 19 - 2001

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10881
Re: makeahmap Alpha for AH3 terrain editor
« Reply #8 on: May 07, 2016, 02:14:08 AM »

Probably I need to clean the temp directory on startup so if previous download failed it wouldn't mess with new one.


Removing that file allowed it to run again until the next time it reappeared.

The community is going to owe you a huge debt when you're done.
Easy in-game again.
Since Tour 19 - 2001

Offline artik

  • Silver Member
  • ****
  • Posts: 1907
      • Blog
Re: makeahmap Alpha for AH3 terrain editor
« Reply #9 on: May 07, 2016, 03:41:31 PM »
Aplha 1.2 released

http://cppcms.com/files/makeahmap/makeahmap-1.2alpha.zip

- Fixed water slope handling
- Fixed water channels between land areas
- Now temp directory is cleaned on startup so in case of download fails program can just run again
- Added options:
   lake_alt_limit - maximal allowed lake altitude - so it would be removed rather then brought to sea level
   lake_or_island_min_size - minimal size of lake or island if it is smaller than this it is not rendered
   water_to_land_slope - the slope the altitude rises from water


--------------------

I want to get to GlobCover

Now I have questions regarding splat files... quoting hitech

Quote
The texture type file (now called splat) is export  into a 32 bit bmp

The R channel defines the small texture type. (0  = type 0, 16  = type 1, 32 = type 2 ...)
The G channel defines the Large texture type (0 = 0,64 = 2, 128 = 3 192 = type 3)
The B channel is a blend factore between the 2 types, this is normally always 0 or 255.

1. What is the difference between small and large texture type and why do we need them/how do we use them?
2. The types are the same as in AH2 or we have more/different (see below)
3. Why for small it is multiple of 16 and large of 64 or for no reason?
4. When we do blending?


/ ntt0000  Deep water ntt0000 will always be deep water  (This is a greyscale BMP designed to vary the water over distances)
// ntt0001  Grass
// ntt0002  Forest 1 (evergreen)
// ntt0003  Forest 2 (deciduous)
// ntt0004  Farm 1
// ntt0005  Farm 2
// ntt0006  Rock
// ntt0007  Swamp
// ntt0008  Rocky Grass
// ntt0009  Sandy Grass
// ntt0010 A  Beach
// ntt0011 B  River bed /
// ntt0012 C  Snow / Coral
Artik, 101 "Red" Squadron, Israel

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10881
Re: makeahmap Alpha for AH3 terrain editor
« Reply #10 on: May 07, 2016, 07:20:52 PM »
I think all of this is covered in the new Terrain Manual except #3 which is so you can visually detect the different colors in the splat map. I don't know why one is 16 and the other is 64 other then it allows sharper differences for Atlas 1 which is the most important set in my opinion because it can fix problems between tiles in Atlas 0 tiles.

Look for "The Terrain Tab" in the index.

Easy in-game again.
Since Tour 19 - 2001

Offline 715

  • Silver Member
  • ****
  • Posts: 1835
Re: makeahmap Alpha for AH3 terrain editor
« Reply #11 on: May 07, 2016, 09:54:41 PM »
Artik:  There are 20 texture types now (for each texture set).  16 small ones, i.e. 0 through 15, which get multiplied by 16 to create the Red channel, and 4 larger textures, 0 - 3, (mostly farmland for Europe texture set) which get multiplied by 64 to make the Green channel, and then the blue channel is 0 to select the small texture or 255 to select the large one.  In my program I label these 0 - 19* and map them to the GlobCover indexes as shown in the attached file.  For some I used secondary criteria: for example I map GC "bare" to sand if the alt is below 1500 m or to rock if it is above.  This prevents sandy areas in the Alps.  (In no way do I claim my mapping is in anyway good, but I attached it just as an example of one mapping for the default European summer texture set.)  Obviously, if one is making their own texture set then they would design it to match GlobCover better.  My program then exports to a 32bit bitmap and that seems to work fine with AH3.

The default texture sets are designed so that increasing texture index is used for increasing altitude (i.e. sand is 0 while snow is 15).  When two textures are next to each other and are not consecutive, say texture 4 next to texture 9, then AH3 rendering engine ramps through all the intermediate textures in the area between them, ie 4, 5, 6, 7, 8, 9.  So when you use GlobCover to make texture choices it's possible, in fact likely, that adjacent textures will differ by more than one in the texture index order and that leads to some visible banding (like the example image I posted earlier).  I've started doing some analysis of the GlobCover texture connectivity stats to see if I can reduce the banding by just rearranging the order of AH3 default textures (which would require making a custom texture set).

*i.e. 0-15 are the small textures and 16-19 the four large ones (only useful for understanding the attached file).

Offline artik

  • Silver Member
  • ****
  • Posts: 1907
      • Blog
Re: makeahmap Alpha for AH3 terrain editor
« Reply #12 on: May 08, 2016, 02:56:46 AM »
I used this data for mapping in AH2

 https://github.com/artyom-beilis/makeahmap/blob/ah3/groundmapping.csv

Now there are more tile types and what is most missing is general description of the types what is that
The automatic banding is really unfortunate it may hurt the conversation

If it is OK for you I'll start from your table as reference

Also what is really missing is urban area
Artik, 101 "Red" Squadron, Israel

Offline 715

  • Silver Member
  • ****
  • Posts: 1835
Re: makeahmap Alpha for AH3 terrain editor
« Reply #13 on: May 08, 2016, 10:24:41 AM »

Now there are more tile types and what is most missing is general description of the types what is that
The automatic banding is really unfortunate it may hurt the conversation

If it is OK for you I'll start from your table as reference

Also what is really missing is urban area

Your welcome to use my table if you want.  I've attached a transcript of my scribbled notes describing each texture that I used to decide on my table in case you want to make your own.  One depressing thing I noticed in the data is practically every square inch of Europe is either urban or farmland.  Lots of tile types end up at like 0.3% usage while the majority are some form of farmland.

Regarding the urban areas (of which there are a lot) I was planning on dropping AH3 City objects liberally on top of the areas marked urban (Easyscor: can each country on a map have more than one City?)

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10881
Re: makeahmap Alpha for AH3 terrain editor
« Reply #14 on: May 08, 2016, 11:05:38 AM »
Regarding the urban areas (of which there are a lot) I was planning on dropping AH3 City objects liberally on top of the areas marked urban (Easyscor: can each country on a map have more than one City?)

Sure. One of the SEA terrain has so many it's exceeded the 50k object limit, but don't do that because those excess objects above 50k probably don't work right. Unlike MA terrains, the real world terrains have a need for more city place holders and 'targets' as opposed to a working strat. With so many cities and factories, the field objects are bound to rebuild at their fastest rate even without strat disabled in the Arena Settings.
Easy in-game again.
Since Tour 19 - 2001