It sure is weird...
Hmm... maybe you should change the buildSettlements rule a bit.
//========================================================== ====================
// RULE: buildSettlements
//========================================================== ====================
rule buildSettlements
minInterval 10
inactive
{
//Figure out if we have any active BuildSettlements.
int numberBuildSettlementGoals=aiGoalGetNumber(cGoalPlanGoalType BuildSettlement, cPlanStateWorking, true);
if (numberBuildSettlementGoals > 0)
return;
if (findASettlement() == false)
return;
int popCapBuffer=10;
int currentPopNeeds=aiGetPopNeeds();
int adjustedPopCap=kbGetPopCap()-popCapBuffer; //Dont do this unless we need the pop
if (currentPopNeeds < adjustedPopCap)
return;
//Dont get more than other players.
int numberSettlements=getNumberUnits(cUnitTypeAbstractSettlement, cMyID, cUnitStateAliveOrBuilding); //If we're on Easy and we have 3 settlements, go away.
if ((aiGetWorldDifficulty() == cDifficultyEasy) && (numberSettlements >= 3))
{
xsDisableSelf();
return;
} //Don't get too many more than our allies.
int largestAllyCount=0;
for (i=1; < cNumberPlayers)
{
if (i == cMyID)
continue;
if(kbIsPlayerAlly(i) == false)
continue;
int count=getNumberUnits(cUnitTypeAbstractSettlement, i, cUnitStateAliveOrBuilding);
if(count > largestAllyCount)
largestAllyCount=count;
}
//Count the one I want to build on.
numberSettlements=numberSettlements+1;
//Never have more than 2 more settlements than any ally.
int difference=numberSettlements-largestAllyCount;
if ((difference > 2) && (largestAllyCount!=0))
return; //See if there is another human on my team.
bool haveHumanTeammate=false;
for (i=1; < cNumberPlayers)
{
if(i == cMyID)
continue;
//Find the human player
if (kbIsPlayerHuman(i) != true)
continue; //This player is a human ally and not resigned.
if ((kbIsPlayerAlly(i) == true) && (kbIsPlayerResigned(i) == false))
{
haveHumanTeammate=true;
break;
}
}
if(haveHumanTeammate == true)
{
if (kbGetAge() == 2)
{
if (numberSettlements > 4)
return;
}
else if (kbGetAge() == 3)
{
if (numberSettlements > 5)
return;
}
} //Else, do it.
createBuildSettlementGoal("BuildSettlement", kbGetAge(), -1, kbBaseGetMainID(cMyID), 3, kbTechTreeGetUnitIDTypeByFunctionIndex(cUnitFunctionBuilder,0), true, 100);
}
Might want to reduce to this
//========================================================== ====================
// RULE: buildSettlements
//========================================================== ====================
rule buildSettlements
minInterval 10
active
{
//Figure out if we have any active BuildSettlements.
int numberBuildSettlementGoals=aiGoalGetNumber(cGoalPlanGoalType BuildSettlement, cPlanStateWorking, true);
if (numberBuildSettlementGoals > 0)
return;
if (findASettlement() == false)
return;
//Else, do it.
createBuildSettlementGoal("BuildSettlement", kbGetAge(), -1, kbBaseGetMainID(cMyID), 3, kbTechTreeGetUnitIDTypeByFunctionIndex(cUnitFunctionBuilder,0), true, 100);
}
Might work. I dunno...