Thalassicus
Bytes and Nibblers
I've designed a system for the AI to spend its excess gold in v131.15 beta. The game already has a table of AI priorities. Here is Alexander's entry:
For example, Alexander is about twice as likely to get a Mobile unit (horse/tank) as a Ranged unit (archer). Depending on the option chosen from the priority list, it checks cities from largest to smallest until it finds an affordable unit/building of the selected priority. Some things like food/growth check from smallest to largest city.
If the "Diplomacy" priority is selected from the list, it selects a citystate to bribe depending on factors like:
Alexander
4 Offense
4 Defense
4 City_Defense
5 Military_Training
4 Recon
3 Ranged
7 Mobile
5 Naval
7 Air
5 Growth
5 Production
5 Gold
6 Science
4 Culture
6 Happiness
4 Great_People
7 Diplomacy
I use this list as weighted probabilities to pick something to buy when the AI has more gold stored than 200 + 150% research agreement cost (with some special exceptions like emergency defense units).4 Offense
4 Defense
4 City_Defense
5 Military_Training
4 Recon
3 Ranged
7 Mobile
5 Naval
7 Air
5 Growth
5 Production
5 Gold
6 Science
4 Culture
6 Happiness
4 Great_People
7 Diplomacy
For example, Alexander is about twice as likely to get a Mobile unit (horse/tank) as a Ranged unit (archer). Depending on the option chosen from the priority list, it checks cities from largest to smallest until it finds an affordable unit/building of the selected priority. Some things like food/growth check from smallest to largest city.
If the "Diplomacy" priority is selected from the list, it selects a citystate to bribe depending on factors like:
- Favors close citystates.
- Favors those with 0-60 current influence.
- Favors passing a rival's influence.
- Militaristic AIs favor militaristic citystates, and vice versa.
- etc...