Author Topic: gndtype.bmp and waterd.bmp interaction  (Read 1082 times)

Offline artik

  • Silver Member
  • ****
  • Posts: 1907
      • Blog
gndtype.bmp and waterd.bmp interaction
« on: October 18, 2013, 05:20:52 PM »
gndtype.bmp and waterd.bmp have very different resolutions... How do they interact.

What do I mean. If in an area of waterd.bmp that corresponds to a pixel in gndtype.bmp all water or all ground - it is simple. But what if it is partial - what should there be?

Thanks!
Artik, 101 "Red" Squadron, Israel

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10892
Re: gndtype.bmp and waterd.bmp interaction
« Reply #1 on: October 18, 2013, 05:36:13 PM »
Go with the gndtype. Otherwise you have deep ocean showing.
Easy in-game again.
Since Tour 19 - 2001

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: gndtype.bmp and waterd.bmp interaction
« Reply #2 on: October 18, 2013, 08:40:11 PM »
Not really sure what you mean by "partial" here and it sort of depends on what you are trying to do.

Basically the waterd.bmp draws your land and also allows you to set water depth. It is the master item that gndtype.bmp is applied to.


gndtype.bmp paints this land with various textures (grass, forest, etc.). If the textures are on the land area (solid white) defined by waterdbmp then you have land textures. show to players. If they are in a water area (black) or a water area that has water depth (various steps of grey corresponding to different depths) you get a water texture being painted there and shown to players. However, if you don't have a corresponding water texture to land texture, say you just have ntt0001.bmp (grass) but no wntt0001.bmp the editor uses the land texture and basically the player would see grass under water or farm land or forest, etc.

So the interatction is that gndtype.bmp paints the land and water depth areas that waterd.bmp creates.

Shorelines can be a bit of pain but if you go with beach along the shoreline  (ntt0010.bmp) and do have a wntt0010.bmp (sand or rocky sand under water texture) you don't usually run into a problem. A thin strip of beach applied to land areas and if it bleeds over into water areas a corresponding water texture is used (if you have one setup). Rivers areas can be a bit tricky though since you might not want to have a sandy shoreline for them.

However, you must remember that the water texture will only show up to players IF in your waterd.bmp file you have created water depth radiating out from the land (land is pure white rgb 255,255,255). Basically each step down from pure white is a step down in water depth. At a certain depth you will see nothing but at 254,254,254 you would see a water texture show through. If you don't have any water depth done in waterd.bmp just pure white for land and pure black for water then any ground textures you define in gndtype.bmp are only really shown to players on land. Anything that bleeds over into the water would not show because black is deep ocean (even though they actually do exist).

So many times with rivers you just don't set water depth and then don't have to worry about any textures showing through the river water. Aesthetically though sometimes we do set river depth because we want to like rocks under river water to indicate rapids or fording areas, etc. But these don't have any effect on game play are just done for aesthetic reasons.

« Last Edit: October 18, 2013, 08:50:46 PM by ghostdancer »
X.O. 29th TFT, "We Move Mountains"
CM Terrain Team

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: gndtype.bmp and waterd.bmp interaction
« Reply #3 on: October 18, 2013, 09:05:29 PM »
Here is a screen shot an area in the solomons terrain with the gndtype.bmp on the left and waterd.bmp on the right.

You'll see in the waterd.bmp a halo around the land fading out into the black (deep ocean). The halo (not pure white area) is varying water depth getting deeper and deeper.

Over on the gndtype.bmp you will see a strip of sand (2nd color in from the black) that applies to both the land area and the water area (beach and just off beach in the water). The the outer color is where another texture is defined as water gets deeper so that players just don't just seen sand under the water but a coral texture instead.

So in case of the textures that gndtype.bmp setup bleeding over into the water areas as defined by waterd.bmp if you have water depth make sure you have a corresponding water texture setup for a land texture and you will be fine. Or don't do water depth at all (the halo in the right side of the image) and any textures in water won't be shown at all to players. They will see land then water and nothing under the water. Not aesthetically pleasing to some but others are fine with that.

« Last Edit: October 18, 2013, 09:08:22 PM by ghostdancer »
X.O. 29th TFT, "We Move Mountains"
CM Terrain Team

Offline artik

  • Silver Member
  • ****
  • Posts: 1907
      • Blog
Re: gndtype.bmp and waterd.bmp interaction
« Reply #4 on: October 19, 2013, 03:36:26 AM »
Quote
Not really sure what you mean by "partial" here and it sort of depends on what you are trying to do

I mean that every pixel in gndtype.bmp has 4x4 = 16 pixels in waterd.bmp. So I need to understand what should I put into gndtype.bmp to make it look fine.

I mean would it show water texture if gndtype is beach? Should I blend beach and water? Or should I put water for all area.

i.e. for waterd.bmp 4x4 patch like that

0   255 255 255
0   0   255 255
0   0   255 255
0   0   0   255


I clearly see that I need gndtype.bmp to have some water as by mistake I hadn't marked any water area on it even when I had correct waterd.bmp and I hadn't seen any water in the GAME (TE had shown the water).

So I wonder what happens exactly on the edge...

I see your points... But it is still confusing..

Also what waterc.bmp does... I still can't figure out fully. Because it seems that depth also changes it..
Artik, 101 "Red" Squadron, Israel

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: gndtype.bmp and waterd.bmp interaction
« Reply #5 on: October 19, 2013, 07:28:53 AM »
Quote
I mean would it show water texture if gndtype is beach? Should I blend beach and water? Or should I put water for all area.

It will show water if there is no water depth (area is is painted black in waterd.bmp). So if the textures you paint with gndtype.bmp bleed over into the water area they will not show at all if there is no water depth, players will see deep water. Many designers go this route because it is the easiest thing to do and they don't have to worry about matching up the gndtype.bmp exactly or worry about a bleed of ground texture or partial applying of ground textures to water.

Now if there is water depth then it will show beach (ntt0010.bmp) which results in the player seeing the beach texture under water.

If there is water depth then and you have a wntt0010.bmp then that texture is shown under water instead of the beach texture (ntt0010.bmp).

You don't need to blend anything you just need to have the land file and corresponding water file and terrain editor will apply land where land is and water where water is if there is water depth. The only issue you could have is not having a corresponding water file.

Oh, and yes it is confusing and sometimes very furstrutating working at three different resolutions for waterd.bmp, gndtype.bmp, and your elevation file. Makes synching things up a bit of pain sometimes.

Beach


Corresponding water version of Beach



« Last Edit: October 19, 2013, 07:38:09 AM by ghostdancer »
X.O. 29th TFT, "We Move Mountains"
CM Terrain Team

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: gndtype.bmp and waterd.bmp interaction
« Reply #6 on: October 19, 2013, 07:43:31 AM »
What I recommend you at least have would be a corresponding water texture for:

- beach (ntt0010.bmp)
- sandy grass (ntt0009.bmp)
- grass (ntt0001.bmp)

So you would have this:

- wntt0010.bmp
- wntt0009.bmp
- wntt0001.bmp

These are the three land textures that are the most commonly used along a shore line. You might also want one for river bed (ntt0011.bmp) but not many people put water depth on rivers.



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

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: gndtype.bmp and waterd.bmp interaction
« Reply #7 on: October 19, 2013, 09:13:33 AM »
Oh the waterc.bmp is used for setting water color. In the terrain editor you can change the color of water. This is where those changes are recorded.
X.O. 29th TFT, "We Move Mountains"
CM Terrain Team

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10892
Re: gndtype.bmp and waterd.bmp interaction
« Reply #8 on: October 19, 2013, 09:46:32 AM »
I mean that every pixel in gndtype.bmp has 4x4 = 16 pixels in waterd.bmp. So I need to understand what should I put into gndtype.bmp to make it look fine.

I mean would it show water texture if gndtype is beach? Should I blend beach and water? Or should I put water for all area.

i.e. for waterd.bmp 4x4 patch like that

0   255 255 255
0   0   255 255
0   0   255 255
0   0   0   255


I clearly see that I need gndtype.bmp to have some water as by mistake I hadn't marked any water area on it even when I had correct waterd.bmp and I hadn't seen any water in the GAME (TE had shown the water).

So I wonder what happens exactly on the edge...

I see your points... But it is still confusing..

Also what waterc.bmp does... I still can't figure out fully. Because it seems that depth also changes it..

I should have clarified. Go with any land type not the deep ocean ground type for the whole gndtype pixel. Otherwise you have the whitish deep ocean poking through along your coastline. Got it? I thought this was part of our earlier conversation.
Easy in-game again.
Since Tour 19 - 2001

Offline artik

  • Silver Member
  • ****
  • Posts: 1907
      • Blog
Re: gndtype.bmp and waterd.bmp interaction
« Reply #9 on: October 24, 2013, 06:36:31 AM »
One thing I had found (in a hard way)

If there is a water on waterd.bmp but in the gndtype.bmp there is a land in same area - for example beach, than trees and other various objects may pop out the water.

So if any of the 4x4 pixels in waterd.bmp have a water set the corresponding pixel in gndtype.bmp to water (0) as well.
Artik, 101 "Red" Squadron, Israel

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: gndtype.bmp and waterd.bmp interaction
« Reply #10 on: October 24, 2013, 06:50:08 AM »
You seeing that in the res file or the Terrain editor? In the Terrain editor yes, you do see clutter and stuff pop out of water areas with land textures painted under them. You shouldn't see that though in the actual res file.

That said, we did find out when Karelia was built that having land textures under water significantly increased the overall size of the .res file.
X.O. 29th TFT, "We Move Mountains"
CM Terrain Team

Offline 715

  • Silver Member
  • ****
  • Posts: 1835
Re: gndtype.bmp and waterd.bmp interaction
« Reply #11 on: October 28, 2013, 03:36:46 PM »
Sorry to dredge this up again, but I'm dense and I didn't really understand the above.

I presume that under the deep ocean that the corresponding gndtype.bmp pixels should be 0 ("water").  Under the water near coastlines should the corresponding gndtype.bmp fat pixel that overlaps the water be 0 ("water") or "sand" etc?  And what should the gndtype.bmp pixel under rivers be, "water" or some land texture?  How does the render engine work?  If the waterd.bmp pixel says shallow water does that sub region of the underlying gndtype.bmp get rendered as the corresponding "under water" version of the ground texture?  In short, for rivers should I ever set gndtype.bmp to 0?

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: gndtype.bmp and waterd.bmp interaction
« Reply #12 on: November 01, 2013, 10:49:24 AM »
Okay waterd.bmp is 16384px by 16384px. As you know this is what tells the TE something is land or water (land is pure white and water pure black). Any shade of grey is still water but sets water depth. The only affect water depth has is to make water partially see through (depending on the depth) to see the texture underneath.

Now as for gndtype.bmp it is 4096px by 4096px. So 1 pixel here covers 4 pixels in the waterd.bmp file. Which results in in some textures being appliUNed to both land and water. Asd you say its a fat pixel where one texture can be applied to both land AND water. Say 1 pixel water and 3 pixels land, or 2 water and 2 land, or 3 water and 1 land. I you are working on a large map (256 or 512) you will go insane trying to get the textures in gndtype.bmp not to overlap water along on coastlines.

This is why HTC setup the dual texture system. Where you can have a water and land texture for each item in gndtype.bmp.  For example the you paint your shorelines as beach in the gndtype.bmp. The parts that overlap the land pixels in waterd.bmp use the ntt0010.bmp texture file. The parts that overlap the water pixels in waterd.bmp use the wntt0010.bmp files. However, if you look at the gndtype.bmp it is just the color for beach.

Now here is the rub. Not all texture types have a default water texture included in the TE for them. For example farm 1. So if you painted farm 1 along the coastlines what would happen is that you would see the farm texture on land and the farm texture under water also (if you had water depth set along the coastline). This is because there is no default wntt file for farmland. You would need to add one to your terrain for it not to show as farm land.

So think of each texture as a pair of textures one for land and one for water when water is present. The land one is used ONLY if you don't have a corresponding wntt file.

With all that said along coastlines I usually use the beach texture and not deep ocean. Along lakes I have at times used forest or grass write up to the late shore. Then I either make sure I have corresponding wntt files for grass and forest or I just don't set water depth at all on lakes. I usually never set water depth on rivers. Remember if there is no water depth (and water details is on) then the player will see water and you don't have to worry about a land textures bleeding into water.



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

Offline 715

  • Silver Member
  • ****
  • Posts: 1835
Re: gndtype.bmp and waterd.bmp interaction
« Reply #13 on: November 01, 2013, 02:43:04 PM »
Thanks.  That makes sense.  <S>