Gold use by the AI

Joined
Apr 29, 2003
Messages
4,292
Location
the Netherlands
I noticed the Gold AI section in the summary of the Better than BTS AI, so improving the use of gold by the AI is also being considered. I remember reading about issues related to gold use by the AI and would want to post them here hoping that these issues can be lessened.

If the AI has Universal Suffrage, then it will use a large part (almost all) of its gold to buy buildings and units. Another part of the money will be used for unit upgrades. Only after using gold for these two important elements of the game, it will consider using gold for spreading corporations. This is one of the main reasons why the AI is not very good at spreading corporations and when an unlimited number of corporate executives is allowed by the game, then the AI will spam them without actually using them, creating an interest in even more executives.
 
Yeah, I haven't looked at the city spending under U.S. yet ... the spending on units happens (or happened) under all civics. Now the AI has a budget for unit upgrades based on how much it's trying to save for other things.

The order for spending/income is: (see the Corporation thread for more info)

- get income (on turn i)
- cities (i)
- events (i)
- diplomacy (i)
- settle executives (i+1)
- upgrade units (i+1)
- get income (i+1)
...

So, the city spending would be even more important to whether or not the AI can use its executives.
 
Yeah, I haven't looked at the city spending under U.S. yet ... the spending on units happens (or happened) under all civics. Now the AI has a budget for unit upgrades based on how much it's trying to save for other things.

The order for spending/income is: (see the Corporation thread for more info)

- get income (on turn i)
- cities (i)
- events (i)
- diplomacy (i)
- settle executives (i+1)
- upgrade units (i+1)
- get income (i+1)
...

So, the city spending would be even more important to whether or not the AI can use its executives.

That corporation thread is interesting reading material.

My basic idea would be along the following lines:

First determine the target amount of gold for each category. This should be based on the requirements of that category and the AI should try to get to that target amount in a set amount of turns without lowering its science rate below a certain bottom percentage. Of course, when at war, the bottom science percentage should be 0 to allow quick unit upgrades.

Example:
- cities (i) 400
- events (i) 200
- diplomacy (i) 100
- settle executives (i+1) 200
- upgrade units (i+1) 500

Total 1400

Then when it has amassed 700 gold, it should distribute the gold among the categories:

Example:
- cities (i) 200
- events (i) 100
- diplomacy (i) 50
- settle executives (i+1) 100
- upgrade units (i+1) 250

Total 700

(Maybe the events category should always just get the money needed if it is available. Random events are too random to store money for them independant from other categories.)

This method has the risk that some expensive elements within each category never get the amount of money needed to perform them. If the settle executives has a target amount of 200 gold because it needs to settle one executive which costs 200 gold, then the above mechanism will only provide the 200 gold when the AI managed to amass the full 1400 gold which might never happen.

There are many possible ways to avert this problem. One of them is to add weights to the various categories dependent on the number of elements in that category that didn't get the money that was needed to perform them in the last turns. It's not that important to save money for upgrading units and rushbuying buildings and units. These things will always get their share. So it's mainly important for getting money for bribing allies in a war (diplomacy) or getting money for executives.

Example: During the last 3 turns, an executive wasn't able to found a corporation. It now has a weight factor of 3.

The AI has again amassed 700 gold for the various spending categories with a total requirement of 1400 gold. Only now, the settle executives category has a weight setting of 3, increasing its share of the available 700 gold.

Example:
- cities (i) 400
- events (i) 200
- diplomacy (i) 100
- settle executives (i+1) 200 * 3 (weight factor) = 600
- upgrade units (i+1) 500

Total 1800

However, the settle executives category has a weight factor of 3, so it gets 600/1800 * 700 = 233 gold which is enough to settle the executive (cost 200).

If one were to add weights, then if is very important to think about the values in each category so that the system works and priorities are correctly assigned.
 
Top Bottom