Improving AI priorities

I'm not convinced that Pyramids and the Great library are amazing picks for offensive players
Remember we're talking about AIs instead of humans. The AI is oblivious to what's actually on technologies, so the priority of the GL itself has no effect on the AI's tech choices. Conquest AIs usually don't get Writing early in the game, which means the time they'd go for the GL is later, when wonder prices are comparatively lower and cost effectiveness is better. In other words, the Great Library is not fantastic for offensive AIs, but it's decent to pick up later if no one has it yet.

Unlike the GL, the Pyramids are actually good for warmongers. It lets us build a settler for the 2nd city while continuing to grow our capital, then develop both cities with improvements faster than normal. These are great bonuses for a classical-era rush. I try to get at least 1 wonder in most conquest games. I go for the Pyramids if I start next to marble, or the Statue of Zeus if not. I might alternatively go for a specialized wonder if it supports a specific strategy, like the Temple of Artemis for Genghis Khan's keshik archers. Colossus can provide much-needed gold if my capital happens to be coastal.
  • Statue of Zeus
  • Pyramids
  • One of the circumstantial wonders:
    Great Lighthouse
    Temple of Artemis
    Colossus

Another advantage of encouraging an AI to get an early wonder is it delays their initial attack to the Classical era, which is usually more interesting and challenging for humans to fight off. GEM rewards unsuccessful wonder attempts with more gold than the base game, so it's lucrative to try to get a wonder, even if we don't succeed. This helps the AI, and encourages humans to keep playing if a key strategy falls apart.
 
The AI is oblivious to what's actually on technologies, so the priority of the GL itself has no effect on the AI's tech choices
Ok. I had assumed that what was available at techs also influenced tech priority.
 
Do the techs have their own AI priority then? Because they don't seem to show up on tooltips, otherwise that would be my next step to take a look at... Are these only in the files or how does the AI decide that?
 
Techs have their own AI priorities yes. I thought they did show up on tooltips before as I commented on things like Iron Working not having a slight production/tile flavor (for +1 mines/quarries and lumbermills).
 
Oh yes, I see. I was too stupid to notice on the techs :)

Having taken a look at the later eras, there seems to be so much change coming with the new and changed wonders, buildings, units and techs, that it doesn't make sense to take a look at priorities just now. I guess I'll wait for that, but there's the newer policy trees and early age techs:

Order loses Religion and Offense is deleted from Planned Economy, United Front and Labor Unions.
Labor Unions gains Naval_Tile_Improvement.
Socialism loses Happiness and Production (only lowered?)

Nationalism loses Religion (why do all late game trees have that?) and gains Happiness.
Militarism's Gold becomes higher.
Fascism gets more Culture?

Freedom gets Defense
Free Speech much lower Great People, bigger Culture and gets Tile_Improvement- (What about Gold? the policy gives culture on villages)
Universal Suffrage gets Tile_Improvement
Free Trade may get whatever helps Cooperating with other leaders (diplomacy?)
Immigration definately gets Diplomacy

Technologies
Why does Agriculture have a priority?
Pottery's Religion gets bigger (4)
Archery gets Defense and Wonder (?)
Sailing loses Wonder (old from Collossus?) and Happiness (because of the fishing boat?)
Calendar's Gold is lowered
Writing loses Diplomacy
Wheel loses Gold
Trade gets Diplomacy and maybe Mobile (Roads?), but loses Naval_Recon. [Btw. Is is possible to get a new Icon for the tech, or do we support Fox Trading? :)]
Bronze Working gets Expansion (reveal of Iron)
Masonry's Happiness is lowered?
Optics gets recon (scouts are recon units that want to traverse water)
Horseback Riding gets Happiness
Mathematics gets Defense
Iron Working gets Production and Tile_Improvement
Construction gets Growth (freaking Aquaeducts) and Culture (Terracotta Army)
Philosophy loses Culture and gets Diplomacy (if that priority applies also to Open Borders)
Drama and Poetry gets Tile_Improvement?
Currency gets Diplomacy (if that ...)
Engineering gets Mobile (if that priority applies also to Mobility of being faster over rivers - otherwise higher infrastructure...)
Guilds gets Defense (Defensive Treaties), Diplomacy? (Defensive Treaties) and whatever applies to Golden Ages?
Metal Casting gets Military_Training
Chivarly loses Diplomacy (as Defensive Treaties have been moved)
Astronomy gains Recon (and Diplomacy to meet the city States/Civs out in the ocean?)
Banking gains Espionage (or rather counter espionage?) and maybe Offense (related policies in NAtionalism and Order?)
Printing PRess gains Religion
Gunpoweder gains Defense?
Navigation gains low Naval_Tile_Improvement and maybe gold (depending on the role of the privateer)
Architecture gains Culture
Economics gets Tile_Improvement and Infrastructure

I'll stop here at the Industrial era, seems like the late game will change too much for the moment...
 
Hi

Just noticed that with 1.7.9 Stonehenge has FLAVOR_CULTURE. This is propably a leftover from old versions of the wonder. I think the standard G&K values are ok so the GEM changes should just be deleted.

\Skodkim
 
Notre Dame and Kremlin and Pyramids priorities seems to be off too (of course it might just be my lack of understanding).

\Skodkim
 
I'm working on a new design for many AI priorities in Gem v1.10.2.

In the old system, every priority for every unit, building, and tech must be tediously set by hand by a human developer. The new system automatically calculates priorities based on patterns. This greatly reduces human workload, especially when moving things around the tech tree, and reduces the chance of mistakes.

Units
The AI builds "offense" units to attack enemy territory, and "defense" units to defend friendly territory. Each multiplier stacks with others, so unique strategic units have 8 * 2 * 2 = 32 priority.
  • All priorities start at 8.
  • 200% priorities for unique units.
  • 200% priorities for strategic units.
  • 200% offense for siege.
  • 200% defense for archers, fighters, and bombers.
  • 50% defense for vanguards, siege, and strategic units.
  • 50% offense and defense for warrior, AA gun, AT gun, mobile SAM.
  • 25% offense and defense for carrier, conscript, airborne.

Technologies
  • Automatically set based on what the technology provides.
  • 8 flavor for common items (units, buildings, most improvements).
  • 4 flavor for limited or rare items (wonders, rare improvements).
  • Add up all items on the tech to get its basic priority.
  • After basic priorities are set, priorities ripple backwards in the tree to show the AI when techs lead to good stuff. Each tech gets 50% of the sum of the techs it leads to, with a minimum 4 priority.

For example, each of these techs have production flavor:
16 Iron Working (mine and lumbermill, 2x common improvements)
4 Masonry (quarries, rare improvement)
8 Mining (mines, common improvement)​

After determining those basic stats, the priorities ripple backwards.

16 Iron Working
8 Bronze Working (16/2 from Iron Working)
4 Masonry
14 Mining (8 + 8/2 from Bronze Working + 4/2 from Masonry)​

This tells the AI Mining and Iron Working are fantastic for production, Bronze Working is good, and Masonry is decent.
 
I really like that change. I was actually planning on working on something like that myself.

How does the new system work? I was doing the aforementioned manual changes and, well, it sucks hahaha.

One thing I'd look at is something that works really well for me that might for other people too. I prioritize happiness and workers through tile improvement, naval tile improvement, infrastructure (roads), and water connection the highest out of all the flavors for leaders.

This makes them staff a worker force, prioritize luxuries and happiness buildings and the result is a stronger economy and sustainable growth and expansion.

Regardless of the strategy they're using, conqueror or cultural alike, those two priorities are going to help them, not hurt them.

I just tried setting up a gold vs. production experiment and it's clear that gold kicks production so badly down the road it's embarrassing.

Some flavors I'm setting equal to each other on my next pass is setting gold, production, expansion, and growth equal to each other.

This way the AI looks at the terrain they are acquiring and ask if it's more in their best interest to keep settling, grow their cities, build villages, or set up some industry on the right terrain.

Production benefits plains / rivers, hills by water regions almost exclusively, while gold is adaptable to any terrain as long as you have enough food to work the tiles. This setup would have the AI intelligently specialize their cities for food and either gold or production and grow them, or not, accordingly.
 
How do the priorties ultimately work?

Does it always pick the task with the highest priority to do next, or is that priority further adjusted somewhere down the road?
 
I like this idea. I'm curious to see how it assigns flavors to buildings and wonders.

The outline of the units is largely favorable. Do bombers/fighters get any offensive value by being strategic units? and how's it handle ships?
 
Regarding jm22tb suggestions, am I correct that those would make the AI (much) more competitive? The caveat would be that we want the different leaders to play differently. But nevertheless, it'd probably be good to first set a "optimal priorities" for each of the playstyles (conqueror-civ, conqueror-cs, coalition, diplomat-culture and diplomat-science) and then differentiate from those on. Is it also possible to make the randomness larger (the deviation randomely done to each leader priority at the start of each game to make the AI leaders not that easy to be calculated in advance by the human).

I do agree that the AI seems to be awfully slow in connecting ressources and building infrastructure so any improvement there would be appreciated.

Regarding priorities. The new system does seem better, but I'd like to reiterate Stalker0's question. Take for example a situation where a conqueror goes down the military side, so each new tech available will have more priorities for him on that side. When will he or she (or it) research f.e. Philosophy and Sailing?

On your list, Thal, naval units are missing. How is that influenced since naval superiority can be quite important with our changes to naval warfare right now? Exploration is equal to Offense priority, correct?

Wonders and Buldings have still to be set manually, right?
 
I love this. Automating things like this is definately the way to go if you can spend the time on it. Would love here how the system will make each leader unique still.
 
What about wonders, buildings etc that are from other mods - will they automatically be taken into account?

/ skodkim
 
What about wonders, buildings etc that are from other mods - will they automatically be taken into account?

/ skodkim

This was what I was wondering, if it can automatically generate a value based on what it does (improves production=production flavor, some space race value for wonders, some military or expansion value, or something). If there's some kind of formula involved that will create reasonable values or if we're still dealing with manual inputs.
 
I love this. Automating things like this is definately the way to go if you can spend the time on it. Would love here how the system will make each leader unique still.

I would expect that the leader AI priorities are still different than the unit/tech/building priorities and could be slotted in a particular way to produce, say, a stronger navy and coastal empire for Elizabeth or Dido, on top of any UU effects.
 
This was what I was wondering, if it can automatically generate a value based on what it does (improves production=production flavor, some space race value for wonders, some military or expansion value, or something). If there's some kind of formula involved that will create reasonable values or if we're still dealing with manual inputs.


Yep. And what if the wonder mod runs after gem/up. Guess that would certainly be a problem then.

Skodkim
 
Regarding jm22tb suggestions, am I correct that those would make the AI (much) more competitive? The caveat would be that we want the different leaders to play differently. But nevertheless, it'd probably be good to first set a "optimal priorities" for each of the playstyles (conqueror-civ, conqueror-cs, coalition, diplomat-culture and diplomat-science) and then differentiate from those on. Is it also possible to make the randomness larger (the deviation randomely done to each leader priority at the start of each game to make the AI leaders not that easy to be calculated in advance by the human).

I do agree that the AI seems to be awfully slow in connecting ressources and building infrastructure so any improvement there would be appreciated.

Regarding priorities. The new system does seem better, but I'd like to reiterate Stalker0's question. Take for example a situation where a conqueror goes down the military side, so each new tech available will have more priorities for him on that side. When will he or she (or it) research f.e. Philosophy and Sailing?

On your list, Thal, naval units are missing. How is that influenced since naval superiority can be quite important with our changes to naval warfare right now? Exploration is equal to Offense priority, correct?

Wonders and Buldings have still to be set manually, right?

The reason I put the optimal priorities there is so that there are some fundamentals that are addressed first before moving to the victory strategies.

My own setup has workers, happiness at the top. Growth, expansion, naval growth, production, and gold are next.

Every victory plan needs to have a well managed, happy population that is productive and making gold per turn and a strong labor force.
 
You can see how priorities work in the old AI Priorities thread.

@jma22tb
The AI purchase system I created in GEAI_Events.lua automatically encourages the AI to have 1 worker per city, so I don't need to set the tile_improvement flavor separately. It also prioritizes happiness buildings based on the current happiness level of the empire.
 
Back
Top Bottom