Resolved #778 - AI construction would generate too many workers late-game

This commit is contained in:
Yair Morgenstern 2019-05-18 23:30:52 +03:00
parent 081ed9dc4a
commit 20450250bd

View file

@ -12,6 +12,7 @@ import com.unciv.models.gamebasics.unit.UnitType
import com.unciv.models.stats.Stat
import com.unciv.models.stats.Stats
import kotlin.math.max
import kotlin.math.min
import kotlin.math.sqrt
class Automation {
@ -159,8 +160,9 @@ class Automation {
}
//worker
if (workers < cities * 0.6f) {
relativeCostEffectiveness.add(ConstructionChoice(Constants.worker,cities.toFloat()/(workers+0.1f)))
val citiesCountedTowardsWorkers = min(5, cities) // above 5 cities, extra cities won't make us want more workers - see #
if (workers < citiesCountedTowardsWorkers * 0.6f) {
relativeCostEffectiveness.add(ConstructionChoice(Constants.worker,citiesCountedTowardsWorkers/(workers+0.1f)))
}
//Work boat