From 63d40e3f8ac5795be4a4993a586056d04df6d825 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Thu, 19 Jan 2023 23:39:02 +0200 Subject: [PATCH] Better 4-corner maps --- .../com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt b/core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt index 471728f737..ac7430ee19 100644 --- a/core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt +++ b/core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt @@ -3,14 +3,15 @@ package com.unciv.logic.map.mapgenerator import com.unciv.logic.map.HexMath import com.unciv.logic.map.MapShape import com.unciv.logic.map.MapType -import com.unciv.logic.map.tile.TileInfo import com.unciv.logic.map.TileMap +import com.unciv.logic.map.tile.TileInfo import com.unciv.models.ruleset.Ruleset import com.unciv.models.ruleset.tile.TerrainType import kotlin.math.abs import kotlin.math.max import kotlin.math.min import kotlin.math.pow +import kotlin.math.sqrt class MapLandmassGenerator(val ruleset: Ruleset, val randomness: MapGenerationRandomness) { //region _Fields @@ -286,7 +287,7 @@ class MapLandmassGenerator(val ruleset: Ruleset, val randomness: MapGenerationRa val longitudeFactor = abs(tileInfo.longitude) / tileMap.maxLongitude val latitudeFactor = abs(tileInfo.latitude) / tileMap.maxLatitude - var factor = min(longitudeFactor, latitudeFactor) + var factor = sqrt(longitudeFactor * latitudeFactor) /1.5f // 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