Damocles, can you give me a breakdown of how water.xml works? I just can't seem to "get it", and I figure that since you coded something to write them, you understand it.
This is for an 8k map:
<Water pos="-4064,33,-4064" minx="-4096" maxx="4096" minz="-4096" maxz="4096"/>
...so I figure the -4064,33,-4064 is the lower left corner of the map (well, padded in a small 32 border) and the water level is going to be 33 high for 4096 blocks to the east and 4096 blocks to the west.
Applying THAT logic, I can't get custom areas to work.
What are the tricks/limitations/etc? Thanks!
the water position will go from -1/2 the map-size to +1/2 the map size
so on a 4096*4096 map, a position of 0,0 will be right in the center, and -2047,2047 on the bottom left corner
(south-west)
The z-hight is just the blockhight above zero (lowest bedrock) level.
The generator will spawn waternodes in an even grid, with nodes 64 spawned tiles apart, to try an fill in all sub-waterlevel areas.
The game will then "floodfill" starting from the nodes center until it reaches terrain above the z-hight or the maxx etc position (kept really big here for simplicity), and create the local water--voxels.
This works most of the time, but could "miss" to place a node in narrow canyons and channels (when narrower than 64 meters). I could increase the density of the nodes, but that might cause performance issues during the games initial map creation at one point.
You could delete all the water-spawners after the "<!-- spawners for large lakes -->" comment in the xml,
and then handplace the water spawners (one for each large lake or river to fill up). The positions can be determined by the pixel position (for x and y you have to shift the pixelpoisiton by half the maps size)
The bug with the empty-gap inside of bodies of water is probably some bug in the games floodfill algorithm, and seem to appear near shallow costlines.
Othe bugs can happen when there are road-splatmap pixels inside water. It will then keep the road free of water (probably a fix for some issue in the RWG or limit with the terrain-shaders)