Great General AI

Cybah

Emperor
Joined
Jun 22, 2007
Messages
1,481
... is uber bad. :rolleyes:

In some mods, great generals can construct more than one type of building (history in the making: armory + military academy). But the AI will NEVER build more than one type: neither in one city, nor in different cities.

Also: The AI will stack the 2nd great general up to the XXXXth great general into the city with one of these two buildings... which seems to be the capital... everytime.

It looks like, the AI will use every great general for only ONE picked city.

The AI is even not able to build a military academy in more than one good production city.
 
I dont think its within the scope of this project to be looking at mods. If the AI is bad in a particular mod thats the mod makers problem.

Are you trying to say sometimes the AI uses a great general to produce a military academy then add great generals as great people to the city allowing it to produce highly experienced units ?

Is nt this a good idea ? The only problem is it tends to be a capital city not a specialised military city.

You probably dont want to have too many military academy. 2 is probably enough for most games. Sometime highly experienced troops are worth more than lots of troops.
 
I dont think its within the scope of this project to be looking at mods. If the AI is bad in a particular mod thats the mod makers problem.

no, the AI is bad within every mod, even original bts. it was just an example that the AI seems to be broken.

Are you trying to say sometimes the AI uses a great general to produce a military academy then add great generals as great people to the city allowing it to produce highly experienced units ?

No. NOT sometimes. EVERYTIME.

Is nt this a good idea ? The only problem is it tends to be a capital city not a specialised military city.

The AI NEVER has a specialised city. You cannot compare human behavior with this.

You probably dont want to have too many military academy. 2 is probably enough for most games. Sometime highly experienced troops are worth more than lots of troops.

Same as above. This is absolutely wrong. This might be true for human players who got 1-3 production cities with endless military production. But the AI got NO specialized city. Therefore the AI should build a military academy in every "good" non-specialized production city.
 
Personally Im not completely sure this is a bad tatic. Many people add great generals to cities to create high EXP units (often with a MA).

The only thing I'd say is the AI should maybe build this in its highest production city that ISNT its capital. As the capital is often used for building wonders/markey/libaries etc rather than miltary units.
 
Personally Im not completely sure this is a bad tatic. Many people add great generals to cities to create high EXP units (often with a MA).

The only thing I'd say is the AI should maybe build this in its highest production city that ISNT its capital. As the capital is often used for building wonders/markey/libaries etc rather than miltary units.

This is why it's worth looking into ... the civ AI has no explicit central planner, it's inappropriate to analyze it in the same way as a human strategy. Cities have no real defined roles in an AI empire and build decisions aren't currently influenced by whether the city produces units with extra experience or not (well, except for a couple places added in this mod ;) )

All the separate AI pieces (unit moving to good city to build/settle, city recognizing unique bonuses when making build decisions) have to be coordinated to produce something imitating intelligent behavior.
 
Somewhat related... how does the AI decide to build national wonders... like the Heroic Epic?

I can't tell you how many times I've scoured an AI's territory and could never find one, even in the late game (and I can see they have Level4 units). This is particularly bad for warmongers like Napoleon or Kublai.

Almost as bad, I've played BetterAI games and made a permanent alliance with someone like Zara, only to :rolleyes: when he starts building his oxford in a city with very little commerce or specialist potential (mostly plains).

FYI, I occasionally do see generals settled in non-capitals... but I'm usually beelining their capital because this is statistically seems to be where they get settled.
 
A settled Great General plus a barracks = units that start out with two experience improvements. I always settle my first Great General in my biggest production city. Bad strategy? (I can't win at Emporer level, so maybe I don't know what I'm doing.)
 
Won't it be a good strategy for the AI to use its first GG to join its most powerful unit as a Warlord, promote it with Leadership (and possible Tactics) and use it to gather lots of XP/GG points to get a second GG quickly? If the AI could actually take care of that unit, of course. I don't know whether it can protect a unit and not send it to suicide missions.

At least, even if the AI won't quite value its life, I would still like to face a powerful Warlord unit for a change. Haven't seen one in Vanilla BTS yet.
 
Might also be interesting if the military civ's were more inclined to create a Warlord than the more peaceful civs. Could also depend on the type of war the civ was engaged in... lots of possibilities here! :)
 
Won't it be a good strategy for the AI to use its first GG to join its most powerful unit as a Warlord, promote it with Leadership (and possible Tactics) and use it to gather lots of XP/GG points to get a second GG quickly?

Which is also a good cheap way to get a high enough level unit for West Point, later. I don't know if it's proper strategy but I usually attach my first GG and then start settling them.
 
Won't it be a good strategy for the AI to use its first GG to join its most powerful unit as a Warlord, promote it with Leadership (and possible Tactics) and use it to gather lots of XP/GG points to get a second GG quickly?

I always wind up losing my Warlords in combat, so I assume the AI would do an even worse job of it.

A unit is NOT invincible just because you give it an extra 20 xp.

I understand that a common human strategy is to use the Warlord as a super-healer, and to keep it out of combat. I doubt that the AI is able to "think" about it in such a sophisticated manner.
 
I understand that a common human strategy is to use the Warlord as a super-healer, and to keep it out of combat. I doubt that the AI is able to "think" about it in such a sophisticated manner.
The AI isn't smart enough to leave a supermedic unupgraded and/or protect it by only using it to attack in "guaranteed" win situations. However, it should at least actually create supermedics because of changes Solver made in the Unofficial Patch which are included in BetterAI.
 
A bit off topic ... but let's roll with it:

In most unit AI functions, the AI doesn't treat experienced units any different than regular units ... there's no sheltering of veterans. In most of these functions, however, the AI has decent odds when it decides to attack. Creating special rules to protect great general units here seems wrong.

What looks promising though is when a group of AI units decides to make a stack attack. In CvSelectionGroup::groupAttack the AI picks a best attack, then the defense chooses its best defender. If the attacker sees odds of less than 68 percent, it choose a different unit to send into battle using CvSelectionGroup::AI_getBestGroupSacrifice ... a sacrificial attacker.

In the end the sacrificial attacker is which available unit in the stack has the highest CvUnitAI::AI_sacrificeValue. For land units, this is how that's calculated:

Code:
                iValue  = 128 * (currEffectiveStr(pPlot, ((pPlot == NULL) ? NULL : this)));
		iValue *= (100 + iCollateralDamageValue);
		iValue /= (100 + cityDefenseModifier());
		iValue *= (100 + withdrawalProbability());		
		iValue /= std::max(1, (1 + m_pUnitInfo->getProductionCost()));
		[B]iValue /= (10 + getExperience());[/B]

		if (m_pUnitInfo->getCombatLimit() < 100)
		{
			iValue *= 150;
			iValue /= 100;
		}

With this, a unit with 30 experience gets 1/4 the sacrifice value of a unit with 0. Production cost scales directly, 2x the hammers = 1/2 the sacrifice value. Also note that a unit with city attack or hill/forest attack promotions gets a proportional benefit if appropriate, no other promotions are counted.

This is one place we could make a change to increase the longevity of veteran units ... not sure whether it's a good idea or not yet.
 
How about a "utility" weight?

Stuff like medic is a utility ability. If you have a utility power that is locally rare, one should consider sheltering that unit.

And by sheltering, I mean "even if it is the best attack unit, if the next unit is nearly as good, think about using it".
 
To be honest I reckon they'd be better off settling them which is what they currently do. General AI combat mechanics need to be improved more urgently. Once these has been improved ie less suicide stacks from an improved odds calculator then the Great General AI should be looked at.
 
To be honest I reckon they'd be better off settling them which is what they currently do.

Yup, the GG should be settled, or used to build a military academy (if it would enable a city to build a military unit in one turn instead of two).

A GG should be attached to a unit only if the computer player currently has the technology to build a West Point, but lacks the requirement of a sufficiently experienced unit.
 
So I guess we'll dig this thread up since we're talking about GG things that I saw in 0.5 and 0.6 Better AI.

I think there are a few meta-strategies for how people use GGs:

1) Settle for +2 XP. Here, we settle the GG so that units get an additional +2 XP.

1a - Focused settling. All GGs end up in the city that produces the highest XP units. Over time, units could roll off the line with +10 XP from five GGs. The questions are whether there is diminishing returns past 3 GGs in a city and whether our best coastal city should be chosen.

- Roleplay wise, I would expect that Vikings (Ragnar) would prefer to settle GGs in their best coastal production cities for better ships. While leaders like Caesar would prefer land-based promotions.

- Assuming that the AI knows enough to build a barracks, stable, airport or drydock, there are two schools of thought here. The first is that units should enter battle at 4/5 or 9/10. If they survive, they will automatically be promoted to 5/5 or 10/10 and get both an upgrade and a heal. The other school of thought is that you should start at 5/5 or 10/10, so that you already have those upgrades out of the gate.

- Roleplay wise, I'm not sure which civs/leaders would prefer to settle 4-6 GGs in a single city for 8-12 XP bonus out of the gate. I think civs/leaders that prefer type '1a' should vary between settling 3-6 GGs in a single city.

1b - Spread settling.

In this case, we spread the wealth. Starting with our best military production city, we settle for +2. Then we put the next GG in the next-best military production city. Eventually, we should have half a dozen cities with settled GGs.

- Imperialistic might be a good choice here.

2) Settle for the military academy (+50% production).

- Industrious leaders might prefer this method once the Military Academy is available. Prior to that, settling GGs for +XP would probably be their backup plan.

3) Create a super-unit.

3a - Super Offensive unit

- I could envision aggressive civs choosing this method. Create a GG, put them in the SoD, and go for the neighbor's throat.

3b - Super Medic

- Protective civs might prefer to go this route. Put the super-medic in their SoD or reaction stack.
 
I'm not really an experienced civ player, but one thing I tend to do with great generals is attach them to a low xp obsolete unit, and then upgrade it for free per the attached GG's ability and then give it city raider promotions. I don't know if that would make much sense for the AI though, given that they have reduced upgrade costs.
 
The AI always has -50% upgrade costs (take a look at CIV4HandicapInfo.xml). Therefore, I don't think using the GG for an unit is the best way.

I think, we should do a ranking and ignore role play behavior. Better ships for example are imo not very useful. The goal is to make it harder to play versus the AI.

Imo, the AI should always go this way:

- build military academy in the best production city
- settle down 1 GG into that city

- build military academy in the next production city
- settle down 1 GG into that city

and so on. If every city has both: 1 GG and a MA, it should settle the next GG into the city with the best production, then settle the next GG into the next city and so on.

Using all GGs for only one city is imho not the best choice for the AI. There is a difference to human players. Human players will rescue high xp units. The AI will attack with them until they die.
 
Back
Top Bottom