mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-26 07:39:44 +07:00
Returned Perlin map type
This commit is contained in:
@ -335,6 +335,7 @@ Three Continents =
|
|||||||
Four Corners =
|
Four Corners =
|
||||||
Archipelago =
|
Archipelago =
|
||||||
Inner Sea =
|
Inner Sea =
|
||||||
|
Perlin =
|
||||||
Random number of Civilizations =
|
Random number of Civilizations =
|
||||||
Min number of Civilizations =
|
Min number of Civilizations =
|
||||||
Max number of Civilizations =
|
Max number of Civilizations =
|
||||||
|
@ -138,7 +138,7 @@ object MapGeneratedMainType : IsPartOfGameInfoSerialization {
|
|||||||
}
|
}
|
||||||
|
|
||||||
object MapType : IsPartOfGameInfoSerialization {
|
object MapType : IsPartOfGameInfoSerialization {
|
||||||
const val default = "Default"
|
const val perlin = "Perlin"
|
||||||
const val pangaea = "Pangaea"
|
const val pangaea = "Pangaea"
|
||||||
const val continentAndIslands = "Continent and Islands"
|
const val continentAndIslands = "Continent and Islands"
|
||||||
const val twoContinents = "Two Continents"
|
const val twoContinents = "Two Continents"
|
||||||
|
@ -50,7 +50,7 @@ class MapLandmassGenerator(val ruleset: Ruleset, val randomness: MapGenerationRa
|
|||||||
MapType.threeContinents -> createThreeContinents(tileMap)
|
MapType.threeContinents -> createThreeContinents(tileMap)
|
||||||
MapType.fourCorners -> createFourCorners(tileMap)
|
MapType.fourCorners -> createFourCorners(tileMap)
|
||||||
MapType.archipelago -> createArchipelago(tileMap)
|
MapType.archipelago -> createArchipelago(tileMap)
|
||||||
MapType.default -> createPerlin(tileMap)
|
MapType.perlin -> createPerlin(tileMap)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tileMap.mapParameters.shape === MapShape.flatEarth) {
|
if (tileMap.mapParameters.shape === MapShape.flatEarth) {
|
||||||
@ -98,7 +98,6 @@ class MapLandmassGenerator(val ruleset: Ruleset, val randomness: MapGenerationRa
|
|||||||
|
|
||||||
private fun createArchipelago(tileMap: TileMap) {
|
private fun createArchipelago(tileMap: TileMap) {
|
||||||
val elevationSeed = randomness.RNG.nextInt().toDouble()
|
val elevationSeed = randomness.RNG.nextInt().toDouble()
|
||||||
waterThreshold += 0.25
|
|
||||||
for (tile in tileMap.values) {
|
for (tile in tileMap.values) {
|
||||||
val elevation = getRidgedPerlinNoise(tile, elevationSeed)
|
val elevation = getRidgedPerlinNoise(tile, elevationSeed)
|
||||||
spawnLandOrWater(tile, elevation)
|
spawnLandOrWater(tile, elevation)
|
||||||
@ -319,7 +318,7 @@ class MapLandmassGenerator(val ruleset: Ruleset, val randomness: MapGenerationRa
|
|||||||
nOctaves: Int = 10,
|
nOctaves: Int = 10,
|
||||||
persistence: Double = 0.5,
|
persistence: Double = 0.5,
|
||||||
lacunarity: Double = 2.0,
|
lacunarity: Double = 2.0,
|
||||||
scale: Double = 15.0): Double {
|
scale: Double = 10.0): Double {
|
||||||
val worldCoords = HexMath.hex2WorldCoords(tile.position)
|
val worldCoords = HexMath.hex2WorldCoords(tile.position)
|
||||||
return Perlin.ridgedNoise3d(worldCoords.x.toDouble(), worldCoords.y.toDouble(), seed, nOctaves, persistence, lacunarity, scale)
|
return Perlin.ridgedNoise3d(worldCoords.x.toDouble(), worldCoords.y.toDouble(), seed, nOctaves, persistence, lacunarity, scale)
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,6 @@ import com.unciv.logic.map.MapSize
|
|||||||
import com.unciv.logic.map.MapSizeNew
|
import com.unciv.logic.map.MapSizeNew
|
||||||
import com.unciv.logic.map.MapType
|
import com.unciv.logic.map.MapType
|
||||||
import com.unciv.logic.map.mapgenerator.MapGenerationRandomness
|
import com.unciv.logic.map.mapgenerator.MapGenerationRandomness
|
||||||
import com.unciv.ui.screens.basescreen.BaseScreen
|
|
||||||
import com.unciv.ui.components.ExpanderTab
|
import com.unciv.ui.components.ExpanderTab
|
||||||
import com.unciv.ui.components.UncivSlider
|
import com.unciv.ui.components.UncivSlider
|
||||||
import com.unciv.ui.components.UncivTextField
|
import com.unciv.ui.components.UncivTextField
|
||||||
@ -23,6 +22,7 @@ import com.unciv.ui.components.extensions.pad
|
|||||||
import com.unciv.ui.components.extensions.toCheckBox
|
import com.unciv.ui.components.extensions.toCheckBox
|
||||||
import com.unciv.ui.components.extensions.toLabel
|
import com.unciv.ui.components.extensions.toLabel
|
||||||
import com.unciv.ui.components.extensions.toTextButton
|
import com.unciv.ui.components.extensions.toTextButton
|
||||||
|
import com.unciv.ui.screens.basescreen.BaseScreen
|
||||||
|
|
||||||
/** Table for editing [mapParameters]
|
/** Table for editing [mapParameters]
|
||||||
*
|
*
|
||||||
@ -132,6 +132,7 @@ class MapParametersTable(
|
|||||||
MapType.fourCorners,
|
MapType.fourCorners,
|
||||||
MapType.archipelago,
|
MapType.archipelago,
|
||||||
MapType.innerSea,
|
MapType.innerSea,
|
||||||
|
MapType.perlin,
|
||||||
if (forMapEditor && mapGeneratedMainType != MapGeneratedMainType.randomGenerated) MapType.empty else null
|
if (forMapEditor && mapGeneratedMainType != MapGeneratedMainType.randomGenerated) MapType.empty else null
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user