I've been struggling to understand exactly how water effects are controlled in map construction; so in order to get my head around it, I've spent the past two days experimenting. I created from scratch, a very small test map 640x384 pixels consisting of a simple rectangle to represent the land, bordered on two sides by ocean. I then created 512x512 tiles (filled with primary colours so that I could see exactly what was happening), which I assigned to the four water entries under the [FIELDS] category in the load.ini.
The following are my observations and findings from my testing:
Water0, Water1, Water2 & Water3 are simply texture slots and have no bearing on the representation or colour of water.
(Presumably the names are historical and were originally used for land textures that abutted actual water features, whether sea, rivers, lakes or reservoirs?)
The greyscale values that represent the above in map_T and their corresponding tile names in FMB are:
Water0 : greyscale 28 in map_T = WATER tile in FMB
Water1 : greyscale 29 in map_T
Water2 : greyscale 30 in map_T = CoastRiver tile in FMB
Water3 : greyscale 31 in map_T = CoastSea tile in FMB
Water1 appears to be an exception in that it has no corresponding tile name in FMB and so can only be applied by 'painting' the greyscale value directly onto map_T ... is there a way that a tile name could be assigned to this (e.g. CoastLake, perhaps), so that it could be used when 'painting' textures in FMB?
The only way to show actual water is via map_c - the base colour being defined by the entry under [WATER] in load.ini, being either the colour of a .tga file or a value given by:
WaterColorATI = R/255 G/255 B/255
WaterColorNV = R/255 G/255 B/255
- where R, G & B are the actual RGB colour values; so when each is divided by 255, they will give decimal values, e.g.
WaterColorATI = 0.596 0.501 0.439
WaterColorNV = 0.596 0.501 0.439
would be the decimal values corresponding to a muddy brown colour having approximate RGB 152,128,112
The saturation of the water colour relates to the water depth and is defined by the greyscale value in map_c. To evaluate the effects of this, I made a rectangular selection across my test sample of MYmap_c and filled it with a gradient-fill, from pure black to pure white. On loading the map into FMB, this showed that:
Deep water will have low colour saturation and a corresponding low greyscale value. As the greyscale value rises, the colour saturation increases, giving the appearance of increasingly shallow water. At a greyscale value of approximately 88, surf lines begin to appear, becoming progessively stronger to 140, then fading out at approximately 148, although some water texture effect remains visible up to around 168.
The length of the surf lines can be controlled by adjusting the steepness of the curve of greyscale values above 88, i.e. compressing the range of values will shorten the lines.
Any greyscale value in map_c below 127 will show as water, overriding any value in map_T, however for values between 128 and 168, any underlying texture in map_T will show through, which can lead to some interesting texture effects. Any value above 168 in map_c, is treated as white and will be regarded as land.
I would really appreciate confirmation or correction of my conclusions above, from those more experienced and knowlegable in such matters.
Many thanks,
Terry