Awwwwwwesome. Thank you all very much for your hard work! You should pester somebody to put an announcement on the main CivFanatics page and get a link in the War Academy. Maybe Kossin (as a CFC staff member) is the person to make the request? And at the risk of being greedy, are there plans to package all this info in a pdf file for printing?You could easily fit two pages on one sheet, maybe even 4. We older digital non-native types prefer things on paper, you know.
(And thanks again to dj anion for his guide, not least for his absolutely professional layout and graphic design. It's been my primary reference for several years.)
Really excellent
If you'd like, there are a few AI for whom I can write an analysis. This or these can then be tweaked and changed by you guys, or rejected entirely. I'd be fine with analyzing:
Charlemagne
Elizabeth
Gilgamesh
Hammurabi
Isabella
Julius Caesar
Justinian
Mehmed II
Montezuma
Shaka
Tokugawa
Wang Kong
Willem
I wouldn't want to do more than two. Maybe Willem and one other?
I've tried to see if there were a specific XML value that determines the weigh of certain units; yes there is one to my surprise. Was sad afterwards there is not a single UNITAI_SETTLE (that is settlers). That would explain Zara, Gilgamesh and most non-IMP expands so much.
There's likely no singular parameter that defines super expanders other than a combination of win parameters:
- Land Quality: Faster opening means faster expansion.
- Creative: AI city locations are pretty stiff and creative permits to ease settlements that leave resources outside inner culture ring. Imagine an AI doing that and avoiding Mysticism for a long time; no better to thwart itself.
- UnitProb: Obvious parameter and most ultra ReXer have high unitprobs.
- WonderRand: Wonderhoggers tend to cripple themselves. Big investments in the wrong time period. E.G. Ramesses.
- Trait: IMP. Obvious is obvious.
- Peaceweight: Mid peaceweights tend to help the AI to avoid crippling wars and to make friends on both bad faction and good one for more trade possibilities.
- Starting techs: depending of the difficulty level, some techs are indeed not helping the AI to expand fast. A noble Izzy will beeline stupid religion and while having corns, she delays her expansion. On deity, she receives many freebee techs for a total of Fising, Wheel, Agri, Mysticism, Hunting, Archery. That helps a lot to alleviate her unbalanced script.
- Flavors: Help the AI to focus on certain units, buildings or techs goal.
My goal was to see if there's a way to rank AI's in term of Rexing. That should help the inexperienced player if REXing hard is that important.
IMP leaders are obvious, but cases like Zara are definitely harder to understand without in-game experience.
int CvPlayerAI::AI_getCloseBordersAttitude(PlayerTypes ePlayer) const
{
if (m_aiCloseBordersAttitudeCache[ePlayer] == MAX_INT)
{
int iPercent;
if (getTeam() == GET_PLAYER(ePlayer).getTeam() || GET_TEAM(getTeam()).isVassal(GET_PLAYER(ePlayer).getTeam()) || GET_TEAM(GET_PLAYER(ePlayer).getTeam()).isVassal(getTeam()))
{
return 0;
}
iPercent = std::min(60, (AI_calculateStolenCityRadiusPlots(ePlayer) * 3));
if (GET_TEAM(getTeam()).AI_isLandTarget(GET_PLAYER(ePlayer).getTeam()))
{
iPercent += 40;
}
m_aiCloseBordersAttitudeCache[ePlayer] = ((GC.getLeaderHeadInfo(getPersonalityType()).getCloseBordersAttitudeChange() * iPercent) / 100);
}
return m_aiCloseBordersAttitudeCache[ePlayer];
}
int CvPlayerAI::AI_calculateStolenCityRadiusPlots(PlayerTypes ePlayer) const
{
PROFILE_FUNC();
CvPlot* pLoopPlot;
int iCount;
int iI;
FAssert(ePlayer != getID());
iCount = 0;
for (iI = 0; iI < GC.getMapINLINE().numPlotsINLINE(); iI++)
{
pLoopPlot = GC.getMapINLINE().plotByIndexINLINE(iI);
if (pLoopPlot->getOwnerINLINE() == ePlayer)
{
if (pLoopPlot->isPlayerCityRadius(getID()))
{
iCount++;
}
}
}
return iCount;
}
bool CvTeamAI::AI_isLandTarget(TeamTypes eTeam) const
{
if (!AI_hasCitiesInPrimaryArea(eTeam))
{
return false;
}
if (AI_calculateAdjacentLandPlots(eTeam) < 8)
{
return false;
}
return true;
}
bool CvTeamAI::AI_hasCitiesInPrimaryArea(TeamTypes eTeam) const
{
CvArea* pLoopArea;
int iLoop;
FAssertMsg(eTeam != getID(), "shouldn't call this function on ourselves");
for(pLoopArea = GC.getMapINLINE().firstArea(&iLoop); pLoopArea != NULL; pLoopArea = GC.getMapINLINE().nextArea(&iLoop))
{
if (AI_isPrimaryArea(pLoopArea))
{
if (GET_TEAM(eTeam).countNumCitiesByArea(pLoopArea))
{
return true;
}
}
}
return false;
}
A simple summary about "Close borders spark tensions between our nations!".
Based on XML constants defined individually for each leader and defines their territorial instinct.
Those XML constants are modified by 2 modifiers:
- Add 40 is we are a land target. It's prolly the definition of being an accessible target for war.
It's basically fulfilling two conditions: sharing 8 or more tiles and having cities in their primary lands, that is either their capital+cities or a group of three cities. (Still need to delve into those concepts though)- A minimum function that either returns the number of stolen BFC tiles from an AI (outside are not counted) and is maxed out to 60. Each stolen tile are worth three times in percentage up 60% as I did mention. If the count tiles give 61, then 60 is returned because min function returns the lowest value.
Indeed, 40+60 equals 100% if you have figured it out.
It is possible to be culturally crushed, but still annoy the AI!
Yes, that 40 coming from land target definition (mostly pangaea mapscript for instance) makes the least tolerant AI's to be already pissed off.
Here are the XML values: red ones are those who will be pissed off by your presence if you're a valid land target.
Spoiler :ALEXANDER: -4
ASOKA: -2
AUGUSTUS: -4
BISMARCK: -4
BOUDICA: -3
BRENNUS: -2
CATHERINE: -4
CHARLEMAGNE: -3
CHURCHILL: -2
CYRUS: -2
DARIUS: -2
DE GAULLE: -2
ELIZABETH: -3
FREDERICK: -2
GANDHI: -2
GENGHIS KHAN: -4
GILGAMESH: -3
HAMMURABI: -2
HANNIBAL: -3
HATSHEPSUT: -2
HUAYNA CAPAC: -3
ISABELLA: -3
JOAO: -2
JULIUS CAESAR: -4
JUSTINIAN: -4
KUBLAI KHAN: -3
LINCOLN: -2
LOUIS XIV: -4
MANSA MUSA: -2
CHINESE LEADER: -2
MEHMED: -2
MONTEZUMA: -4
NAPOLEON: -3
PACAL: -2
PERICLES: -2
PETER: -3
QIN SHI HUANG: -4
RAMESSES: -2
RAGNAR: -2
FRANKLIN ROOSEVELT: -3
SALADIN: -3
SHAKA: -4
SITTING BULL: -4
STALIN: -2
SULEIMAN: -2
SURYAVARMAN: -3
TOKUGAWA: -3
VICTORIA: -2
WANGKON: -2
WASHINGTON: -2
WILLEM VAN ORANJE: -1
ZARA YAQOB: -2
Why mainly those with max -3 or -4 negmods.
40% of those two numbers respectively give -1.2 and -1.6.
Both numbers are rounded down because the game only deals with integers.
So, those AI's are angry even without grabbing their land culturally. Those jerks...
================================================================
Here's the source code about attitude change coming from close borders.
Spoiler :Code:int CvPlayerAI::AI_getCloseBordersAttitude(PlayerTypes ePlayer) const { if (m_aiCloseBordersAttitudeCache[ePlayer] == MAX_INT) { int iPercent; if (getTeam() == GET_PLAYER(ePlayer).getTeam() || GET_TEAM(getTeam()).isVassal(GET_PLAYER(ePlayer).getTeam()) || GET_TEAM(GET_PLAYER(ePlayer).getTeam()).isVassal(getTeam())) { return 0; } iPercent = std::min(60, (AI_calculateStolenCityRadiusPlots(ePlayer) * 3)); if (GET_TEAM(getTeam()).AI_isLandTarget(GET_PLAYER(ePlayer).getTeam())) { iPercent += 40; } m_aiCloseBordersAttitudeCache[ePlayer] = ((GC.getLeaderHeadInfo(getPersonalityType()).getCloseBordersAttitudeChange() * iPercent) / 100); } return m_aiCloseBordersAttitudeCache[ePlayer]; }
Here's the strip of code calculating stolen plots.
Spoiler :Code:int CvPlayerAI::AI_calculateStolenCityRadiusPlots(PlayerTypes ePlayer) const { PROFILE_FUNC(); CvPlot* pLoopPlot; int iCount; int iI; FAssert(ePlayer != getID()); iCount = 0; for (iI = 0; iI < GC.getMapINLINE().numPlotsINLINE(); iI++) { pLoopPlot = GC.getMapINLINE().plotByIndexINLINE(iI); if (pLoopPlot->getOwnerINLINE() == ePlayer) { if (pLoopPlot->isPlayerCityRadius(getID())) { iCount++; } } } return iCount; }
AI_isLandTarget() function is getting deeper:
Spoiler :
Basically saying we are a possible land target for war if we have cities in his primary area AND we have 8 of more tiles bordering his.
Why the need to fulfill both conditions is simply if one is fulfilled, the function return "we are not a land target". Take it like doors you have to pass through, so the function can return "true".
Code:bool CvTeamAI::AI_isLandTarget(TeamTypes eTeam) const { if (!AI_hasCitiesInPrimaryArea(eTeam)) { return false; } if (AI_calculateAdjacentLandPlots(eTeam) < 8) { return false; } return true; }
!AI_hasCitiesInPrimaryArea(eTeam) means hereunder function returns false, and without pushing too far the "infinite" serie of called functions, it means we do not have cities in his primary area. Supposedly, a primary area is defined by either capital or a group of 3 cities. I need to search further, but I won't in the short term.
If we get AI_hasCitiesInPrimaryArea=true and enough adjacent tiles, then we are a land target.
Code:bool CvTeamAI::AI_hasCitiesInPrimaryArea(TeamTypes eTeam) const { CvArea* pLoopArea; int iLoop; FAssertMsg(eTeam != getID(), "shouldn't call this function on ourselves"); for(pLoopArea = GC.getMapINLINE().firstArea(&iLoop); pLoopArea != NULL; pLoopArea = GC.getMapINLINE().nextArea(&iLoop)) { if (AI_isPrimaryArea(pLoopArea)) { if (GET_TEAM(eTeam).countNumCitiesByArea(pLoopArea)) { return true; } } } return false; }
Code:
14) Attitude Thresholds are the diplomatic relations you must reach with an AI before they will perform a certain action. Please note that unusual cases like Gandhi who is always willing to trade techs doesn't apply if you are his worst enemy. When an AI is annoyed at you, then you are potentially their worst enemy unless they hate somebody else more. So Gandhi will trade techs with you at Furious only if he is more furious with somebody else. Also, a vassal is freed from all attitude thresholds and will do whatever you wish.
Tech trades required to receive +1 "shared your technological discoveries with us"
This item requires the player to trade a certain # of technologies to the AI which varies with each AI. The thresholds occur at:
5
7
10
20
I noticed several AIs requiring 10 technologies in this article, whereas the XML file implies only 7. The AIs affected (* = big maybe I'm wrong) include:
Boudica*
Catherine*
Elizabeth
Frederick
Gilgamesh*
Hannibal*
Joao II*
Justinian I*
Kubai Khan*
Lincoln
Montezuma*
Willem v Oranje*
The * (asterisk) indicates AIs that I haven't personally tested against enough to verify the threshold. I'm almost certainly wrong about the one's with an asterisk behind them, but I know for certain that the technology threshold for Elizabeth, Frederick and Lincoln is only 7. ...