AI Tech Path?

Bandobras Took

Emperor
Joined
Jun 27, 2007
Messages
1,923
Location
Orem, UT
Is there any documentation on how the AI chooses what techs to research?
 
I don't know about documentation, but from lots of personal experience, the AI tends to love the monarchy-feudalism-economics beeline route. Alternatively, the Divine Right beeline. This leaves the player free to go for liberalism and renaissance military techs.
 
I have no data but I could swear that different leaders have different tendencies, you come to expect certain tech choices now and then when you get to know the different personalities. But perhaps it's all in my head.
 
I have no data but I could swear that different leaders have different tendencies, you come to expect certain tech choices now and then when you get to know the different personalities. But perhaps it's all in my head.

Leaders seem to like researching techs that get them their favourite Civic, or their UU or UB.
 
I know there's more info out there....

I believe there are 5 or 6 categories -- military, cultural, religious, etc. Each leader has an affinity for one or two categories, and each tech has a "weight" for one or more categories. Mixed in with some randomness of course, but it explains why Shaka goes to IW while Isabella prefers Mono.

Maybe someone else can point us to actual numbers?
 
Hmm, I noticed so little difference I don't think it really matters.

They tend to put off Aesthetics so long, but always beelining up the silly religion tree. They also seem to avoid electricity for quite some time.

The only thing that changes is sometimes they may get Alphabet early, and sometimes they don't. It could be something as simple as.... Mansa pops Alphabet from a hut, and then rapidly trades it off to everyone.
 
Is there any documentation on how the AI chooses what techs to research?

Nothing that I've seen.

The basic algorithm is the same that is used elsewhere - enumerate all of the choices, assign a score to each, take the "best" one. In the case of tech research, the scoring function is a big mess, taking as inputs a lot of the values stored in TechInfos.xml, in game data that the AI is aware of, weights defined in LeaderInfos.xml a few other things. Memory tells me I counted five different random numbers being used as well.

In practice, the selection mechanism is essentially the same as the one used to recommend research lines to the human player, so you can get some sense for how it is going to go by observing your research advisor.
 
Doing some more poking around, the best I can come up with is that there might be a relation between a tech's "flavor" values and a leader's "flavor" values.

For example, Alexander has a high FLAVOR_MILITARY and FLAVOR_GROWTH rating, which theoretically means he will tend to choose techs with a corresponding high value for FLAVOR_MILITARY and FLAVOR_GROWTH.

If this is correct, then the reason most leaders don't go for Liberalism that often is that the prerequisite techs have different flavor ratings -- as an example, Education and Philosophy have very high FLAVOR_SCIENCE Ratings, but Liberalism itself has a much lower FLAVOR_SCIENCE rating, and its FLAVOR_CULTURE is in fact higher -- so a civ which focuses on Science would perhaps get Philosophy and even Education, but would only go on to Liberalism if it couldn't research anything with a higher Science value.

Likewise, a civ which focuses on FLAVOR_CULTURE would take Liberalism, but won't focus on the non-FLAVOR_CULTURE prerequisites.

At any rate, maybe the next time I meet a leader I'll have a look at their XMLs and see if I can predict a tech path.
 
After setting up a scenario in the World Builder (wipe out a bunch of Civs at turn one and settle tons of Great Spies), it looks like the Flavors at best indicate preferences -- if the AI can't think of anything better to research, it goes for that. It seems to stick around techs of a certain cost, adapting if necessary. I initially have tested Willem vs. Stalin in tech paths; they both went for the religious techs (I should note I avoided founding any religions), and generally altered the order of tech choices while remaining in the same general "level" of tech costs.

Both, however, chose Feudalism for their 34th tech choice, which suggests that the AI has certain military tech benchmarks to meet.

This in turn suggests that beelining almost anything results in good trade material for backfill, because the AI works tech costs fairly methodically instead of doing extended beelines of its own.
 
Leaders seem to like researching techs that get them their favourite Civic, or their UU or UB.

That's not my experience at all. As a matter of fact, the AI seems like it accidentally just stumbles onto it's uniques. I had a game not so long ago, where Vicky of all people was becoming a runaway AI. I had to fight my way through three other civs to get to where I could bring my armies to bear on her. She teched straight through the sciences and on through Assembly Line, and never teched Rifling. The whole time I was taking her Longbow and Musket cities she was teching Refrigeration (or something similarly daft). I've seen it with other AIs as well; this is just the most tragic example.
 
Here is something I have noticed about the aggressive AI's.

When I've had Shaka and Tokugawa and a few other guys like that, they tend to head for Military Science early and are usually the first there. Other AI's seem to like the Military Tradition tech instead.

Common AI beelines:

-Monarchy/Feudalism
-Calendar
-Construction/Engineering
-The religious techs
-Scientific Method

Some techs they seem to ignore for a while (e.g. good tech trading fodder)

-Aesthetics
-Education/Liberalism
-Steel


Note that this doesn't mean the AI's will always ignore Liberalism...it's certainly possible that some AI's like Gandhi can discover liberalism before 1AD.
 
That's not my experience at all. As a matter of fact, the AI seems like it accidentally just stumbles onto it's uniques. I had a game not so long ago, where Vicky of all people was becoming a runaway AI. I had to fight my way through three other civs to get to where I could bring my armies to bear on her. She teched straight through the sciences and on through Assembly Line, and never teched Rifling. The whole time I was taking her Longbow and Musket cities she was teching Refrigeration (or something similarly daft). I've seen it with other AIs as well; this is just the most tragic example.

Maybe they target their favourite civic more, that's what I'd noticed moreso.
 
I don't find the AI ignores electricity. Builder types like HC of Inca tend to beeline it in my experience
 
Hmm.

Maybe we should try to sort this all out with tree-diagrams :P

But since AI`s start with extra techs on the higher levels, this could have a little impact on the order of the directions they head off in.

Obviously, many starting with Myst tend to either go after Hin, or Bud...
 
Intersting... if we play enough games, we could generate an average tech rank (that is, tech X is researched, on average, 23rd) or something for each Civ. Very interesting to predict, however, properly played espionage can tell you all you need to know about this in a particular game.
 
It is definitely the flavors that make the difference. I don't think they always emphasize smart decision making due to the numerous times I have sold Agriculture to Ragnar...sometime after 200 AD. And Pottery. Same time frame.
 
Intersting... if we play enough games, we could generate an average tech rank (that is, tech X is researched, on average, 23rd) or something for each Civ. Very interesting to predict, however, properly played espionage can tell you all you need to know about this in a particular game.

Given the number of inputs into the scoring function, you'll probably wear out before you achieve statistical significance.

I think the more effective approach would combine the following three elements: (a) Modify the scoring function, so that you can collect the scores assigned to each tech each time the AI considers a choice (b) Modify the scoring function, so that you can control the random numbers that are generated (basically, that means arranging for a different RNG to be called when the AI is flipping the coin) and (c) having an interesting collection of maps to feed in as inputs.

This is based on my own experience, some time back, where I wanted to better understand the choice between Meditation and Polytheism made by the AIs.
 
^^ don't you guys ever feel that overanalyzing the AI engine ruins the game? I like to know certain things about game mechanics, but knowing too much about game mechanics seems like it could ruin the game for me. The example you gave is perfect. If you knew enough about the game, you might be able to skip espionage altogether, and yet still know exactly what the AI is doing. This is the same as cheating, as you would be getting something for no investmend. Otherwise you'd need to put resources into espionage. A certain amount of intuition is fine. I'd expect Ghandi to go for economic techs first, and I'd expect Gengis to be massing units, but I don't want to know EXACTLY what they're doing and I don't want to be able to predict EXACTLY what they will do.
 
It's kind of inverted actually. When people tell me that the AI always techs the bottom half, I want to make sure they're telling me the truth and not actually influencing the AI tech choices by their own. ;)
 
Back
Top Bottom