diff --git a/core/src/com/unciv/logic/GameStarter.kt b/core/src/com/unciv/logic/GameStarter.kt index faeb24f92f..f56241aa52 100644 --- a/core/src/com/unciv/logic/GameStarter.kt +++ b/core/src/com/unciv/logic/GameStarter.kt @@ -349,7 +349,12 @@ object GameStarter { .map { it.key } .filter { it in usedCivNames } - for (player in chosenPlayers) { + val playersToAdd = if (newGameParameters.shufflePlayerOrder) { + chosenPlayers.toMutableList().apply { shuffle() } + } else { + chosenPlayers + } + for (player in playersToAdd) { val civ = Civilization(player.chosenCiv) when (player.chosenCiv) { in usedMajorCivs, Constants.spectator -> { diff --git a/core/src/com/unciv/models/metadata/GameParameters.kt b/core/src/com/unciv/models/metadata/GameParameters.kt index 429f78fc09..67cdbda847 100644 --- a/core/src/com/unciv/models/metadata/GameParameters.kt +++ b/core/src/com/unciv/models/metadata/GameParameters.kt @@ -31,6 +31,7 @@ class GameParameters : IsPartOfGameInfoSerialization { // Default values are the var nuclearWeaponsEnabled = true var espionageEnabled = false var noStartBias = false + var shufflePlayerOrder = false var victoryTypes: ArrayList<String> = arrayListOf() var startingEra = "Ancient era" @@ -71,6 +72,7 @@ class GameParameters : IsPartOfGameInfoSerialization { // Default values are the parameters.nuclearWeaponsEnabled = nuclearWeaponsEnabled parameters.espionageEnabled = espionageEnabled parameters.noStartBias = noStartBias + parameters.shufflePlayerOrder = shufflePlayerOrder parameters.victoryTypes = ArrayList(victoryTypes) parameters.startingEra = startingEra parameters.isOnlineMultiplayer = isOnlineMultiplayer diff --git a/desktop/src/com/unciv/app/desktop/ConsoleLauncher.kt b/desktop/src/com/unciv/app/desktop/ConsoleLauncher.kt index a751ae3dae..cd10770761 100644 --- a/desktop/src/com/unciv/app/desktop/ConsoleLauncher.kt +++ b/desktop/src/com/unciv/app/desktop/ConsoleLauncher.kt @@ -79,6 +79,7 @@ internal object ConsoleLauncher { numberOfCityStates = 0 speed = Speed.DEFAULT noBarbarians = true + shufflePlayerOrder = true players = ArrayList<Player>().apply { civilizations.forEach { add(Player(it)) } add(Player(Constants.spectator, PlayerType.Human))