The AI and Civics

Afforess

The White Wizard
Joined
Jul 31, 2007
Messages
12,239
Location
Austin, Texas
I've been adding new features to Civics, and while I was coding AI logic, I noticed how poorly some of the logic is. I know BAI has improved some of the logic, like conscript, but some of the logic is still atrocious.

For example:

Code:
iTempValue = kCivic.getHappyPerMilitaryUnit() * 3;
    if (iTempValue != 0)
    {
        iValue += (getNumCities() * 9 * AI_getHappinessWeight(isCivic(eCivic) ? -iTempValue : iTempValue, 1)) / 100;
    }

This segment determines how big a factor +1 happy per troop is. With the AI's massive armies, this kind of a bonus should be a big deal. Yet, the logic doesn't bother to take into consideration the size of the AI's army. I would care a lot more about +1 happy per military unit if I had a huge army sitting in my cities.

Or consider this one:

Code:
iValue += (kCivic.getBaseFreeMilitaryUnits() / 2);

This part is the value the AI places on extra free (free as in cost for maintenance) military units. One line? The AI should really care if they are already paying tons in military troop maintenance, but hardly care at all if the AI already has a ton of free military unit costs. Also, future warplans should be taken into account. This logic makes the AI favor it, even if their shooting for a cultural victory.

Those are my two biggest qualms, but I'm sure others can find more.
 
Back
Top Bottom