Killtech
Discutator
ok, i've checked several AI cities in a game and i have to say it's a disaster. the AI is totally unable to cope with the many many new buildings in RoM and AND and it is one source of the AIs complete failure at being a worthy opponent. when i just compare the total production modifiers of my and their down there's a horrific gap: their cities are about +15% to +40% at best while i'm at +115% in nearly every city! considering the poor choices of improvements for the city tiles my cities outproduce theirs by a factor 4 in average!! it is even much worse for gold and science.
ok, so i think the AIs city-governing behavior really needs to be fixed. i think i can draw a sketch how an efficient and competitive city AI should work:
first the decisions depend on the situation. thus it makes sense to categorize the different situations a city can be in in general. in a attempt to set categories for production i relate it on the time needed to produce a standard building for each epoch on snail speed (e.g. a market place in medieval).
1. Conquered City: (foreign culture is higher than yours)
2. Small Town: (size between 1 and 3)
3. Developing City: (builds a standard building in more than 10)
4. Core City: (none of the categories above)
the prior categories are always dominant to the lesser ones, i.e. if a city fits in both category 1 and 2 it's just of category one.
ok, now for the build order:
Conquered City:
these type of cities have a big problem with foreign culture and need to fix it as fast as possible. they very dependant of help form outside like caravans and gold rushing buildings. these towns usually cannot help the empire in anyway so all production is used to solve the culture problem.
1. monument and theater + sent urgent request for caravans
2. if(monastery can be build in less than 20 turns) build monastery
else if(city size is below 2) build +
building preferring most cheapest
else build production buildings preferring most cheapest
3. city walls
4. if(temple can be build in less than 20 turns) build temple
else if(city size is below 2) build +
building preferring most cheapest
else build production buildings preferring most cheapest
5. if
thumbsdown: +1 >=
) build happiness building preferring most cheapest
6. grany and lighthouse
7. if(can build a culture granting world wonder in less than 50 turns) build wonder
else if(can build a culture granting national wonder in less than 40 turns) build nat wonder
8. if(can build a production building (+
or +x%) in less than 10 turns) build production building
8. any building granting (static) culture - prioritize most cheapest
9. any happiness building preferring most cheapest (suppress revolutions)
10. points 1-9 completed? ok, use Developing City behavior then
Small Town:
This cites cannot contribute anything to the empire in this state. they try to do everything to leave this status and grow because they are highly dependent on outside help (caravans, rushing buildings).
1. monument (or theater)
2. if(city growth is in less than 30 turns) build grainy
3. any +
building starting the with cheapest
4. lighthouse + sent urgent request for caravans
5. if(points 1-4 are done) behavior of Developing City
Developing City:
are good enough to produce on their own without help form outside. they cannot contribute much to the empire but sometimes do. however their priority is to maximize production
1. if(last production was not for the empire) {
if(empire need military very urgently) {
produce military } }
2. any production building granting static bonus (+:hammers) - or if possible granting at least +1 hammer (static or through modifiers) - starting with most cheapest
3. if
thumbsdown: +1 >=
) build happiness building prefering most cheapest
4. if(last production was not for the empire) {
if(random> 0.6) { if(small or conquered cities around) produce caravan }
else if(world wonders are build nearby && can build caravan in less than 10 turn) build caravan
else if(empire needs workers) produce worker }
5. any +
building starting with the cheapest
6. if(random>0.7 && can build a world wonder in less then 50 turns) build world wonder
7. if(trade route adding building can be build in less then 25 turns) build it
8. courthouse then any +science or +gold building starting with the cheapest
9. if(random>0.4 && empire needs military urgently) build military
10. military buildings cheaper than monastery, then monasteries - state religion first
11. military buildings cheaper than temple, then temples - state religion first
12. continue with Core City behavior
Core City:
these cities are the strength of an empire. they provide help for all other cities and concentrate on the empires needs.
1. if(empire needs military urgently) produce military
2. if random>0.3) { if(small cities or conquered cities around || world wonder building cities) build caravan }
3. any production building starting with most cheapest
4. if
thumbsdown: + 2 >=
) build happiness building prefering most cheapest
5. military buildings - starting with best xp bonus
6. if(last production was not for the empire) {
if(random>0.5 && empire needs military) produce military
else if(empire has holy city) build missionary }
6. if(can build a world wonder in less then 40 turns) build world wonder
7. if(trade route adding building can be build in less then 25 turns) build it
8. courthouse then any +science or +gold building starting with the cheapest6.
9. national wonders of strategic importance
10. any trade rout adding building
11. if(random>0.6) world wonder
12. if(random>0.4) national wonder
13. if(this citiy posses a religion another city in the empire lacks && religous civics fit) build missionary
14. if(small towns or conquered cities or world wonder building anywhere in empire) build caravan
15. if(health building costs no maintenance) build it
16. if(empire has sufficient military) produce science for x turns
ok, so i think the AIs city-governing behavior really needs to be fixed. i think i can draw a sketch how an efficient and competitive city AI should work:
first the decisions depend on the situation. thus it makes sense to categorize the different situations a city can be in in general. in a attempt to set categories for production i relate it on the time needed to produce a standard building for each epoch on snail speed (e.g. a market place in medieval).
1. Conquered City: (foreign culture is higher than yours)
2. Small Town: (size between 1 and 3)
3. Developing City: (builds a standard building in more than 10)
4. Core City: (none of the categories above)
the prior categories are always dominant to the lesser ones, i.e. if a city fits in both category 1 and 2 it's just of category one.
ok, now for the build order:
Conquered City:
these type of cities have a big problem with foreign culture and need to fix it as fast as possible. they very dependant of help form outside like caravans and gold rushing buildings. these towns usually cannot help the empire in anyway so all production is used to solve the culture problem.
1. monument and theater + sent urgent request for caravans
2. if(monastery can be build in less than 20 turns) build monastery
else if(city size is below 2) build +

else build production buildings preferring most cheapest
3. city walls
4. if(temple can be build in less than 20 turns) build temple
else if(city size is below 2) build +

else build production buildings preferring most cheapest
5. if


6. grany and lighthouse
7. if(can build a culture granting world wonder in less than 50 turns) build wonder
else if(can build a culture granting national wonder in less than 40 turns) build nat wonder
8. if(can build a production building (+

8. any building granting (static) culture - prioritize most cheapest
9. any happiness building preferring most cheapest (suppress revolutions)
10. points 1-9 completed? ok, use Developing City behavior then
Small Town:
This cites cannot contribute anything to the empire in this state. they try to do everything to leave this status and grow because they are highly dependent on outside help (caravans, rushing buildings).
1. monument (or theater)
2. if(city growth is in less than 30 turns) build grainy
3. any +

4. lighthouse + sent urgent request for caravans
5. if(points 1-4 are done) behavior of Developing City
Developing City:
are good enough to produce on their own without help form outside. they cannot contribute much to the empire but sometimes do. however their priority is to maximize production
1. if(last production was not for the empire) {
if(empire need military very urgently) {
produce military } }
2. any production building granting static bonus (+:hammers) - or if possible granting at least +1 hammer (static or through modifiers) - starting with most cheapest
3. if


4. if(last production was not for the empire) {
if(random> 0.6) { if(small or conquered cities around) produce caravan }
else if(world wonders are build nearby && can build caravan in less than 10 turn) build caravan
else if(empire needs workers) produce worker }
5. any +

6. if(random>0.7 && can build a world wonder in less then 50 turns) build world wonder
7. if(trade route adding building can be build in less then 25 turns) build it
8. courthouse then any +science or +gold building starting with the cheapest
9. if(random>0.4 && empire needs military urgently) build military
10. military buildings cheaper than monastery, then monasteries - state religion first
11. military buildings cheaper than temple, then temples - state religion first
12. continue with Core City behavior
Core City:
these cities are the strength of an empire. they provide help for all other cities and concentrate on the empires needs.
1. if(empire needs military urgently) produce military
2. if random>0.3) { if(small cities or conquered cities around || world wonder building cities) build caravan }
3. any production building starting with most cheapest
4. if


5. military buildings - starting with best xp bonus
6. if(last production was not for the empire) {
if(random>0.5 && empire needs military) produce military
else if(empire has holy city) build missionary }
6. if(can build a world wonder in less then 40 turns) build world wonder
7. if(trade route adding building can be build in less then 25 turns) build it
8. courthouse then any +science or +gold building starting with the cheapest6.
9. national wonders of strategic importance
10. any trade rout adding building
11. if(random>0.6) world wonder
12. if(random>0.4) national wonder
13. if(this citiy posses a religion another city in the empire lacks && religous civics fit) build missionary
14. if(small towns or conquered cities or world wonder building anywhere in empire) build caravan
15. if(health building costs no maintenance) build it
16. if(empire has sufficient military) produce science for x turns