mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-21 21:30:20 +07:00
Resolved #778 - AI construction would generate too many workers late-game
This commit is contained in:
@ -12,6 +12,7 @@ import com.unciv.models.gamebasics.unit.UnitType
|
|||||||
import com.unciv.models.stats.Stat
|
import com.unciv.models.stats.Stat
|
||||||
import com.unciv.models.stats.Stats
|
import com.unciv.models.stats.Stats
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
|
import kotlin.math.min
|
||||||
import kotlin.math.sqrt
|
import kotlin.math.sqrt
|
||||||
|
|
||||||
class Automation {
|
class Automation {
|
||||||
@ -159,8 +160,9 @@ class Automation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//worker
|
//worker
|
||||||
if (workers < cities * 0.6f) {
|
val citiesCountedTowardsWorkers = min(5, cities) // above 5 cities, extra cities won't make us want more workers - see #
|
||||||
relativeCostEffectiveness.add(ConstructionChoice(Constants.worker,cities.toFloat()/(workers+0.1f)))
|
if (workers < citiesCountedTowardsWorkers * 0.6f) {
|
||||||
|
relativeCostEffectiveness.add(ConstructionChoice(Constants.worker,citiesCountedTowardsWorkers/(workers+0.1f)))
|
||||||
}
|
}
|
||||||
|
|
||||||
//Work boat
|
//Work boat
|
||||||
|
Reference in New Issue
Block a user