AI tech paths.

Outlandish

Chieftain
Joined
May 14, 2009
Messages
87
Genghis founded Hinduism in my current game on turn 20. This got me wondering why an AI would ever go down that route with Genghis. I'd try it, just because I'm terrible with the pure warmongers and I'm not going to win without some kind of economic boost or a near-HoF level start. Or a nice, soft, close neighbor. Axe rushes I can handle.

Does it mean he has marble and is heading for the polytheism wonder path, or has he decided to go for a culture victory of all things? Or is it too early in the game for the AI to be picking a victory path? Does (or should) an AI going down an unusual tech path tell me anything?
 
I'm not sure if an unlikely AI going for a religion early should tell you anything, but I can tell you that unlikely AIs can go for a cultural victory if they randomly feel like it. I've seen one game where a 20+ cities Deity Ragnar got steamrolled by the human player because he decided to go culture for some incomprehensible reason, and neither his tech or his military was up to the task of protecting him.
 
AI tech choice is controlled by AI_doResearch(), which in turn calls AI_chooseResearch() for picking a new tech when the last one finishes, which in turn calls AI_bestTech() under normal circumstances - all in CvPlayerAI.cpp. The AI will generally consider techs that are currently available, requiring one prerequisite tech, or requiring two prerequisite techs. But not 3+ prerequisites required - so the AI might start the game by queuing up Agriculture, Fishing, and Pottery to beeline Pottery, but it won't start by queuing up every tech needed to get Alphabet.

Tech evaluation is a very lengthy but not terribly complex function - basically, it just adds up a bunch of factors to see which tech it gives the highest score. You can read through the whole (extremely lengthy) list in AI_bestTech() if you really want to. But as a practical matter, AIs just add up a bunch of individual scores to give an overall value to techs. E.g., Calendar gets +100 points for centering the map; Alphabet gets 500 points, +500 more per civilization met, for allowing tech trading. And so forth. There are a few cases where the AI's current strategy can impact that scoring, and there's also a hefty 0 to 2000 point random factor added on. Then the whole thing is scaled down roughly proportional to how many turns that tech will take the AI to discover.

The most likely explanation for any early-game AI tech choice is "the random factor was high for this tech and low for the others."
 
I assumed there was some randomness involved, but that's a larger random factor than I expected. Thanks very much for the explanation.
 
Assuming standard settings, none of the wonders have been built already, and the AI shares its continent with someone else (not an isolated AI; they have different priorities/values)...

Alphabet is relatively simple. 500-2500, +500 per known civ, +leader-specific flavor modifiers that potentially go as high as 800 (Joao, Lincoln, Tokugawa, Peter).

Aesthetics is more complicated. 500-3300, +leader-specific flavor modifiers that potentially go as high as 1600 (Gandhi, Hammurabi). +1200 if the leader is pursuing strategy AI_STRATEGY_CULTURE1 (very likely if their traits are some combination of Spiritual, Creative, Financial, Philosophical, Financial, Industrious; very unlikely otherwise).

Both get divided roughly by the turns needed to discover; since the beaker costs are the same, this doesn't make a significant difference.

And finally there's a small chance if nobody they know has discovered Alphabet yet that they'll multiply its score by 2.5x because they see a chance to trade it around a lot (the AI occasionally adds more value to tech choices if it thinks they can be trade-bait). Aesthetics would have the same chance, except they won't consider trading for Alphabet - their tech brokering weights will only be considered if they already have tech trading unlocked, or the tech in question unlocks tech trading itself.
 
Top Bottom