Suggestions to make a AI a little better

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.
Post Reply
MikeDuk
Posts: 40
Joined: Tue Aug 31, 2021 3:58 pm

Suggestions to make a AI a little better

Post by MikeDuk »

I have noticed that the AI amasses tons of gold in mid/late game and never uses it, as far as I know, except for building upkeep. It would be nice if it could use money to speed up production in cities, with something like this algorithm (in pseudocode because I don't know the real code):

Code: Select all

For each city
     /* Get Hurry Production Cost for city */
     current_hurry_production_cost = get_city_hurry_production_cost(city_name);

     /* Get Treasury Total Gold */
     current_gold = get_total_gold();

     /* If the cost if hurrying production is less than 1% of total gold, buy the unit/building/wonder */
     if (current_hurry_production_cost < current_gold / 100)
         buy_city_item(city_name);
     else
        /* If city has no military units inside and it is building one of them, be less restrictive with money and use a 5% gold limit */
        if (!city_has_military_units(city_name))
            if (current_hurry_production_cost < current_gold / 20)
                buy_city_item(city_name);


I have also noticed that the AI keeps researching science after having completed the Tech Tree. In my opinion, unless your goal is to increase score by having countless of useless Future Techs, taxes should be redirected towards Happiness or Gold. It is unbelievable how the AI keeps doing science even though it has to use 2 or 3 specialists to fight off unhappiness in cities, when it could build temples, colisseums, marketplaces, or increasing the tax on happiness, so that the citizens could be used to get food or production points.
Post Reply