Update wrap water generation of two continents to support tall maps. (#8192)

This commit is contained in:
Philip Keiter
2022-12-21 03:27:01 -06:00
committed by GitHub
parent 1346eea4ca
commit 47c21216b2

View File

@ -246,14 +246,14 @@ class MapLandmassGenerator(val ruleset: Ruleset, val randomness: MapGenerationRa
val latitudeFactor = abs(tileInfo.latitude) / tileMap.maxLatitude
var longitudeFactor = abs(tileInfo.longitude) / tileMap.maxLongitude
var factor = if (isLatitude) latitudeFactor else longitudeFactor
// If this is a world wrap, we want it to be separated on both sides -
// so we make the actual strip of water thinner, but we put it both in the middle of the map and on the edges of the map
if (tileMap.mapParameters.worldWrap)
longitudeFactor = min(longitudeFactor,
factor = min(longitudeFactor,
(tileMap.maxLongitude - abs(tileInfo.longitude)) / tileMap.maxLongitude) * 1.5f
val factor = if (isLatitude) latitudeFactor else longitudeFactor
// there's nothing magical about this, it's just what we got from playing around with a lot of different options -
// the numbers can be changed if you find that something else creates better looking continents
return min(0.2, -1.0 + (5.0 * factor.pow(0.6f) + randomScale) / 3.0)