Update Citizen Assignment and ConsoleLauncher.kt (#12267)

* AI behaviour changes

* Update Automation.kt

* Update Automation.kt

* Update Automation.kt

* Update Automation.kt

* Update Automation.kt

* Update ConstructionAutomation.kt

* Update Automation.kt

* Reverting some changes

* Changes

* revert changes

* revert changes

* revert changes

* revert changes

* Update CityLocationTileRanker.kt

* Citizen assignment for stat conversion

* Update CityLocationTileRanker.kt

* Reduce AI settling

* Avoid AI building units when in negative Supply

* Update CityLocationTileRanker.kt

* Update CityLocationTileRanker.kt

* Update CityLocationTileRanker.kt

* Update ConstructionAutomation.kt

* Update build.gradle.kts

* Update gradle-wrapper.properties

* Update CityLocationTileRanker.kt

* Update CityLocationTileRanker.kt

* Update ConstructionAutomation.kt

* Update CityLocationTileRanker.kt

* AI changes for humans

* Fix puppet focus

* Update Automation.kt

* Puppet focus

* Update Automation.kt

* Update Automation.kt

* Update Automation.kt

* Update Automation.kt

* Update Automation.kt

* Update Automation.kt

* Update Automation.kt

* Update Automation.kt

* Update Automation.kt

* Update Stats.kt

* Update CityTurnManager.kt

* Remove specialist science modifier

* Update ReligionAutomation.kt

* Update ReligionAutomation.kt

* Update ReligionAutomation.kt

* Update CivilianUnitAutomation.kt

* Update ReligionAutomation.kt

* Worker prioritization

Workers are valuable in expand cities.

* Update ConstructionAutomation.kt

Food always important, it's rarely good to skip e.g. granary if we're on 6 pop.

* Update ConstructionAutomation.kt

Should achieve about the same with less lines of code.

* Update Automation.kt

* Update ConstructionAutomation.kt

* Update Policies.json

* Update Policies.json

* Update Policies.json

* Update ConstructionAutomation.kt

* Update Policies.json

* Update ReligionAutomation.kt

* Update ReligionAutomation.kt

* Update ReligionAutomation.kt

* Update ReligionAutomation.kt

* Rename Crop Yield to Growth

* Update worker usage

* Update UnitAutomation.kt

* Tutorials update

* Update Tutorials.json

* Fix spelling error

* Update Tutorials.json

* Update Tutorials.json

* Update Tutorials.json

* Update Tutorials.json

* Update Tutorials.json

* Update Tutorials.json

* Update Tutorials.json

* Update Tutorials.json

* AI tech and policy choices

* Update Techs.json

* Update Policies.json

* Update ConstructionAutomation.kt

* Update UnitPromotions.json

* Update

* Update Policies.json

* Update Tutorials.json

* ReligionAutomation bugfix

* Update ReligionAutomation.kt

* Update ReligionAutomation.kt

* Update ReligionAutomation.kt

* Update ReligionAutomation.kt

* Update ReligionAutomation.kt

* Update ReligionAutomation.kt

* Update ReligionAutomation.kt

* Update AI city settling and science game

* Update ReligionAutomation.kt

* Maybe revert this now the belief picking has improved

* Update ReligionAutomation.kt

* Remove some if-statements

* Update Automation.kt

* Update Automation.kt

* Update ConsoleLauncher.kt

* Update

* Update Automation.kt
This commit is contained in:
EmperorPinguin 2024-10-13 21:32:26 +02:00 committed by GitHub
parent d25a436391
commit 899c5d48ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 10 deletions

View File

@ -82,11 +82,11 @@ object Automation {
else if (city.civ.getHappiness() < 1)
yieldStats.food /= 4
} else if (!city.avoidGrowth) {
// NoFocus or Food/Growth Focus. Target +10 Food Surplus when happy
// NoFocus or Food/Growth Focus.
if (surplusFood < 0)
yieldStats.food *= 8 // Starving, need Food, get to 0
else if (surplusFood < 10 && city.civ.getHappiness() > -1)
yieldStats.food *= 2
else if (city.civ.getHappiness() > -1)
yieldStats.food *= 2 //1.5f is preferred, but 2 provides more protection against badly configured personalities
else if (city.civ.getHappiness() < 0) {
// 75% of excess food is wasted when in negative happiness
yieldStats.food /= 4

View File

@ -154,8 +154,6 @@ object CityLocationTileRanker {
var locationSpecificTileValue = 0f
// Don't settle near but not on the coast
if (rankTile.isCoastalTile() && !onCoast) locationSpecificTileValue -= 2
// Apply the effect of having a lighthouse, since we can probably assume that we will build it
if (onCoast && rankTile.isOcean) locationSpecificTileValue += 1.2f //food is ranked at 1.2 points
// Check if there are any new unique luxury resources
if (rankTile.resource != null && rankTile.tileResource.resourceType == ResourceType.Luxury
&& !(civ.hasResource(rankTile.resource!!) || newUniqueLuxuryResources.contains(rankTile.resource))) {
@ -168,8 +166,6 @@ object CityLocationTileRanker {
if (rankTile.getOwner() != null && rankTile.getOwner() != civ) return 0f
var rankTileValue = Automation.rankStatsValue(rankTile.stats.getTileStats(null, civ, uniqueCache), civ)
// We can't build improvements on water tiles without resources
if (!rankTile.isLand) rankTileValue -= 1
if (rankTile.resource != null) {
rankTileValue += when (rankTile.tileResource.resourceType) {

View File

@ -47,7 +47,8 @@ internal object ConsoleLauncher {
ruleset.nations[simulationCiv1] = Nation().apply { name = simulationCiv1 }
ruleset.nations[simulationCiv2] = Nation().apply { name = simulationCiv2 }
//These names need PascalCase if applied in-game for testing (e.g. if (civInfo.civName == "SimulationCiv2"))
val gameParameters = getGameParameters(simulationCiv1, simulationCiv2)
val mapParameters = getMapParameters()
val gameSetupInfo = GameSetupInfo(gameParameters, mapParameters)
@ -56,7 +57,8 @@ internal object ConsoleLauncher {
UncivGame.Current.gameInfo = newGame
val simulation = Simulation(newGame, 10, 4)
val simulation = Simulation(newGame, 50, 8)
//Unless the effect size is very large, you'll typically need a large number of games to get a statistically significant result
simulation.start()
}
@ -71,7 +73,8 @@ internal object ConsoleLauncher {
private fun getGameParameters(civilization1: String, civilization2: String): GameParameters {
return GameParameters().apply {
difficulty = "Chieftain"
difficulty = "Prince"
numberOfCityStates = 0
speed = Speed.DEFAULT
noBarbarians = true
players = ArrayList<Player>().apply {