What does the AI actually do?

Minou

King
Joined
Apr 19, 2013
Messages
845
I was going to call this post “What is God’s name does the AI actually do?” because it seems that in many games they don’t seem to be doing anything at all by the end of the game. Anyway, I was curious so I started a game and used the Reveal Map cheat to spy on their first 50 turns. To avoid influencing them as much as possible I just settler in place and only build Warriors which I did not move other than to fortify in an open tile. Game settings are Deity Standard. Here's what I learned.


SETTLING

* All AIs settled on the first turn.

*I always assumed Deity AIs started with 3 Settlers, but the way it works is actually that they get one Settler and when they found their second city they get a free Settler+Builder. The third city likewise gives a free Settler and Builder as well

*There was a lot of variation in how long it took AIs to settler their next cities. England founded their second city on T5, Babylon on T6, and everyone else on T7 except India who walked all around and finally settled on T9.

*All AIs made sure their first 3 cities had fresh water or salt water. A big improvement over the old days of head-scratcher cities one tile from a river.

*There was alot of variation in whether AIs bothered to escort their fourth Settlers. Canada used an escort, Indonesia and Macedonia had units one tile away but did not directly cover the Settler with them, and England walked the Settler out completely in the open with no escort in sight.

*Indonesia had their 4th city up on T18 thanks to Religious Settlements. The next AI to a fourth city was Babylon at T29. Japan was last to a fourth city at T46. Macedonia was first to five cities at T46.

Spoiler :

No escort.jpeg

Way to escort that Settler!


BUILD ORDERS

These are the first 8 builds in each capital:

Japan: Monument, Slinger, Granary, Builder, Settler, Walls, Holy Site, Settler
England: Scout, Monument, Settler, Builder, Pyramids, Walls, Chariot, Chariot
Canada: Scout, Monument, Builder, Trader, Walls (missed whatever the next were)
Babylon: Monument, Slinger, Palgum, Settler, Builder, Chariot, Chariot, Campus
Indonesia: Slinger, Monument, Granary, Builder, Settler, Trader, Holy Site
India: Slinger, Monument, Warrior, Warrior, Warrior, Settler, Granary, Varu
Macedonia: Monument, Slinger, Granary, Warrior, Warrior, Settler, Campus, Temple of Artemis

*It seems the AI chooses between a Scout, Slinger, or Monument as its first build. They often build something else from this menu and then a Granary next. I am not 100% sure one of those Scouts could have been from a hut but the timing seemed right for them to be built.

*Both England and Babylon trained a Settler in their captial on T24 and popped a Builder on T25. Their gold did not change, so they did not buy them. I don’t think I could have possible missed seeing two Tribal Villages, so I am wodnering if they queue-swapped? It seems unlikely to me that the Ai would be programmed to queu swap given its limited intelligence, so I wonder if there were some type of free AI bonus builders - however, the other AIs did not seem to get them the same turn or upon completing their first trained Settler.

*The second and third cities almost always built a Monument first (11 of 14 cases). The only exceptions were a Campus in the second Babylon city, a Granary in the second Macedonian city, and an Archer in the third Indian city. After that, there was alot of variation. I did not record every build but they included military units, districts, and even one Wonder.

*Ancient Wonders were popular, and in many cases multiple AIs started the same one. Canada and England started building Pyramids very early, and it was the first Wonder completed (England on T33). Great Bath was next on T37, followed by Temple of Artemis (T46) and Etemanaki (T50).


IMPROVEMENTS

*The AIs love those useless farms! I jotted down the improvements that the AIs made with their free builders and they made 24 farms, 5 mines, 1 quarry, 3 camps, and 2 pastures. I seem to have missed a few, which where probably even more farms…..

*Since the first mines/pastures appeared after T15, I suspect the AI builds farms with their first Builder in part because they are the only available improvement. I kind of though they started with Mining, but if so it is odd they waited so long to place any mines.

*As far as I can tell, the AI never chopped or harvested a single tile. This is probably a huge reason why they suck more and more as the game goes on, since chopping get more and more powerful over time.


DISTRICTS

*The AI does not seem to pre-place districts. That is, they wait until a Campus is their next desired build and then place and finish it instead of placing the district as soon as it unlocks to lock in the lower cost.

*Babylon was the first to start a district, a Campus on T12. They started a second on T23 and eventually built 4. India started the first Holy Site on T26 and Macedonia started a Campus on T26 as well. England and Indonesia both finished Holy Sites on T33.

*The AI quite often places tiles on Forests, which doesn’t really “waste” the chop since they never chop to begin with.


MILITARY
Spoiler :

dumb war.jpeg

England declares with their units horrible out of place.

*The first and only war of the 50 turn window was England declaring on Babylon T24. They did a terrible job, decalring before all units were in place and getting their army destroyed. They also started building Chariots AFTER decalring, which did not help at all because they were being made 10+ tiles from the front.

*Babylon purcased a Chariot three turns after war was declared. I believe this was the first gold purchase of the game.

*England totally left the back door open when they invaded India, leaving not a single unit withint 7 tiles of their three cities, which also had a Settler and Builder i their borders.

*India went hog wild with military units but never used them. They marched four Warriors up to a city state but just sat them there without ever attacking. Eventually they had a massive army of 14 units including 3 Varus but never used them.

*Japan walked four of their starting Warriors far south to a city state as well, and never attacked. This would have left them ripe for an invasion.

*Some AIs got walls up fast, but often only in some of their cities: England (T28, T33, T39), Canada (T36, T37), Japan (T39). Babylon, Indonesia, India, and Macedonia did not build walls in the first 50 turns.

Spoiler :

Backdoor.jpeg

The main purpose of Englands war seemed to be to invite themselves to get invaded, though no one took advantage.

flaso door.jpeg

Japan is just begging to be backstabbed too. Those units never attacked Hattusa so I have no idea what their goal was.


RELIGION

*The first Pantheon was Religious Settlements on T9. I recorded God of the Forge on T37 but I suspect I missed notification for others in between

*The first Religion (Feed the World, Wat) was taken on T48. No other AI had a religion at this stage. Unusually, no one had even started Stonehenge.



IMPLICATIONS

Your best neighbor may just be a warmongering AI if they leave their own land undefended. It would have been a treat to roll over England with a city state levy this game when they had zero units on defense. Having Scouting units out there watching for the opportunity can pay off.

Whether Ancient Walls wreck an early invasion is a bit of a crap shoot.

Around T25-35 a lot of Settlers will be roaming and possibly unguarded. If you have a Scout near an AI, this is a good interval to pay attention for steal opportunities.

The Ancient Era wonders all seem to go super fast and I don’t think it is ever worth trying to build them, just capture them later.



ENDOTE
Here is what each AI had on the table after 50 turns.

Japan:
Cities: 5 Cities (2 Monuments, 1 Granary, 1 Walls)
Units: 5 Warriors + 1 Slinger +1 Chariot + 1Trader + 1Builder
Infrastructure: 3 Holy Sites (+1 in progress) +1 Shrine, Great Bath

England:
Cities: 4 Cities (3 Monuments, 3 Walls) + 1 Settler
Units: 5 Chariots + 1 Slinger + 1Builder,
Infrastructure: 2 Holy Sites +1 Shrine, Government Plaza, Pyramids

Babylon:
Cities: 5 Cities (2 Monuments, 1 Palgum),
Units: 5 Warriors + 3Chariots + 1 Chariot + 2 Builder
Infrastructure: 4 Campus + 4 Libary, Oacle and Machu Pichu (both in progress)

Canada:
Cities: 4 Cities (3 Monuments, 2 Granaries, 1Water Wheel, 3 Walls) + 1 Settler
Units: 5 Warriors + 1Slinger + 1 Galley + 3Builder + 1 Trader
Infrastructure: 1 Holy Site, 2 Campus (both in progress, 1 Theater Square (in progress), Apandana (in progress)

Macedonia
Cities: 5 Cities (3 Monuments, 2 Granaries)
Units: 7 Warriors + 2 Archers + 1 Spear + 1 Heteroi + 2Builders + Trader
Infrastructure: 2 Campus + 1 Library (1 Campus, 1HS in progress), Etemanaki, Temple of Artemis

India:
Cities: 5 Cities (3 Monuments, 1 Granary, 1 Water Mill)
Units: 9Warriors+2Archers+3Varus+3Builders+1Trader
Infrastructure: No Districts!

Indonesia:
Cities: 5 Cities (4 Monuments, 4 Granaries) + 1 Settler
Units: 7 Warriors + 1Slinger + 1Scout + 1Trader + 2 Builder
Infrastructure: 3 Holy Sites + 2Shrine
 
Last edited:
Very interesting post, thanks!
 
I think chopping should not be in the game. It is a mechanic that only benefits the player. Also Fxs completely removing war from civilization is for me enough reason to not look with excitement for Civ VII. But unfortunately it is not the only one. In its current state I hate with all my soul RV, CV, and DV, and Domination to me does not even exists.

I like SV but lets be honest, it has not really changed from Civ1.. though it actually has a major difference. Civ1 actually had a space station building minigame, where the time to arrive of the space station (back them Alpha Centaury) depended on the mass and fuel and engines of your station. You could actually chose how to build your space station, and see it while being built. Does it sound better than the "magic space accerelation projects" of Civ VI? Yeah, it was. Think about that...

For the time being, VI will be my last Civ game. 30 years being a fan of the franchise since Civilization 1, with their ups and downs, but VI made me not care anymore.
 
oSiyeza I agree that it is a shame the AI doesn't really present any challenge. Even on Deity, they seem to only present a meaningful threat in the first 50 turns or so. I have been killed by an AI (or even two!) rushing me with 4 Warriors before I even have my second city. But, if you survive that I don't think it is possible to lose the game unless you want to. I only played Civ 2 and Civ 4 before, but I do remember in Civ 4 the Deity AI was no joke and could both crush an unprepared player militarily or win an honest Space Race.

But I still enjoy SV and CV as basically a race against myself for best time. Civ 6 is pretty, and has lots of fun little choices and tricks. It's just probably always going to be race against the clock instead of the AI unless we one day get a community mod.

If people enjoyed this post, I might try following one AI for the ENTIRE game to figure out what they do later on. It would be way too hard to track all 7 but I'm interested if I keep building Warriors for another 200 turns whether anyone will attack me and how long it will take one of the AIs to actually win. I assume they can only really win via Space, since there is no way their incompetence would allow a Domination or Religious win and I assume they will never invest enough in tourism to overcome each others culture (I don't think I have ever seen an AI Rock Band) and they will in theory just vote each other down in the Diplomatic Victory votes unless there is a lucky string of emergencies that let's one get ahead.

Holiday weekend might be a good time to find out!
 
If people enjoyed this post, I might try following one AI for the ENTIRE game to figure out what they do later on. It would be way too hard to track all 7 but I'm interested if I keep building Warriors for another 200 turns whether anyone will attack me and how long it will take one of the AIs to actually win. I assume they can only really win via Space, since there is no way their incompetence would allow a Domination or Religious win and I assume they will never invest enough in tourism to overcome each others culture (I don't think I have ever seen an AI Rock Band) and they will in theory just vote each other down in the Diplomatic Victory votes unless there is a lucky string of emergencies that let's one get ahead.

Holiday weekend might be a good time to find out!

Thanks, I did enjoy your post. Regarding victories, I did lose one Diplo to AI once (I was probably still a noob then), I have seen rock bands in my last game (and a good progress towards CV by Menelik), some initial threat towards SV (but once I pillaged two or three of their Spaceports, they seem to permanently stall?) and never for Dom nor RV (but since I usually play on Huge / continents maps, it's not that easy to pull off, especially on "the other" continent, but I have seen Religious domination over one the main continents).
 
I find it interesting that people complain about the AI not doing things that I've see it doing before.
  • I lost my first game due to the AI winning a CV.
  • I've seen AIs threaten a Dom, with myself as the last man standing against them. I still won, but it was a definite threat.
  • My last game would have been a loss to a Khmer RV had I not disabled it - the whole map was swamped in Khmer Missionaries and the instant anyone got a religion going, it got swamped out by half a dozen religious units. I wasn't playing the religious game,.but even ifnI had, I'm not sure I could have countered him.
  • I've never seen a close Diplo win, although they have had strong starts. Usually the game doesn't progress.enough for them to finish a Diplo - either another Victory is obtained first or I'm gunning for Diplo. If left to its own devices, I imagine it could achieve it.
That's not to say that the AI is amazing or that there is not room for improvement. The AI is lacking and there is plenty room for improvement, but Insee a lot of "never"s floating around compared to my experience.
 
That's not to say that the AI is amazing or that there is not room for improvement. The AI is lacking and there is plenty room for improvement, but Insee a lot of "never"s floating around compared to my experience.
Agreed. It just does not seem to be consistent, it appears to trigger in some cases but not in others when you would expect it to, and it sometimes (often?) seems to me as if the AI sort of "changes its mind" in the middle or is suddenly and inexplicably hindered on a path it could definitetly recover from (best example that comes to mind is the pillaging of several Spaceports by spies, which many a time has stopped their progress indefinitely in my games).

EDIT: too often do I see the popups "XXX has abandoned the idea of a SV" (or however it translates to English). A good strategy should be sustained, if you change your strategy too often, you are certain to lose.
 
Last edited:
  • Like
Reactions: PiR
So does anybody else notice how quick the Great Scientists go in the early game? The first one or two can be gone before my first campus is even built.

If I had to guess, I think some civ's will just build campuses and then just loop into Campus Research projects. Of course, this my not represent a great minuse of a civ's time and effort, and sort of speaks the one-dimensionality of Civ's "multiple paths to victory"
 
So does anybody else notice how quick the Great Scientists go in the early game? The first one or two can be gone before my first campus is even built.

If I had to guess, I think some civ's will just build campuses and then just loop into Campus Research projects. Of course, this my not represent a great minuse of a civ's time and effort, and sort of speaks the one-dimensionality of Civ's "multiple paths to victory"
I looked at the list of GSs, and I frequently get the early ones, enough often enough that they look pretty familiar (I really don't track them). Could it be that you are progressing through the Classical Era fast enough that you don't have time to recruit many?
 
EDIT: too often do I see the popups "XXX has abandoned the idea of a SV" (or however it translates to English). A good strategy should be sustained, if you change your strategy too often, you are certain to lose.
That's the result of how victory strategies are implemented in the code. One of the main reasons I created Real Strategy - so AI actually choose the victory and sticks to it as long as it reasonable.
 
Agreed. It just does not seem to be consistent, it appears to trigger in some cases but not in others when you would expect it to, and it sometimes (often?) seems to me as if the AI sort of "changes its mind" in the middle or is suddenly and inexplicably hindered on a path it could definitetly recover from (best example that comes to mind is the pillaging of several Spaceports by spies, which many a time has stopped their progress indefinitely in my games).

EDIT: too often do I see the popups "XXX has abandoned the idea of a SV" (or however it translates to English). A good strategy should be sustained, if you change your strategy too often, you are certain to lose.
That's fair. I'm always a used by the "Germany is no longer pursuing a Scientific Victory" pop up in certain circumstances, I always think to myself "So, Mr Redbeard, what exactly are you aiming for, when the only Victory that is enabled is the SV?"
 
That's the result of how victory strategies are implemented in the code. One of the main reasons I created Real Strategy - so AI actually choose the victory and sticks to it as long as it reasonable.
Yes, I gazed at your mod, but I had a feeling from the comments that you didn't have time enough to update it to take NFP into account, is that actually the fact?
 
Damn Babylon...no one wonder those early scientists disappear...

they do now but it is around T80+ more often than not.
Personally, what they slot is the real eye opener

There is some hax which can see their policy cards?
 
There is some hax which can see their policy cards?
No hack, it is clear as day in the log files.
If you really could be bothered you could go to the log files before each turn and see what the enemy has slotted.
You do need some small experience with excel to filter... I think the word is ‘slotted’
.... but then, if you used the log files you could see where they move spies if you have the right in game options set.
 
  • Like
Reactions: uhu
You can also automate this quite a bit with an lua script that records into the game's lua log everything AI cities are producing as their top-of-qeue production item, what they have purchased when they purchase something in a city, when improvements are placed, when improvements are "activated" (ie, goody huts and barb camp clearing), and when great people are acquired. The more you would want to include into the log however would create more processing time needed (therefore more perceptible lag when the code executes in real-time) so such a script would probably be best limited to spitting data for city productions at the end of each turn, city purchases as they occur, improvements as they are placed, and great people acquisitions only.

The game wipes clean the previous version of the lua log when you start up the game so you would need to navigate to
C:\Users\UserName\Documents\My Games\Sid Meier's Civilization VI\Logs
and copy the lua.log file elsewhere on your computer each time you end a game session and exit the game.

The lua log is just a text file that can be opened with Notepad, Notepad++, Wordpad, Word, etc.

If you're interested I could djinn up such an lua script (I have much of it running already in different mod lua codes) but it would probably take a few days to paste the portions of it I have already available, edit as needed to add any additional required logging routines, and package into a mod you can enable and run. The mod will have no effect whatever on game-play for you or the AI -- it will merely record what is happening into the lua log.

-------------

Only real downside to this approach is that the game tosses a lot of clutter messages into the lua log for when you open city panel in a city, etc., so you have to sort out these cluttery messaging to get to the data you are really interested in.
 
@Victoria thanks for the note that AIs start chopping after T80. I don't think I noticed that. Another reason to conquer them ASAP before they waste "my" precious forests.

@LeeS thank you for the note about log files. I was not aware of that, if I have time I will take a look and see if I can add more detail to my AI spying. Unfortunately, it sounds like the logs from my original 50 turn attempt will be wiped.

Regarding the AI, I also lost my very first game ever. I had absolutely zero idea what I was supposed to be doing and still thought you could capture empty cities by walking into them based on Civ 4. Then I used Slingers to knock a city to 0 and still couldn't capture them (since ranged units can't take cities). Eventually I had like two random wonders and some Spears and was destroyed by helicopters! But a month or so in I started feeling like the AI just wasn't a challenge and shifting fro trying to win to trying to win fast (to be fair the AI was even worse back then, all types of bugs like units that would forget to fire and the ability to kite a whole army with a Scout).

But once you know how to play well, I stand by the fact that it is almost impossible to lose to the AI except in the very early game or through some strange map settings. They are just so bad militarily that nothing else they do matters - if they are winning space you just burn their spaceports to the ground, religion you slay their missionaries as they appear on your borders, etc. What is odd to me is that barbarians seem to do a pretty good job attacking cities so in theory the same script should allow an AI to do so too.

FYI to my fellow Mac users the logs are found here, you need to press shift+command+g in a Finder window to get there:

~/Library/Application Support/Sid Meier's Civilization VI/
 
Last edited by a moderator:
Wow, I never knew have to access the logs before and this is very eye opening. I have a few questions

In the AI Research I see this header
Game Turn, Player, Action, Tech, Score, Boost, Turns

I see this string as one example, and I would guess that the -9882.4 indicates the AI is super uninterested in this tech now. I would also assume the "", ," blank means no boost.
1, 0, Tech, TECH_THE_WHEEL, -9882.4, , 105

In the next example, I assume the AI has the boost and the 240.8 indicates the AI is interested in the tech which will take 100 turns.
2, 9, Tech, TECH_ENGINEERING, 240.8, BOOSTED, 100

In the third example, I am assuming the "owned" means the tech is already complete (and hence, that AIs start with Astrology, did not know that before)
1, 0, Tech, TECH_ASTROLOGY, 0.0, OWNED, -1

And of course this means the AI is researching Pottery
1, 3, Tech, TECH_POTTERY, 151.6, RESEARCHING, 25

The two things I was unsure of was what "goal" and "contract" means in the examples below? I assume Goal is a tech and AI wants but does not have the pre-reqs for yet, but "contract" confused me.
1, 1, Tech, TECH_WRITING, 198.6, GOAL, 75
3, 7, Tech Contract 29, TECH_MASONRY, 73.0
 
@Victoria, would you be willing to explain how to determine AI policies and governor's slotted from the logs? I think I have figured out much of the rest but can't seem to decipher these....
 
@Victoria, would you be willing to explain how to determine AI policies and governor's slotted from the logs? I think I have figured out much of the rest but can't seem to decipher these....
Here is Ai_GovtPolicies.csv with a filter on action Slot Policy.The score column is based on their current action plan and VC I guess, someone like @Infixo woukd better explain some of this.
Governors is pretty boring and not that clear.
upload_2021-5-31_18-55-27.png

Of course we need to know which player is which, I use player_stats.csv but there are others you could use. You really need to check it it turn 1 because my example is inaccurate as I have killed some civs. The diplomacy logs work as a tricky alternative or firetuner makes it simple.
upload_2021-5-31_18-58-45.png
 
Last edited:
Back
Top Bottom