Manipulating Puppet Build Priorities

swmaniac

Warlord
Joined
Apr 3, 2011
Messages
162
I haven't played in a while so there have been a few patches and I'd like to get back up to speed. I'm currently in a hot-seat game with a few friends and I've built myself a decent puppet empire.

Here's what I've noticed: All my puppets seem to focus on gold buildings exclusively.

While that's nice, I currently have 100+ GPT and 4 happiness (should be -4 but I imported some luxuries) and plan on expanding into the local runaway (Rome, with something like 10 cities now), so I'd like some happiness. I understand that's not my call, but I still find it strange that the AI decided to focus on what I arguably need the least.

So I have a few questions:

1) How does the AI determine what building to construct next?

If it's just a hard-coded build order I'm going to be a little disappointed. :rolleyes: I understand puppets are supposed to be somewhat out of control but they should make some attempt to help the empire.

2) If it isn't just a hard-coded list, how do I get the AI to recognize what I need?

I searched around the forums and found the list:

Gold > Culture > Defense > Happiness

3) Is this list correct? As I recall from before my break, happiness was almost top priority; now it seems to be dead last (also, where does science fall?).
 
I think it's gold, defense, science, culture with happiness falling anywhere between gold and culture depending on your happy level. So there is avway, sell your lux and go into unhappy and your puppets will start building happy stuff.

Is there anyone with detailed info or in game experience with this, I am quite curious mylsef.
 
Just make sure you are on negative Happiness when you you exit resitance or the Market completes, then the puppet city will build Circus/Colosseum/Theater ... and continue for as long as you're empire is not happy ... but it won't give you extra when your empire is already happy.
 
Rule of thumb for puppets is:

If there's a building that will generate gold, it will build that first.

If no building will do so, then it will look for a building with no maintenance cost. (Which is why walls/ castles are often built)

Next would be the building with the least per turn maintenance cost. *

* Barracks & Court House would never be built by a puppet; since it would never build units, its also hard coded not to build anything that would only grant XP. In addition, court houses are only allowed in an occupied city.

Should there be no building possible (extremely unlikely except in scenarios),the puppet will build wealth.

Happiness buildings are indeed higher priority for a puppet if on the turn it finishes a building the empire is unhappy; it doesn't queue buildings up, but only looks at what the current happiness situation is; it won't care about things such as several cities about to grow or a luxury deal happened to have lapsed for a turn.
 
It did not occur to me in the last weeks but 2 or 3 months ago a puppet which had nothing to build just did nothing. They did not choose wealth they just did nothing:)
Dont know if they patched this or i remember incorrectly but normally you dont get to this point ;)
 
Puppet Build Order is coded in CvGameCoreDLL_Expansion.dll, especially in CvCityStrategyAI.cpp.

Some code related to Puppet Cities:
Even if you don't know C++ like me, you can understand from the Comments (anything that starts with //)

Code:
// If the City is a puppet, it avoids Wonders (because the human can't change it if he wants to build it somewhere else!)
			if(GetCity()->IsPuppet())
			{
				const CvBuildingClassInfo& kBuildingClassInfo = pkBuildingInfo->GetBuildingClassInfo();

				if(isWorldWonderClass(kBuildingClassInfo) || isTeamWonderClass(kBuildingClassInfo) || isNationalWonderClass(kBuildingClassInfo) || isLimitedWonderClass(kBuildingClassInfo))
				{
					iTempWeight = 0;
				}
				// it also avoids military training buildings - since it can't build units
				if(pkBuildingInfo->GetDomainFreeExperience(DOMAIN_LAND))
				{
					iTempWeight = 0;
				}
				// they also like stuff that won't burden the empire with maintenance costs
				if(pkBuildingInfo->GetGoldMaintenance() == 0)
				{
					iTempWeight *= 2;
				}
				// and they avoid any buildings that require resources
				int iNumResources = GC.getNumResourceInfos();
				for(int iResourceLoop = 0; iResourceLoop < iNumResources; iResourceLoop++)
				{
					if(pkBuildingInfo->GetResourceQuantityRequirement(iResourceLoop) > 0)
					{
						iTempWeight = 0;
					}
				}
			}
			if(iTempWeight > 0)
				m_Buildables.push_back(buildable, iTempWeight);
		}
	}

	// If the City is a puppet, it avoids training Units and projects
	if(!GetCity()->IsPuppet())
	{
		// Loop through adding the available units
		for(iUnitLoop = 0; iUnitLoop < GC.GetGameUnits()->GetNumUnits(); iUnitLoop++)
		{
			// Make sure this unit can be built now
			if(iUnitLoop != eIgnoreUnit &&
			        //GC.GetGameBuildings()->GetEntry(iUnitLoop)->GetAdvisorType() != eIgnoreAdvisor &&
			        m_pCity->canTrain((UnitTypes)iUnitLoop))
			{
				buildable.m_eBuildableType = CITY_BUILDABLE_UNIT;
				buildable.m_iIndex = iUnitLoop;
				buildable.m_iTurnsToConstruct = GetCity()->getProductionTurnsLeft((UnitTypes)iUnitLoop, 0);

				iTempWeight = m_pUnitProductionAI->GetWeight((UnitTypes)iUnitLoop);

				CvUnitEntry* pkUnitEntry = GC.getUnitInfo((UnitTypes)iUnitLoop);
				if(pkUnitEntry && pkUnitEntry->GetDefaultUnitAIType() == UNITAI_SETTLE)
				{
					if(bEnoughSettlers)
					{
						iTempWeight = 0;
					}
					else
					{
						int iBestArea, iSecondBestArea;
						int iNumGoodAreas = kPlayer.GetBestSettleAreas(kPlayer.GetEconomicAI()->GetMinimumSettleFertility(), iBestArea, iSecondBestArea);
						if(iNumGoodAreas == 0)
						{
							iTempWeight = 0;
						}
					}
				}
}
 
If you plan to have a strong emphasis on puppets, some of the only "manipulation" you can do is to use a civ that replaces one of the buildings high on the priority list with their own UB. For example, Persia's bank UB gives happiness, while India's castle UB gives culture. This also means that the right side of Honor is perfectly suited to a puppet empire, as you can place garrisons yourself and walls are high priority for the governor.
 
Back
Top Bottom