Author Topic: Smoothing boundaries between different ground types  (Read 587 times)

Offline artik

  • Silver Member
  • ****
  • Posts: 1907
      • Blog
Smoothing boundaries between different ground types
« on: January 18, 2017, 09:24:51 AM »
In order to improve MakeAHMap I want to have an option to smooth the changes in ground types (that are derived from globcover)

Now for tile types 0-15 there is natural smoothing as I can gradually modify one type to another:

i.e if I have a row [22222299999] I can smooth it as [2234567899] - as the engine does it any way.

I can also smooth between tiles 0-15 to any of 16-19 using the weight between them using the blue channel in splattype: in rang of 0-255 (am I correct?)


However for tiles of 16 to 19 there is no natural smoothing (am I right?) and these tiles are good for vast majority of populated areas. I fear that there will be unnatural translations between areas with tiles of 16 to 19.

What is the best way to smooth such translations or AH already does it ok?


How smooth is transfer from one tile to another for big tiles 16-19? Do I need to do smoothing at all
Artik, 101 "Red" Squadron, Israel

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: Smoothing boundaries between different ground types
« Reply #1 on: January 18, 2017, 09:48:41 AM »
Not sure I will have to go check in the editor to see what they look like in Euro, Med, and Pac tileset.
X.O. 29th TFT, "We Move Mountains"
CM Terrain Team

Offline artik

  • Silver Member
  • ****
  • Posts: 1907
      • Blog
Re: Smoothing boundaries between different ground types
« Reply #2 on: January 18, 2017, 10:22:46 AM »
Not sure I will have to go check in the editor to see what they look like in Euro, Med, and Pac tileset.

What does it means Euro / Med and Pac tiles?  Can I select or these are ones you have built for the game,

Also if tiles have different meaning than the mapping between globcover and tiles should probably be different
Artik, 101 "Red" Squadron, Israel

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: Smoothing boundaries between different ground types
« Reply #3 on: January 18, 2017, 01:01:17 PM »
Those are the tilesets. So if you go into the editor you can select a tileset and it uses different BMPs for the tiles depending on which tileset.
X.O. 29th TFT, "We Move Mountains"
CM Terrain Team

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10891
Re: Smoothing boundaries between different ground types
« Reply #4 on: January 18, 2017, 03:46:19 PM »
Ghostdancer is right. There are currently four tilesets available under the Settings menu in the TE. The TE creates a text file in your terrain folder, defset.txt. Here are the one character values.

0 European
1 Pacific
2 Don't use right now - will crash the TE
3 Mediterranean

Number two was the wwi tile set but it will crash the TE if you use it now. Perhaps it bodes the arrival of a winter tileset?

~~~~~~~~~~~

To keep it simple, yes, you can blend all the tiles together. It requires between one and two pixels of blending along the boarders. You must use a tile pixel (for blending) from the opposite Atlas. Two distant tiles from the same Atlas won't blend well without the intervening pixel(s) for blending.


« Last Edit: January 18, 2017, 04:27:25 PM by Easyscor »
Easy in-game again.
Since Tour 19 - 2001

Offline artik

  • Silver Member
  • ****
  • Posts: 1907
      • Blog
Re: Smoothing boundaries between different ground types
« Reply #5 on: January 18, 2017, 04:20:43 PM »
Now it is clear.

I checked how the different tiles behave and I see that the translation between large tiles (16-19) is very smooth and does not require any filtering however tiles 0-15 do require so I implemented one and it seems to improve the tiles.

However not it is clear that different globcover->spalttype mapping required for different tilesets...

Thanks
Artik, 101 "Red" Squadron, Israel

Offline 715

  • Silver Member
  • ****
  • Posts: 1835
Re: Smoothing boundaries between different ground types
« Reply #6 on: January 18, 2017, 05:38:03 PM »
I'm confused: why manually smooth between tiles 0-15 when the render engine does that automatically itself (which is what leads to banding anyway as an intermediate tile that has lots of trees makes a line of trees in the smoothed transition)?  Are you saying it looks better if your program spreads the transition out over a wider region than one "tile pixel"?

PS Artik: the mapping I gave you (which you've since changed) was for the European tile set only.

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10891
Re: Smoothing boundaries between different ground types
« Reply #7 on: January 18, 2017, 07:35:31 PM »
I don't think I can say anything with certainty any longer because the tilesets are now different from the last time I did my testing. The Med set is very much different and much better imo.

Also, the brush used under the Terrain Tab now seems to compensate for the banding. That's a big improvement over the Alpha/Beta TE version. :aok

715, if you place all your tiles by hand, then the TE tool will now merge between the tiles eliminating the banding. That won't happen (yet) if you use a graphics program or code to create a splat.bmp. A tile 15 next to tile 0 will create 14 bands between the two. In the splat.bmp, you must allow for the merging pixels between those two, 0 and 15, or between 16 and 19. Even between 16 and 19 you will have 3 bands unless you create the merge pixel(s). Got it?
« Last Edit: January 18, 2017, 07:37:05 PM by Easyscor »
Easy in-game again.
Since Tour 19 - 2001

Offline 715

  • Silver Member
  • ****
  • Posts: 1835
Re: Smoothing boundaries between different ground types
« Reply #8 on: January 19, 2017, 01:11:02 AM »
Got it?

Nope. ;)

I thought the fix was supposed to be to place a tile 16, 17, 18, or 19 between two 0-15 tiles that differ by more than one, i.e. there is no banding when going between the small and the large tiles.  Example would be 333316169999. However, we thought that wasn't an ideal solution because all the big tiles are farmland and that puts bands of farmland in the mountains.

But I haven't played with the TE in a long time so I could easily be mistaken.

Offline artik

  • Silver Member
  • ****
  • Posts: 1907
      • Blog
Re: Smoothing boundaries between different ground types
« Reply #9 on: January 19, 2017, 02:31:43 AM »
@715

Indeed the translation is much more pleasant if it isn't sharp, sharp translation creates pixelized feeling.

Regarding the tiles mapping, I indeed see that my mapping that was originally based on yours fits only Euro tiles and I need a new one for pacific and mid tiles.

If you guys can help to create an optimal one for them (by editing groundmapping.csv) it would be great, note you need to use the latest makeahmap version
Artik, 101 "Red" Squadron, Israel

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10891
Re: Smoothing boundaries between different ground types
« Reply #10 on: January 19, 2017, 02:57:07 AM »
The Mediterranean set was very hard to work with before but it looks like it will be much better now, I don't know. Unfortuanately, I'm swamped with work right now and my current terrain, when I can work on it, uses the ETO set but maybe Ghostdancer is working on a Pac or Med terrain.

I've only tested your program version 15 in the last 6 months or so. As I said somewhere else, it was very impressive, especially the shorelines. wtg.
Easy in-game again.
Since Tour 19 - 2001

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: Smoothing boundaries between different ground types
« Reply #11 on: January 19, 2017, 08:04:17 AM »
Yep I just did Egypt and re-working Italy so I am using the Med set. Also working on Pac terrains so can test there to.
X.O. 29th TFT, "We Move Mountains"
CM Terrain Team