diff --git a/android/assets/jsons/translations/template.properties b/android/assets/jsons/translations/template.properties index 9883c90384..906dfadc89 100644 --- a/android/assets/jsons/translations/template.properties +++ b/android/assets/jsons/translations/template.properties @@ -320,6 +320,7 @@ Perlin = Continents = Four Corners = Archipelago = +Inner Sea = Number of City-States = One City Challenge = No Barbarians = diff --git a/core/src/com/unciv/logic/map/MapParameters.kt b/core/src/com/unciv/logic/map/MapParameters.kt index fa3b7f2348..f573c257c5 100644 --- a/core/src/com/unciv/logic/map/MapParameters.kt +++ b/core/src/com/unciv/logic/map/MapParameters.kt @@ -117,6 +117,7 @@ object MapType { const val fourCorners = "Four Corners" const val perlin = "Perlin" const val archipelago = "Archipelago" + const val innerSea = "Inner Sea" // Cellular automata const val default = "Default" diff --git a/core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt b/core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt index a9a68efb3f..70f8cdcc90 100644 --- a/core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt +++ b/core/src/com/unciv/logic/map/mapgenerator/MapLandmassGenerator.kt @@ -20,7 +20,8 @@ class MapLandmassGenerator(val ruleset: Ruleset, val randomness: MapGenerationRa } when (tileMap.mapParameters.type) { - MapType.pangaea -> createPangea(tileMap) + MapType.pangaea -> createPangaea(tileMap) + MapType.innerSea -> createInnerSea(tileMap) MapType.continents -> createTwoContinents(tileMap) MapType.fourCorners -> createFourCorners(tileMap) MapType.perlin -> createPerlin(tileMap) @@ -70,7 +71,7 @@ class MapLandmassGenerator(val ruleset: Ruleset, val randomness: MapGenerationRa } } - private fun createPangea(tileMap: TileMap) { + private fun createPangaea(tileMap: TileMap) { val elevationSeed = randomness.RNG.nextInt().toDouble() for (tile in tileMap.values) { var elevation = randomness.getPerlinNoise(tile, elevationSeed) @@ -79,6 +80,15 @@ class MapLandmassGenerator(val ruleset: Ruleset, val randomness: MapGenerationRa } } + private fun createInnerSea(tileMap: TileMap) { + val elevationSeed = randomness.RNG.nextInt().toDouble() + for (tile in tileMap.values) { + var elevation = randomness.getPerlinNoise(tile, elevationSeed) + elevation -= getEllipticContinent(tile, tileMap, 0.6) * 0.3 + spawnLandOrWater(tile, elevation, tileMap.mapParameters.waterThreshold.toDouble()) + } + } + private fun createTwoContinents(tileMap: TileMap) { val elevationSeed = randomness.RNG.nextInt().toDouble() for (tile in tileMap.values) { @@ -101,9 +111,9 @@ class MapLandmassGenerator(val ruleset: Ruleset, val randomness: MapGenerationRa * Create an elevation map that favors a central elliptic continent spanning over 85% - 95% of * the map size. */ - private fun getEllipticContinent(tileInfo: TileInfo, tileMap: TileMap): Double { + private fun getEllipticContinent(tileInfo: TileInfo, tileMap: TileMap, percentOfMap: Double = 0.85): Double { val randomScale = randomness.RNG.nextDouble() - val ratio = 0.85 + 0.1 * randomness.RNG.nextDouble() + val ratio = percentOfMap + 0.1 * randomness.RNG.nextDouble() val a = ratio * tileMap.maxLongitude val b = ratio * tileMap.maxLatitude diff --git a/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt b/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt index 27067635ba..4d4fe6e358 100644 --- a/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt @@ -76,6 +76,7 @@ class MapParametersTable( MapType.fourCorners, MapType.perlin, MapType.archipelago, + MapType.innerSea, if (isEmptyMapAllowed) MapType.empty else null )