Switching the capital - sense or nonsense?

Cybah

Emperor
Joined
Jun 22, 2007
Messages
1,481
Switching the capital - sense or nonsense?

Thoughts?

I know it's complicated. Factors:

- Commerce
- Production
- Maintenance
(- Strategic factors like the place of the city on the map)
 
It already switches capitals under some circumstances. In my current game the Dutch swithced their capital from one continent to another. Their oldest cities (seven cities) occupied about half a continent, controlling some 18 resources. Then they discovered another continent, and settled eight new cities, controlling 15 resources. I'm not sure when they made the switch. They lost one old city to an enemy, but Amsterdam would never have been conquered or threatened, by the look of the city layout.

Now, their new capital is Haarlem, which is the tenth city on their city list. So for some reason the AI decided that it was a smart move to switch to the new continent.

But... in the course of the game, the Netherlands decides to make a vassal and release the Americans IN THEIR OLD TERRITORY! George Washington now has his capital in Amsterdam! The Americans have the larger population (75) and more resources (18) versus the Netherlands pop (57) and resources (15). The Netherlands have more cities, though, but I'd say their new territory is worse.

This reverse United States doesn't make sense in my book. Had the AI never switched capitals, it would have made perfect sense, though! :D
 
I've seen Japan on Earth18 switch the capital to an Australian city.
 
I've never seen this. Maybe its only on maps with more than 1 continent?
 
I have seen the AI to move capitals, but only when they have extensive possessions in other land masses and the can't/don't want to release colonies. Never saw them doing that besides those conditions. That implies that there is some kind of changing cap mechanics under the hood, but probably could be fine tuned.......
 
I have also seen a civ switch capitals to an overseas area and then "free" its homeland ... it is truly weird.

There is a capital changing logic based purely on the number of cities in the new versus old area. It's in CvCityAI::AI_chooseProduction:

Code:
	if (!bDanger && !bIsCapitalArea && area()->getCitiesPerPlayer(getOwnerINLINE()) > iNumCapitalAreaCities)
	{
		if (AI_chooseBuilding(BUILDINGFOCUS_CAPITAL, 15))
		{
			return;
		}
	}

The 15 is for a maximum of 15 turns, so the AI is not doing some complex calculation to pick a new capital ... once the colony has more cities, the first colonial city able to build a palace in 15 turns or less is the new capital.

I haven't found any other code which handles building a new palace.
 
In the game above, it has turned out to be a horrible decision by the AI. The Netherlands were in the lead when they split in two, now they're last (but retains America as its vassal).

EDIT: In fact, I would suggest that the decision should not be based purely on the number of cities, but take into consideration the population of those cities, and possibly the number of resources controlled.
 
Another option would be to look at "if I moved the capital here, how much would I save in maintenance costs right now".

Then balance that against the hammer and turn cost of moving the capital.

The benefit of that approach is that it would both pull off the 'move continents' and the 'move within continent', and also teach the AI not to move the capital if you have a low distance-from-capital maintenance.

Finally, you could factor in the bonus commerce from things like bureaucracy in an organic way. You would see the AI moving capitals to kick-ass cities when they switched to bureaucracy quite often if written right!

The what-if would go something like:
1> Calculate the "distance from capital" currently.
2> Calculate the commerce at the capital currently.
3> Do the same for the new capital.

Work out a 'value' for hammers, and a delay-cost threshold multiplier (ie, don't move the capital to a city with 2 hammers, even if it is in the best location possible). If the price of the hammers is low compared to the amount saved per turn, move the capital.
 
Top Bottom