Fixed AI religion belief assessment (far too much weight given to tiles)

This commit is contained in:
yairm210 2024-12-10 23:10:11 +02:00
parent a9908e877c
commit cf4fd63959

View File

@ -208,15 +208,15 @@ object ReligionAutomation {
// region rate beliefs
fun rateBelief(civInfo: Civilization, belief: Belief): Float {
var score = 0f
var score = 0f // Roughly equivalent to the sum of stats gained across all cities
for (city in civInfo.cities) {
for (tile in city.getCenterTile().getTilesInDistance(city.getWorkRange())) {
val tileScore = beliefBonusForTile(belief, tile, city)
score += tileScore * when {
city.workedTiles.contains(tile.position) -> 8
tile.getCity() == city -> 5
else -> 3
city.workedTiles.contains(tile.position) -> 1f // worked
tile.getCity() == city -> 0.7f // workable
else -> 0.3f // unavailable
} * (Random.nextFloat() * 0.05f + 0.975f)
}