Noted differences between latest RevDCM revision and BetterAI revision code
RevDCM revision 522
versus
BetterAI revision 586
--------------
-
CvCityAI.cpp-
--------------
RevDCM, line 2168:
Code:
if (AI_chooseBuilding(iEconomyFlags, 10, 25 + iWarTroubleThreshold, (bLandWar ? 50 : -1)))
BBAI, line 1893:
Code:
if (AI_chooseBuilding(iEconomyFlags, 10, 25 + iWarTroubleThreshold, (bLandWar ? 40 : -1)))
-----------------------------------------------------------------------------------------------------
RevDCM, line 2369:
Code:
if (AI_chooseUnit(UNITAI_ATTACK_SEA, bFinancialTrouble ? 20 : 50))
BBAI, line 2094:
Code:
if (AI_chooseUnit(UNITAI_ATTACK_SEA, (iUnitCostPercentage < iMaxUnitSpending) ? 50 : 20))
-----------------------------------------------------------------------------------------------------
RevDCM, line 2379:
Code:
if ((iUnitCostPercentage < iMaxUnitSpending + 5) || (2*iUnitsToTransport > 3*iTransportCapacity))
BBAI, line 2104:
Code:
if ((iUnitCostPercentage < iMaxUnitSpending) || (iUnitsToTransport > 2*iTransportCapacity))
---------------------
-
CvDLLWidgetData.cpp-
---------------------
RevDCM, line 4446 (missing code)
BBAI, line 4133 - 4178:
Code:
// Show which civs this player is at war with
CvWStringBuffer szWarWithString;
CvWStringBuffer szWorstEnemyString;
bool bFirst = true;
bool bFirst2 = true;
for (int iTeam = 0; iTeam < MAX_CIV_TEAMS; ++iTeam)
{
CvTeamAI& kTeam = GET_TEAM((TeamTypes) iTeam);
if (kTeam.isAlive() && !kTeam.isMinorCiv() && iTeam != eActiveTeam && iTeam != GET_PLAYER((PlayerTypes)widgetDataStruct.m_iData1).getTeam())
{
if (kActiveTeam.isHasMet(kTeam.getID()))
{
if (::atWar((TeamTypes) iTeam, GET_PLAYER((PlayerTypes)widgetDataStruct.m_iData1).getTeam()))
{
setListHelp(szWarWithString, L"", kTeam.getName().GetCString(), L", ", bFirst);
bFirst = false;
}
if (kTeam.AI_getWorstEnemy() == GET_PLAYER((PlayerTypes)widgetDataStruct.m_iData1).getTeam())
{
setListHelp(szWorstEnemyString, L"", kTeam.getName().GetCString(), L", ", bFirst2);
bFirst2 = false;
}
}
}
}
if( !szWorstEnemyString.isEmpty() )
{
CvWString szTempBuffer;
szTempBuffer.assign(gDLL->getText(L"TXT_KEY_WORST_ENEMY_OF", szWorstEnemyString));
szBuffer.append(NEWLINE);
szBuffer.append(szTempBuffer);
}
if( !szWarWithString.isEmpty() )
{
CvWString szTempBuffer;
szTempBuffer.assign(gDLL->getText(L"TXT_KEY_AT_WAR_WITH", szWarWithString));
szBuffer.append(NEWLINE);
szBuffer.append(szTempBuffer);
}
-------------------
-
CvGameTextMgr.cpp-
-------------------
RevDCM, line 1541 (missing code)
BBAI, line 1367 - 1374:
Code:
// activity
ActivityTypes eActivityType = (ActivityTypes) pHeadGroup->getActivityType();
if (eActivityType != NO_ACTIVITY)
{
getActivityTypeString(szTempString, eActivityType);
szString.append(CvWString::format(SETCOLR L"\n%s" ENDCOLR, TEXT_COLOR("COLOR_HIGHLIGHT_TEXT"), szTempString.GetCString()));
}
-----------------------------------------------------------------------------------------------------
RevDCM, line 1754 (missing code)
BBAI, line 1588 - 1617:
Code:
if( gDLL->shiftKey() )
{
CvCity* pLoopCity;
int iLoop = 0;
int iBestTargetValue = (pTargetCity != NULL ? GET_PLAYER(pHeadGroup->getOwner()).AI_targetCityValue(pTargetCity,false,true) : 0);
int iTargetValue = 0;
szString.append(CvWString::format(L"\n\nTarget City values:\n"));
for( int iPlayer = 0; iPlayer < MAX_PLAYERS; iPlayer++ )
{
if( GET_TEAM(pHeadGroup->getTeam()).AI_getWarPlan(GET_PLAYER((PlayerTypes)iPlayer).getTeam()) != NO_WARPLAN )
{
if( pPlot->area()->getCitiesPerPlayer((PlayerTypes)iPlayer) > 0 )
{
for (pLoopCity = GET_PLAYER((PlayerTypes)iPlayer).firstCity(&iLoop); pLoopCity != NULL; pLoopCity = GET_PLAYER((PlayerTypes)iPlayer).nextCity(&iLoop))
{
if( pLoopCity->area() == pPlot->area() )
{
iTargetValue = GET_PLAYER(pHeadGroup->getOwner()).AI_targetCityValue(pLoopCity,false,true);
if( (GC.getMapINLINE().calculatePathDistance(pPlot, pLoopCity->plot()) < 20))
{
szString.append(CvWString::format(L"\n%s : %d + rand %d", pLoopCity->getName().c_str(), iTargetValue, (pLoopCity->getPopulation() / 2)));
}
}
}
}
}
}
}
----------------
-
CvPlayerAI.cpp-
----------------
RevDCM, line 2130 and several below:
Code:
else if (AI_isDoVictoryStrategy(AI_VICTORY_CULTURE3) || getCommercePercent(COMMERCE_CULTURE) > 80 )
else if (AI_isDoVictoryStrategy(AI_VICTORY_CULTURE2) || getCommercePercent(COMMERCE_CULTURE) > 60)
else if (AI_isDoVictoryStrategy(AI_VICTORY_CULTURE1) || getCommercePercent(COMMERCE_CULTURE) > 40)
if (AI_isDoVictoryStrategy(AI_VICTORY_CULTURE3) || getCommercePercent(COMMERCE_CULTURE) > 80 )
else if (AI_isDoVictoryStrategy(AI_VICTORY_CULTURE2) || getCommercePercent(COMMERCE_CULTURE) > 60 )
BBAI, line 2156 and several below:
Code:
else if (AI_isDoVictoryStrategy(AI_VICTORY_CULTURE3) || getCommercePercent(COMMERCE_CULTURE) >= 90 )
...
-----------------------------------------------------------------------------------------------------
RevDCM, line 17628 (missing code)
BBAI, line 16537:
Code:
if(GET_TEAM(getTeam()).isAVassal())
{
iValue += 20;
}
CvTeamAI.cpp
This one should be ok because of operator precedence:
RevDCM, line 4656:
Code:
if ( (bAreaValid && iEnemyPowerPercent < 140) || (!bShareValid && iEnemyPowerPercent < 110) || (GET_TEAM((TeamTypes)iI).AI_getLowestVictoryCountdown() >= 0) )
BetterAI, line 4446:
Code:
if ( (bAreaValid && (iEnemyPowerPercent < 140)) || (!bShareValid && (iEnemyPowerPercent < 110)) || (GET_TEAM((TeamTypes)iI).AI_getLowestVictoryCountdown() >= 0) )
---------------------------------------------------------------------------------------
CvUnitAI.cpp
Please check, this might be too mod specific (it was for my taste, so I commented it out

):
RevDCM, line 5062-5077:
Code:
// Legends of Revolution - Push GG to join Legendary units
...
BetterAI, line 4829 (missing code)
---------------------------------------------------------------------------------------
Please check, this might be too mod specific (it was for my taste, so I commented it out

):
RevDCM, line 13150-13176:
Code:
// Legends of Revolution - Push GG to join Legendary Units
...
BetterAI, line 4829 (missing code)
---------------------------------------------------------------------------------------
CvXMLLoadUtilitySet.cpp
from BetterAI:
I assume these are not used or cannot do any error recovery...?
Code:
if (!ReadGlobalDefines("xml\\BBAI_Game_Options_GlobalDefines.xml", cache))
if (!ReadGlobalDefines("xml\\BBAI_AI_Variables_GlobalDefines.xml", cache))
if (!ReadGlobalDefines("xml\\TechDiffusion_GlobalDefines.xml", cache))
if (!ReadGlobalDefines("xml\\LeadFromBehind_GlobalDefines.xml", cache))