Can you explain the empire rating mechanic in more detail? I'm not quite clear on all the factors.
## EMPIRE ##
print "EMPIRE"
# balance of core and empire populations, mitigated by courthouses and civics
iEmpireRating = 0
bExiled = True
for regionID in utils.getCoreRegions(iCiv):
if (utils.checkRegionOwnedCity(iPlayer, regionID)):
bExiled = False
if not (utils.checkRegionControl(iPlayer, regionID)):
iEmpireRating -= 3
print "core province not controlled"
if bExiled:
print "Exiled"
if utils.getYear() > tFall[iCiv]:
self.terminalCrisis(iPlayer, iCiv, pPlayer, pTeam)
else:
iEmpireRating -= 6
iCorePop = 0
iEmpirePop = 0
for pLoopCity in apCityList:
if not pLoopCity.isNone():
if pLoopCity.GetCy().isCapital():
iCorePop += pLoopCity.getPopulation() * 3
else:
regionID = gc.getMap().plot(pLoopCity.GetCy().getX(),pLoopCity.GetCy().getY()).getRegionID()
if regionID in utils.getCoreRegions(iCiv) or regionID in utils.getSpecialRegions(iCiv):
iCorePop += pLoopCity.getPopulation() * 2
else: regionID in utils.getNormalRegions(iCiv):
iFactor = 1
if not ((iCivicGovernment == iTheocracyCivic) and (pLoopCity.GetCy().isHasReligion(iStateReligion))):
if iCivicGovernment != iEmpireCivic: iFactor += 1
if not (iCivicLegal == iBureaucracyCivic):
iFactor += 1
if not (pLoopCity.GetCy().getNumRealBuilding(iCourthouse)):
iFactor += 1
if not regionID in utils.getNormalRegions(iCiv):
iFactor += 1
iEmpirePop += pLoopCity.getPopulation() * iFactor
print ("iCorePop=", iCorePop, "iEmpirePop=", iEmpirePop)
if iCorePop > iEmpirePop *2: iEmpireRating += 2
elif iCorePop > iEmpirePop: iEmpireRating += 1
elif iCorePop *5 < iEmpirePop: iEmpireRating -= 5
elif iCorePop *4 < iEmpirePop: iEmpireRating -= 4
elif iCorePop *3 < iEmpirePop: iEmpireRating -= 3
elif iCorePop *2 < iEmpirePop: iEmpireRating -= 2
elif iCorePop < iEmpirePop: iEmpireRating -= 1
if (pPlayer.getNumCities()) * 2 < (sd.getNumCities(iPlayer)):
iEmpireRating -= 3
print "high city losses"
elif (pPlayer.getNumCities()) * 3 < (sd.getNumCities(iPlayer)) * 2:
iEmpireRating -= 2
print "med city losses"
elif pPlayer.getNumCities() < sd.getNumCities(iPlayer):
iEmpireRating -= 1
print "some losses"
print ("iEmpireRating=", iEmpireRating)
Just a little thing that I find strange: why Tyre still exist? I think it has been destroyed by Alexander. Otherwise, Xiongnu and Xianbei are cool adds.
here it is:
Spoiler :Code:## EMPIRE ## print "EMPIRE" # balance of core and empire populations, mitigated by courthouses and civics iEmpireRating = 0 bExiled = True for regionID in utils.getCoreRegions(iCiv): if (utils.checkRegionOwnedCity(iPlayer, regionID)): bExiled = False if not (utils.checkRegionControl(iPlayer, regionID)): iEmpireRating -= 3 print "core province not controlled" if bExiled: print "Exiled" if utils.getYear() > tFall[iCiv]: self.terminalCrisis(iPlayer, iCiv, pPlayer, pTeam) else: iEmpireRating -= 6 iCorePop = 0 iEmpirePop = 0 for pLoopCity in apCityList: if not pLoopCity.isNone(): if pLoopCity.GetCy().isCapital(): iCorePop += pLoopCity.getPopulation() * 3 else: regionID = gc.getMap().plot(pLoopCity.GetCy().getX(),pLoopCity.GetCy().getY()).getRegionID() if regionID in utils.getCoreRegions(iCiv) or regionID in utils.getSpecialRegions(iCiv): iCorePop += pLoopCity.getPopulation() * 2 else: regionID in utils.getNormalRegions(iCiv): iFactor = 1 if not ((iCivicGovernment == iTheocracyCivic) and (pLoopCity.GetCy().isHasReligion(iStateReligion))): if iCivicGovernment != iEmpireCivic: iFactor += 1 if not (iCivicLegal == iBureaucracyCivic): iFactor += 1 if not (pLoopCity.GetCy().getNumRealBuilding(iCourthouse)): iFactor += 1 if not regionID in utils.getNormalRegions(iCiv): iFactor += 1 iEmpirePop += pLoopCity.getPopulation() * iFactor print ("iCorePop=", iCorePop, "iEmpirePop=", iEmpirePop) if iCorePop > iEmpirePop *2: iEmpireRating += 2 elif iCorePop > iEmpirePop: iEmpireRating += 1 elif iCorePop *5 < iEmpirePop: iEmpireRating -= 5 elif iCorePop *4 < iEmpirePop: iEmpireRating -= 4 elif iCorePop *3 < iEmpirePop: iEmpireRating -= 3 elif iCorePop *2 < iEmpirePop: iEmpireRating -= 2 elif iCorePop < iEmpirePop: iEmpireRating -= 1 if (pPlayer.getNumCities()) * 2 < (sd.getNumCities(iPlayer)): iEmpireRating -= 3 print "high city losses" elif (pPlayer.getNumCities()) * 3 < (sd.getNumCities(iPlayer)) * 2: iEmpireRating -= 2 print "med city losses" elif pPlayer.getNumCities() < sd.getNumCities(iPlayer): iEmpireRating -= 1 print "some losses" print ("iEmpireRating=", iEmpireRating)
in plain english:
multiply capital population by 3
multiply each core city population by 2
add them up to get your core population
for each periphery city by "x"
"x" starts as 1 and goes up by 1 for:
NOT having a courthouse
NOT being in Empire or Theocracy (with state religion in the city) civic
NOT being in your border provinces
add them up to get your periphery population
the city losses part compares the number of cities you have now to the maximum number you ever had. you get a -1 to -3 based on how many cities you've lost.
The third Sassanid UHV requirement (legendary culture) isn't being checked.
Sassanid 2nd UHV doesn't check AT ALL!
EDIT: Running Arabia from 320 BCand they start with the settler in Siberia between mountains
![]()
All the late civs have the same problem. Waited for ~1 hour to start Chalukyas after 500 turns of AI developing India only to find a unit in a mountains.
all Sassanid goals check properly in my version
all Sassanid goals check properly in my version
Recently AI Rome seems to be really bad.
Though they start expanding to their historical areas really fast, there is a point that this expansion stops and their enemies push them back.
I have played games as the Bactrians, the Tocharians, Gojoseon and the Pandyans, so I have little or none communication with the west. In all these games, Romans hold only the southern part of Italy, and a few other cities around the Mediterranean (usualy Sicily, Rhodes and Cyprus). The northern part of Italy is always conquered by the Celts while the Parthians reach as far as Greece and Egypt.
The Romans also have significantly less units than their enemies, some times only an archer is defending their cities; The Partian army - full of their UUs and catapults - is usually conquering 1-2 cities per turn!
Finally they seem to park slaves in cities, instead of using them to rush buildings, or building improvements around the map or joining cities. The last is a general AI phenomenon, AI never join slaves in cities