How is does the AI base its choices for beliefs?

JFD

Kathigitarkh
Joined
Oct 19, 2010
Messages
9,132
Location
The Kingdom of New Zealand
I would like to know how much lee-way I have when it comes to modding beliefs, or at least how exactly the AI figures what beliefs to choose. Here's a case where I'm concerned (read: certain) that the AI will be unable to properly value the belief in question:

Lord of Storms: Enemy land units must spend 1 extra movement point when inside your territory. +2 Faith from Oases.

So in this case, the AI would certainly not be taking into account the former bonus (done via Lua), but would the AI be assessing the latter? Thus, could I give this belief a more defensive, already-existing effect (such as the Ranged Combat Strength bonus) in order to better inform the AI that this belief is defensive in nature?

Thanks for any information.
 
The basic approach is
  1. Find all available beliefs
  2. Score them
  3. Limit to top 3 (max)
  4. Pick one at random

The scoring is non-trivial and is a factor of the value of the belief from current workable plots plus the value to cities plus the value to the player.

The code is over 500 lines of C++ with lots of hard-coded multipliers for different belief bonuses - search for "CvReligionAI::Score" in CvReligionClasses.cpp - but basically if the bonus from the belief is not something in the core game the AI will give it no value.
 
Back
Top Bottom