AI palace movement

Tatran

Deity
Joined
Aug 23, 2002
Messages
4,184
In civ1, civ2 and smac the palace/headquarters was destroyed when the capital was captured + no revolution/splitting the empire into an old and new civ occured.
I can't remember the situation in civ3 and I haven't seen the AI moving its palace in civ4, until this game.
Btw, the Inca and Babylon were 2 of my colonies.

Spoiler :




 
I had a couple of AIs changing palace and granting independance to their former (original) territory!!!
It is indeed rare anyhow.
 
It must do some kind of upkeep calculation; Huayna probably had his Forbidden Palace in his home territories and, faced with huge colonial costs, decided to move out and personally clamp down on corruption.

Tangentially, I do think there's an argument the FP should play a secondary role as the anchor for where your Palace will relocate in the event of the capital falling.

I once relocated my capital to a small-ish offshore island. It had built Artemis and I'd got GLH, and I was wondering if it'd make a commerce monster. (It didn't)
 
I have seen the AI move its palace multiple times, it seems to do it when the majority of its cities (or perhaps the largest cities, I dunno how exactly it makes the calculation) are on a different continent from where its original capital is.
 
Maybe this is slightly hijacking the thread:

It seems like that when an AI capital is captured, they are given a new palace in another city? Is this how it should be or is the AI cheating?

Yes. I am a bit new to the game after all these years :)
 
Maybe this is slightly hijacking the thread:

It seems like that when an AI capital is captured, they are given a new palace in another city? Is this how it should be or is the AI cheating?

Yes. I am a bit new to the game after all these years :)

Nope, that's how it works, if you're in the game you get a Palace automatically. If an AI were to capture your capital you'd also instantly get another one, I think in your largest city although I'm not 100% sure how the game chooses which city is the next capital.
 
Nope, that's how it works, if you're in the game you get a Palace automatically. If an AI were to capture your capital you'd also instantly get another one, I think in your largest city although I'm not 100% sure how the game chooses which city is the next capital.

I'm almost certain the city with most culture gets the new palace.
 
I'm almost certain the city with most culture gets the new palace.

Its a bit more complicated than that ;)

PHP:
            if (0 == pLoopCity->getNumRealBuilding(eCapitalBuilding))
            {
                iValue = (pLoopCity->getPopulation() * 4);

                iValue += pLoopCity->getYieldRate(YIELD_FOOD);
                iValue += (pLoopCity->getYieldRate(YIELD_PRODUCTION) * 3);
                iValue += (pLoopCity->getYieldRate(YIELD_COMMERCE) * 2);
                iValue += pLoopCity->getCultureLevel();
                iValue += pLoopCity->getReligionCount();
                iValue += pLoopCity->getCorporationCount();
                iValue += (pLoopCity->getNumGreatPeople() * 2);

                iValue *= (pLoopCity->calculateCulturePercent(getID()) + 100);
                iValue /= 100;

                if (iValue > iBestValue)
                {
                    iBestValue = iValue;
                    pBestCity = pLoopCity;
                }
            }
 
Its a bit more complicated than that ;)

Oohoh!! That's why I reserved the word "almost" in my statement.. haha! Thanks Vincentz.

It seems cul ture has a plain (1) ponderation compared to GP, pop and others, maybe it is because it's absolute number is already high in the sum, as I managed to realize it seems to be indeed the major aspect within the choice.
 
Its a bit more complicated than that ;)

PHP:
            if (0 == pLoopCity->getNumRealBuilding(eCapitalBuilding))
            {
                iValue = (pLoopCity->getPopulation() * 4);

                iValue += pLoopCity->getYieldRate(YIELD_FOOD);
                iValue += (pLoopCity->getYieldRate(YIELD_PRODUCTION) * 3);
                iValue += (pLoopCity->getYieldRate(YIELD_COMMERCE) * 2);
                iValue += pLoopCity->getCultureLevel();
                iValue += pLoopCity->getReligionCount();
                iValue += pLoopCity->getCorporationCount();
                iValue += (pLoopCity->getNumGreatPeople() * 2);

                iValue *= (pLoopCity->calculateCulturePercent(getID()) + 100);
                iValue /= 100;

                if (iValue > iBestValue)
                {
                    iBestValue = iValue;
                    pBestCity = pLoopCity;
                }
            }

So, er, could you explain what this means to an illiterate peasant such as myself?
 
So, er, could you explain what this means to an illiterate peasant such as myself?
Sure :D

It loops through all the cities. If one of them have been a capital before, it will have highest priority (code not shown. comes before what I posted). If no then it will give values to cities depending on size, culture level, culture percent, etc. The one with the highest value becomes new capital.

getPopulation() * 4); SIZE OF CITY x 4
getYieldRate(YIELD_FOOD); NUMBER OF FOOD ON TILES IN BFC
getYieldRate(YIELD_PRODUCTION) * 3); NUMBER OF HAMMERS ON TILES IN BFC x 3
getYieldRate(YIELD_COMMERCE) * 2); NUMBER OF COMMERCE ON TILES IN BFC x 2
getCultureLevel(); # OF CULTURE LEVEL :
<Type>CULTURELEVEL_NONE</Type> 1
<Type>CULTURELEVEL_POOR</Type> 2
<Type>CULTURELEVEL_FLEDGLING</Type> 3
<Type>CULTURELEVEL_DEVELOPING</Type> 4
<Type>CULTURELEVEL_REFINED</Type> 5
<Type>CULTURELEVEL_INFLUENTIAL</Type> 6
<Type>CULTURELEVEL_LEGENDARY</Type> 7
(actually not sure if NONE is 0 and POOR is 1 etc or NONE is 1 and POOR is 2 etc)

getReligionCount(); HOW MANY RELIGIONS IN CITY
getCorporationCount(); HOW MANY CORPORATIONS IN CITY
getNumGreatPeople() * 2); HOW MANY SETTLED GREAT PEOPLE x 2 IN CITY

calculateCulturePercent(getID()) + 100); HOW BIG A PERCENTAGE OF THE CULTURE IS OWN CULTURE ((0-100%) + 100) /100 AND THEN MULTIPLIED TO THE VALUE OF ALL THE OTHERS

Sorry for caps, but easier to see I guess ;)

The last is very important. F.ex. if one city have value 200 and 0% own culture and a second city have value 101 and 100% own culture the second one will become capital (1st: 200 x 1 < 2nd: 101 x 2)
 
Ok, very interesting! Thank you! I always knew it had to be some complicated multi-factoral process that picked the next capital, because having seen it happen a lot (yeah I capture a lot of AI capitals, this impresses lots of girls btw) I could never reason out a consistent rule or rules from observations.
 
Hmm. Do Sushi and Cereal Mills add to YIELD_FOOD?
 
Top Bottom