diff --git a/android/assets/jsons/Civ V - Gods & Kings/Terrains.json b/android/assets/jsons/Civ V - Gods & Kings/Terrains.json index f79365381b..410ef250fc 100644 --- a/android/assets/jsons/Civ V - Gods & Kings/Terrains.json +++ b/android/assets/jsons/Civ V - Gods & Kings/Terrains.json @@ -15,34 +15,34 @@ "movementCost": 1, "RGB": [107,167,193], "uniques": ["[+2] to Fertility for Map Generation", - "Considered [Desirable] when determining start locations ", - "Every [60] tiles with this terrain will receive a major deposit of a strategic resource."] + "Considered [Desirable] when determining start locations ", + "Every [60] tiles with this terrain will receive a major deposit of a strategic resource."] }, { "name": "Grassland", "type": "Land", "food": 2, "movementCost": 1, - "RGB": [97,171,58], - "uniques": ["Occurs at temperature between [-0.4] and [0.1] and humidity between [0.2] and [0.4]", - "Occurs at temperature between [0.1] and [0.2] and humidity between [0.3] and [0.4]", - "Occurs at temperature between [-0.5] and [0.5] and humidity between [0.6] and [0.8]", - "Occurs at temperature between [-0.5] and [1] and humidity between [0.9] and [1]", - "Occurs at temperature between [0.9] and [1] and humidity between [0.2] and [0.9]", - "Occurs at temperature between [0.8] and [0.9] and humidity between [0.6] and [0.9]", - "Occurs at temperature between [0.7] and [0.8] and humidity between [0.7] and [0.9]", - "Occurs at temperature between [0.6] and [0.8] and humidity between [0.4] and [0.6]", - "[+3] to Fertility for Map Generation", - "A Region is formed with at least [30]% [Grassland] tiles, with priority [7]", - "A Region can not contain more [Plains] tiles than [Grassland] tiles", - "Considered [Desirable] when determining start locations", - "Considered [Food] when determining start locations ", - "Considered [Food] when determining start locations ", - "Considered [Food] when determining start locations ", - "Considered [Food] when determining start locations ", - "Considered [Food] when determining start locations ", - "Every [33] tiles with this terrain will receive a major deposit of a strategic resource."] - }, + "RGB": [97,171,58], + "uniques": ["Occurs at temperature between [-0.4] and [0.1] and humidity between [0.2] and [0.4]", + "Occurs at temperature between [0.1] and [0.2] and humidity between [0.3] and [0.4]", + "Occurs at temperature between [-0.5] and [0.5] and humidity between [0.6] and [0.8]", + "Occurs at temperature between [-0.5] and [1] and humidity between [0.9] and [1]", + "Occurs at temperature between [0.9] and [1] and humidity between [0.2] and [1]", + "Occurs at temperature between [0.8] and [0.9] and humidity between [0.6] and [1]", + "Occurs at temperature between [0.7] and [0.8] and humidity between [0.7] and [1]", + "Occurs at temperature between [0.6] and [0.8] and humidity between [0.4] and [0.6]", + "[+3] to Fertility for Map Generation", + "A Region is formed with at least [30]% [Grassland] tiles, with priority [7]", + "A Region can not contain more [Plains] tiles than [Grassland] tiles", + "Considered [Desirable] when determining start locations", + "Considered [Food] when determining start locations ", + "Considered [Food] when determining start locations ", + "Considered [Food] when determining start locations ", + "Considered [Food] when determining start locations ", + "Considered [Food] when determining start locations ", + "Every [33] tiles with this terrain will receive a major deposit of a strategic resource."] + }, { "name": "Plains", "type": "Land", @@ -51,26 +51,25 @@ "movementCost": 1, "RGB": [168,185,102], "uniques": ["Occurs at temperature between [-0.4] and [-0.1] and humidity between [0] and [0.2]", - "Occurs at temperature between [-0.4] and [0.4] and humidity between [0.4] and [0.6]", - "Occurs at temperature between [0.4] and [0.5] and humidity between [0.5] and [0.6]", - "Occurs at temperature between [-0.6] and [0.7] and humidity between [0.8] and [0.9]", - "Occurs at temperature between [-0.6] and [-0.5] and humidity between [0.9] and [1]", - "Occurs at temperature between [0.5] and [0.7] and humidity between [0.7] and [0.8]", - "Occurs at temperature between [0.9] and [1] and humidity between [0] and [0.2]", - "Occurs at temperature between [0.8] and [0.9] and humidity between [0.2] and [0.6]", - "Occurs at temperature between [0.7] and [0.8] and humidity between [0.3] and [0.4]", - "Occurs at temperature between [0.6] and [0.8] and humidity between [0.6] and [0.7]", - "Occurs at temperature between [0.5] and [0.7] and humidity between [0.7] and [0.8]", - "[+4] to Fertility for Map Generation", - "A Region is formed with at least [30]% [Plains] tiles, with priority [6]", - "A Region can not contain more [Grassland] tiles than [Plains] tiles", - "Considered [Desirable] when determining start locations", - "Considered [Food] when determining start locations ", - "Considered [Food] when determining start locations ", - "Considered [Food] when determining start locations ", - "Considered [Food] when determining start locations ", - "Considered [Food] when determining start locations ", - "Every [33] tiles with this terrain will receive a major deposit of a strategic resource."] + "Occurs at temperature between [-0.4] and [0.4] and humidity between [0.4] and [0.6]", + "Occurs at temperature between [0.4] and [0.5] and humidity between [0.5] and [0.6]", + "Occurs at temperature between [-0.6] and [0.7] and humidity between [0.8] and [0.9]", + "Occurs at temperature between [-0.6] and [-0.5] and humidity between [0.9] and [1]", + "Occurs at temperature between [0.9] and [1] and humidity between [0] and [0.2]", + "Occurs at temperature between [0.8] and [0.9] and humidity between [0.2] and [0.6]", + "Occurs at temperature between [0.7] and [0.8] and humidity between [0.3] and [0.4]", + "Occurs at temperature between [0.6] and [0.8] and humidity between [0.6] and [0.7]", + "Occurs at temperature between [0.5] and [0.7] and humidity between [0.7] and [0.8]", + "[+4] to Fertility for Map Generation", + "A Region is formed with at least [30]% [Plains] tiles, with priority [6]", + "A Region can not contain more [Grassland] tiles than [Plains] tiles", + "Considered [Desirable] when determining start locations", + "Considered [Food] when determining start locations ", + "Considered [Food] when determining start locations ", + "Considered [Food] when determining start locations ", + "Considered [Food] when determining start locations ", + "Considered [Food] when determining start locations ", + "Every [33] tiles with this terrain will receive a major deposit of a strategic resource."] }, { "name": "Tundra", @@ -79,16 +78,16 @@ "movementCost": 1, "RGB": [189,204,191], "uniques": ["Occurs at temperature between [-0.9] and [-0.6] and humidity between [0.8] and [1]", - "Occurs at temperature between [-0.8] and [-0.5] and humidity between [0.6] and [0.8]", - "Occurs at temperature between [-0.7] and [-0.4] and humidity between [0.4] and [0.6]", - "Occurs at temperature between [-0.6] and [-0.4] and humidity between [0.2] and [0.4]", - "Occurs at temperature between [-0.5] and [-0.4] and humidity between [0] and [0.2]", - "[+2] to Fertility for Map Generation", - "A Region is formed with at least [30]% [Tundra] tiles and [Snow] tiles, with priority [1]", - "Considered [Food] when determining start locations ", - "Considered [Desirable] when determining start locations ", - "Becomes [Plains] when adjacent to [River]", - "Every [16] tiles with this terrain will receive a major deposit of a strategic resource."] + "Occurs at temperature between [-0.8] and [-0.5] and humidity between [0.6] and [0.8]", + "Occurs at temperature between [-0.7] and [-0.4] and humidity between [0.4] and [0.6]", + "Occurs at temperature between [-0.6] and [-0.4] and humidity between [0.2] and [0.4]", + "Occurs at temperature between [-0.5] and [-0.4] and humidity between [0] and [0.2]", + "[+2] to Fertility for Map Generation", + "A Region is formed with at least [30]% [Tundra] tiles and [Snow] tiles, with priority [1]", + "Considered [Food] when determining start locations ", + "Considered [Desirable] when determining start locations ", + "Becomes [Plains] when adjacent to [River]", + "Every [16] tiles with this terrain will receive a major deposit of a strategic resource."] }, { "name": "Desert", @@ -96,15 +95,15 @@ "movementCost": 1, "RGB": [ 230, 230, 113], "uniques": ["Occurs at temperature between [-0.1] and [0.9] and humidity between [0] and [0.2]", - "Occurs at temperature between [0.1] and [0.8] and humidity between [0.2] and [0.3]", - "Occurs at temperature between [0.2] and [0.7] and humidity between [0.3] and [0.4]", - "Occurs at temperature between [0.4] and [0.6] and humidity between [0.4] and [0.5]", - "Occurs at temperature between [0.5] and [0.6] and humidity between [0.5] and [0.7]", - "[+1] to Fertility for Map Generation", - "A Region is formed with at least [25]% [Desert] tiles, with priority [4]", - "Becomes [Flood plains] when adjacent to [River]", - "Considered [Undesirable] when determining start locations ", - "Every [13] tiles with this terrain will receive a major deposit of a strategic resource."] + "Occurs at temperature between [0.1] and [0.8] and humidity between [0.2] and [0.3]", + "Occurs at temperature between [0.2] and [0.7] and humidity between [0.3] and [0.4]", + "Occurs at temperature between [0.4] and [0.6] and humidity between [0.4] and [0.5]", + "Occurs at temperature between [0.5] and [0.6] and humidity between [0.5] and [0.7]", + "[+1] to Fertility for Map Generation", + "A Region is formed with at least [25]% [Desert] tiles, with priority [4]", + "Becomes [Flood plains] when adjacent to [River]", + "Considered [Undesirable] when determining start locations ", + "Every [13] tiles with this terrain will receive a major deposit of a strategic resource."] }, { "name": "Lakes", @@ -123,27 +122,28 @@ "defenceBonus": 0.25, "RGB": [120, 120, 120], "uniques": ["Rough terrain", - "Has an elevation of [4] for visibility calculations", - "Occurs in chains at high elevations", - "Units ending their turn on this terrain take [50] damage", - "Always Fertility [-2] for Map Generation", - "Considered [Undesirable] when determining start locations"] + "Has an elevation of [4] for visibility calculations", + "Occurs in chains at high elevations", + "Units ending their turn on this terrain take [50] damage", + "Always Fertility [-2] for Map Generation", + "Considered [Undesirable] when determining start locations"] }, { "name": "Snow", "type": "Land", "movementCost": 1, "RGB": [231, 242, 249], - "uniques": ["Occurs at temperature between [-1] and [-0.9] and humidity between [0] and [1]", - "Occurs at temperature between [-0.9] and [-0.8] and humidity between [0] and [0.8]", - "Occurs at temperature between [-0.8] and [-0.7] and humidity between [0] and [0.6]", - "Occurs at temperature between [-0.7] and [-0.6] and humidity between [0] and [0.4]", - "Occurs at temperature between [-0.6] and [-0.5] and humidity between [0] and [0.2]", - "Always Fertility [-1] for Map Generation", - "Considered [Undesirable] when determining start locations", - "Becomes [Tundra] when adjacent to [River]", - "Every [17] tiles with this terrain will receive a major deposit of a strategic resource.", - "Never receives any resources "] + "uniques": [ + "Occurs at temperature between [-1] and [-0.9] and humidity between [0] and [1]", + "Occurs at temperature between [-0.9] and [-0.8] and humidity between [0] and [0.8]", + "Occurs at temperature between [-0.8] and [-0.7] and humidity between [0] and [0.6]", + "Occurs at temperature between [-0.7] and [-0.6] and humidity between [0] and [0.4]", + "Occurs at temperature between [-0.6] and [-0.5] and humidity between [0] and [0.2]", + "Always Fertility [-1] for Map Generation", + "Considered [Undesirable] when determining start locations", + "Becomes [Tundra] when adjacent to [River]", + "Every [17] tiles with this terrain will receive a major deposit of a strategic resource.", + "Never receives any resources "] }, // Terrain features diff --git a/android/assets/jsons/Civ V - Vanilla/Terrains.json b/android/assets/jsons/Civ V - Vanilla/Terrains.json index ecc4290aad..1a01903214 100644 --- a/android/assets/jsons/Civ V - Vanilla/Terrains.json +++ b/android/assets/jsons/Civ V - Vanilla/Terrains.json @@ -28,9 +28,9 @@ "Occurs at temperature between [0.1] and [0.2] and humidity between [0.3] and [0.4]", "Occurs at temperature between [-0.5] and [0.5] and humidity between [0.6] and [0.8]", "Occurs at temperature between [-0.5] and [1] and humidity between [0.9] and [1]", - "Occurs at temperature between [0.9] and [1] and humidity between [0.2] and [0.9]", - "Occurs at temperature between [0.8] and [0.9] and humidity between [0.6] and [0.9]", - "Occurs at temperature between [0.7] and [0.8] and humidity between [0.7] and [0.9]", + "Occurs at temperature between [0.9] and [1] and humidity between [0.2] and [1]", + "Occurs at temperature between [0.8] and [0.9] and humidity between [0.6] and [1]", + "Occurs at temperature between [0.7] and [0.8] and humidity between [0.7] and [1]", "Occurs at temperature between [0.6] and [0.8] and humidity between [0.4] and [0.6]", "[+3] to Fertility for Map Generation", "A Region is formed with at least [30]% [Grassland] tiles, with priority [7]", @@ -55,7 +55,6 @@ "Occurs at temperature between [0.4] and [0.5] and humidity between [0.5] and [0.6]", "Occurs at temperature between [-0.6] and [0.7] and humidity between [0.8] and [0.9]", "Occurs at temperature between [-0.6] and [-0.5] and humidity between [0.9] and [1]", - "Occurs at temperature between [0.5] and [0.7] and humidity between [0.7] and [0.8]", "Occurs at temperature between [0.9] and [1] and humidity between [0] and [0.2]", "Occurs at temperature between [0.8] and [0.9] and humidity between [0.2] and [0.6]", "Occurs at temperature between [0.7] and [0.8] and humidity between [0.3] and [0.4]", diff --git a/core/src/com/unciv/logic/map/MapParameters.kt b/core/src/com/unciv/logic/map/MapParameters.kt index 1205a14f82..4a249ebc46 100644 --- a/core/src/com/unciv/logic/map/MapParameters.kt +++ b/core/src/com/unciv/logic/map/MapParameters.kt @@ -180,9 +180,7 @@ class MapParameters : IsPartOfGameInfoSerialization { var resourceRichness = 0.1f var waterThreshold = 0.0f - /** Shifts temperature (after random, latitude and temperatureExtremeness). - * For seasonal main menu background only, not user-accessible, thus transient and not cloned. */ - @Transient + /** Shifts temperature (after random, latitude and temperatureExtremeness).*/ var temperatureShift = 0f fun clone() = MapParameters().also { @@ -201,6 +199,7 @@ class MapParameters : IsPartOfGameInfoSerialization { it.maxCoastExtension = maxCoastExtension it.elevationExponent = elevationExponent it.temperatureExtremeness = temperatureExtremeness + it.temperatureShift = temperatureShift it.vegetationRichness = vegetationRichness it.rareFeaturesRichness = rareFeaturesRichness it.resourceRichness = resourceRichness @@ -218,6 +217,7 @@ class MapParameters : IsPartOfGameInfoSerialization { maxCoastExtension = 2 elevationExponent = 0.7f temperatureExtremeness = 0.6f + temperatureShift = 0.0f vegetationRichness = 0.4f rareFeaturesRichness = 0.05f resourceRichness = 0.1f diff --git a/core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt b/core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt index 874dd5d274..38d69f2971 100644 --- a/core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt +++ b/core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt @@ -484,7 +484,7 @@ class MapGenerator(val ruleset: Ruleset) { val scale = tileMap.mapParameters.tilesPerBiomeArea.toDouble() val temperatureExtremeness = tileMap.mapParameters.temperatureExtremeness val temperatureShift = tileMap.mapParameters.temperatureShift - val humidityShift = if (temperatureShift > 0) -temperatureShift else 0f + val humidityShift = if (temperatureShift > 0) -temperatureShift / 2 else 0f // List is OK here as it's only sequentially scanned val limitsMap: List = @@ -608,6 +608,7 @@ class MapGenerator(val ruleset: Ruleset) { val latitudeTemperature = 1.0 - 2.0 * abs(tile.latitude) / tileMap.maxLatitude var temperature = ((latitudeTemperature + randomTemperature) / 2.0) temperature = abs(temperature).pow(1.0 - tileMap.mapParameters.temperatureExtremeness) * temperature.sign + temperature = (temperature + tileMap.mapParameters.temperatureShift).coerceIn(-1.0..1.0) val candidates = iceEquivalents .filter { @@ -631,6 +632,8 @@ class MapGenerationRandomness { /** * Generates a perlin noise channel combining multiple octaves + * Default settings generate mostly within [-0.55, 0.55], but clustered around 0.0 + * About 28% are < -0.1 and 28% are > 0.1 * * @param tile Source for x / x coordinates. * @param seed Misnomer: actually the z value the Perlin cloud is 'cut' on. diff --git a/core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt b/core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt index a961743df5..bdc81ef14d 100644 --- a/core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt +++ b/core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt @@ -203,7 +203,7 @@ class MapLandmassGenerator(val ruleset: Ruleset, val randomness: MapGenerationRa waterThreshold = 0.545 + 1.75 * waterThreshold for (tile in tileMap.values) { - spawnLandOrWater(tile, randomness.RNG.nextDouble()) + spawnLandOrWater(tile, randomness.RNG.nextDouble()) // RNG is [0.0, 1.0] tile.setTransients() } diff --git a/core/src/com/unciv/ui/mapeditor/MapGeneratorSteps.kt b/core/src/com/unciv/ui/mapeditor/MapGeneratorSteps.kt index 86d01af49b..c40e483a66 100644 --- a/core/src/com/unciv/ui/mapeditor/MapGeneratorSteps.kt +++ b/core/src/com/unciv/ui/mapeditor/MapGeneratorSteps.kt @@ -13,6 +13,7 @@ private object MapGeneratorStepsHelpers { } val applyHumidityAndTemperature = fun(newParameters: MapParameters, actualParameters: MapParameters) { actualParameters.temperatureExtremeness = newParameters.temperatureExtremeness + actualParameters.temperatureShift = newParameters.temperatureShift } val applyLakesAndCoast = fun(newParameters: MapParameters, actualParameters: MapParameters) { actualParameters.maxCoastExtension = newParameters.maxCoastExtension diff --git a/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt b/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt index 5bb77601e2..1171dbe751 100644 --- a/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt @@ -276,12 +276,23 @@ class MapParametersTable( return slider } + fun addSlider(text: String, getValue:()->Float, min: Float, max: Float, step: Float, onChange: (value: Float)->Unit): UncivSlider { + val slider = UncivSlider(min, max, step, onChange = onChange, initial = getValue()) + table.add(text.toLabel()).left() + table.add(slider).fillX().row() + advancedSliders[slider] = getValue + return slider + } + addSlider("Map Elevation", {mapParameters.elevationExponent}, 0.6f, 0.8f) { mapParameters.elevationExponent = it } addSlider("Temperature extremeness", {mapParameters.temperatureExtremeness}, 0.4f, 0.8f) { mapParameters.temperatureExtremeness = it } + addSlider("Temperature shift", {mapParameters.temperatureShift}, -0.4f, 0.4f, 0.1f) + { mapParameters.temperatureShift = it } + addSlider("Resource richness", {mapParameters.resourceRichness},0f, 0.5f) { mapParameters.resourceRichness = it }