Fimbulvetr
Emperor
I'm just using the latest, 1.01b, as opposed to 1.00e in the download version of Better BTS AI.
...I'm surprised no crashes have been reported in BBAI 1.0 since I'm sure that has to be where this crash is coming from...[/url]
/************************************************************************************************/
/* BETTER_BTS_AI_MOD 05/16/10 Mongoose & jdog5000 */
/* */
/* War strategy AI */
/************************************************************************************************/
iValue += 2*pCity->getNumActiveWorldWonders();
for (iI = 0; iI < GC.getNumReligionInfos(); iI++)
{
if (pCity->isHolyCity((ReligionTypes)iI))
{
iValue += 3;
if (GET_PLAYER(pCity->getOwnerINLINE()).getStateReligion() == iI)
{
iValue += 2;
}
if (getStateReligion() == iI)
{
iValue += 4;
}
}
}
Ok it's working now, thanks.
Another oddity I've seen is that some leaders will give you the diplo hit "our close borders spark tension" right from the start, even though obviously you're still far from sharing cultural borders. Not all leaders do that though, Gilgamesh and Alexander are concerned but not Ragnar/Mansa/Pericles... not tested all of them.
I don't remember seeing this with the previous release so I think it may come with this update.
Edit : Hannibal does it too.
How I fixed it: bullai r96I think I know where that comes from. It's a side-effect of jdog's changes to CvTeamAI::AI_isLandTarget(), which might have been made to make early rushes possible, not sure if that function even has any influence there though. It must have been there in the 2010-05-26 version already though, nothing was changed there in today's update.
You will get these diplo hits if both you and the other leader have the capital on the same continent, and that leader has a iCloseBordersAttitudeChange of -3 or lower. (Alexander has -4, Gilgamesh -3). But that only happens when large portions of the continent are unclaimed, so it should go away as you settle more land.
void CvGame::updateMoves()
{
CvSelectionGroup* pLoopSelectionGroup;
int aiShuffle[MAX_PLAYERS];
int iLoop;
int iI;
if (isMPOption(MPOPTION_SIMULTANEOUS_TURNS))
{
shuffleArray(aiShuffle, MAX_PLAYERS, getSorenRand());
}
else
{
for (iI = 0; iI < MAX_PLAYERS; iI++)
{
aiShuffle[iI] = iI;
}
}
for (iI = 0; iI < MAX_PLAYERS; iI++)
{
CvPlayer& player = GET_PLAYER((PlayerTypes)(aiShuffle[iI]));
if (player.isAlive())
{
if (player.isTurnActive())
{
if (!(player.isAutoMoves()))
{
player.AI_unitUpdate();
if (!(player.isHuman()))
{
if (!(player.hasBusyUnit()) && !(player.hasReadyUnit(true)))
{
player.setAutoMoves(true);
}
}
}
if (player.isAutoMoves())
{
for(pLoopSelectionGroup = player.firstSelectionGroup(&iLoop); pLoopSelectionGroup; pLoopSelectionGroup = player.nextSelectionGroup(&iLoop))
{
pLoopSelectionGroup->autoMission();
}
if (!(player.hasBusyUnit()))
{
player.setAutoMoves(false);
}
}
}
}
}
}
FAssert( getHeadUnit()->isCargo() || getActivityType() != ACTIVITY_SLEEP );
FAssert(isHuman() || getHeadUnit()->isCargo() || eNewValue != ACTIVITY_SLEEP);
So JDog... if capturing the holy city for an AI's own state religion is of extra value, then depriving an enemy of the holy city for his own state religion should be worth doing as well, shouldn't it?
How I fixed it: bullai r96
/************************************************************************************************/
/* BETTER_BTS_AI_MOD 05/16/10 jdog5000 */
/* */
/* War tactics AI */
/************************************************************************************************/
void CvPlayerAI::AI_conquerCity(CvCity* pCity)
{
bool bRaze = false;
int iRazeValue;
int iI;
if (canRaze(pCity))
{
iRazeValue = 0;
int [COLOR="Blue"]iCloseness[/COLOR] = [COLOR="Red"][B]pCity[/B][/COLOR]->AI_playerCloseness(getID());
phungus & Maniac
I'm going to try making the target city values visible in debug mode one of these days, as I feel they've never really been investigated/tweaked in game situations ...
for (int iI = 0; iI < GC.getNumTechInfos(); iI++)
{
iPathLength = GET_PLAYER(pPlot->getOwner()).findPathLength(((TechTypes)iI), false);
if( iPathLength <= 3 && !GET_TEAM(pPlot->getTeam()).isHasTech((TechTypes)iI) )
{
szString.append(CvWString::format(L"\n%s(%d)=%7d", GC.getTechInfo((TechTypes)iI).getDescription(), iPathLength, GET_PLAYER(pPlot->getOwner()).AI_techValue((TechTypes)iI, 1, false, false, paiBonusClassRevealed, paiBonusClassUnrevealed, paiBonusClassHave)));
szString.append(CvWString::format(L" (bld:%5d, ", GET_PLAYER(pPlot->getOwner()).AI_techBuildingValue((TechTypes)iI, 1, bDummy)));
szString.append(CvWString::format(L"unt:%5d)", GET_PLAYER(pPlot->getOwner()).AI_techUnitValue((TechTypes)iI, 1, bDummy)));
}
}
What about:
Only 2 min per resource; 6 per active world wonder; holy cities: 4 +2/+8/+4 (base theirs/ours/favorite) for a max total of 18 if we share religions and its our favorite.
int CvPlayerAI::AI_targetCityValue(CvCity* pCity, bool bRandomize, bool bIgnoreAttackers) const
{
...
//
// Mongoose AITargetCityValueFix BEGIN
//
if (pCity->isCoastal(GC.getMIN_WATER_SIZE_FOR_OCEAN()))
{
iValue += 5;
}
iValue += pCity->getNumActiveWorldWonders() * 8;
for (iI = 0; iI < GC.getNumReligionInfos(); iI++)
{
if (pCity->isHolyCity((ReligionTypes)iI))
{
iValue += 2 + ((GC.getGameINLINE().calculateReligionPercent((ReligionTypes)iI) * 2) / 3);
if (getStateReligion() == iI)
{
iValue += 8;
}
if (GET_PLAYER(pCity->getOwnerINLINE()).getStateReligion() == iI)
{
iValue += 4;
}
if (GC.getLeaderHeadInfo(getLeaderType()).getFavoriteReligion() == iI)
{
iValue += 4;
}
if (GC.getLeaderHeadInfo(GET_PLAYER(pCity->getOwnerINLINE()).getLeaderType()).getFavoriteReligion() == iI)
{
iValue += 2;
}
}
}
//
// Mongoose AITargetCityValueFix END
//
if (pCity->isEverOwned(getID()))
{
iValue += 3;
}
if (!bIgnoreAttackers)
{
iValue += std::min( 8, (AI_adjacentPotentialAttackers(pCity->plot()) + 2)/3 );
}
for (iI = 0; iI < NUM_CITY_PLOTS; iI++)
{
pLoopPlot = plotCity(pCity->getX_INLINE(), pCity->getY_INLINE(), iI);
if (pLoopPlot != NULL)
{
if (pLoopPlot->getBonusType(getTeam()) != NO_BONUS)
{
//
// Mongoose AITargetCityValueFix BEGIN
//
iValue += std::min(2, std::max(1, AI_bonusVal(pLoopPlot->getBonusType(getTeam())) / 10));
//
// Mongoose AITargetCityValueFix END
//
}
if (pLoopPlot->getOwnerINLINE() == getID())
{
iValue++;
}
You're thinking too much in historical terms and even there I think you are overrating the value of such a city.Remember, huge wars, generational struggles, and the rise and fall of whole societies have come about as a result of conflict over at least one specific holy city in the past; even though Jerusalem may be the only extreme historical example, we want the state religion bonuses here to be relatively high imo.
You're thinking too much in historical terms and even there I think you are overrating the value of such a city.
I'm only thnking about whether or not this makes the AI better in warfare. And while I agree that useful wonders should have some value (4-6), and that holy city value should scale to spread ((2 + ReligionPercent/10) or so), I fear your super high values would make the AI too predictable and potentially less effective. The value for our own state religion should be high ("Crusade bonus": 6-10), the rest is just too much.
Their state religion: less than half of crusade bonus, our favorite: 2, theirs: 0.
But maybe that's just the atheist in me speaking
.. and coastal would get a +3 from me.