1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[BTS] AI Civics

Discussion in 'Civ4 - Strategy & Tips' started by scheines, Sep 28, 2020.

  1. scheines

    scheines Warlord

    Joined:
    Feb 4, 2020
    Messages:
    129
    Gender:
    Male
    I saw a BUG tip yesterday that said to watch civics, since it could give clues regarding your opponent’s goals (e.g. theocracy -> making units). Surely this works vs human opponents; does it work on the AI?

    Moreover, what drives AIs civics, aside from one being their favorite? For instance, I can’t remember the last time I saw an AI in pacifism or nationhood.
     
  2. coanda

    coanda Emperor

    Joined:
    May 12, 2009
    Messages:
    1,793
    In CvPlayerAI, AI_doTurnPre() (called at the start of each turn) calls AI_doCivics. AI_doCivics makes sure the AI is allowed to change civics, and hasn't swapped too recently, then assuming that's true tries to shift into the civics that evaluate highest on AI_bestCivic(). AI_bestCivic() gets a score for each civic based on AI_civicValue(), then increases the value of current civics by x1.2 if it would take non-zero turns to switch civics, or x16/15 if switches are free (to make AI civic choices a little "sticky").

    But the bulk of the work is done by AI_civicValue, which is about a 300-line function adding up values for various things that civics might give. Avoiding emancipation anger is worth points. Additional GPP rate is worth points. Reduced military upkeep is worth points. Reduced corporate maintenance is worth points. And so forth, and so on. Big long list. "Favorite civic" adds a pretty hefty boost on to the score at the end of the evaluation, which is why AIs tend to be in their favorite civics - although if the game situation was really favorable for something else, from their perspective, they could switch.
     
    gavenkoa and Kaitzilla like this.

Share This Page