r_rolo1
King of myself
I and my teammates in the current SGOTM, for reasons I can't tell here, decided to give a look at the code that governs the AI choose of resolution when it is the Apostolic resident or the UN Sec general......
CvTeamAI::AI_chooseElection ( "vanilla" 3.17 BtS )
Resuming ( for those less code able ):
-Ok , I'm a AI
-Oh, I'm Sec general and/or Apostolic Palace Resident
-Let's see what resolutions are possible in the moment.....
-Ok, I have some resolutions in hand.....
-Let's just toss a coin in the air and chose one
Well, this obviously has ample space for improvement. I don't have clear ideas of how to make it better, but surely a look to what the AI has would help ( force FR vote when having Sankore and Spiral minaret is not the birghtest idea of them all ..... ). Maybe decreasing the odds of voting for a already passed resolution would also help in some cases ( I have my fair share of games where the Sec general AI repeatedly asking to pass the already passed Emancipation or FR vote )
P.S How could I forget the myriad times where the AI dows and as AP resident or Sec general calls the end of the war in the next turn ?
CvTeamAI::AI_chooseElection ( "vanilla" 3.17 BtS )
Code:
int CvTeamAI::AI_chooseElection(const VoteSelectionData& kVoteSelectionData) const
{
VoteSourceTypes eVoteSource = kVoteSelectionData.eVoteSource;
FAssert(!isHuman());
FAssert(GC.getGameINLINE().getSecretaryGeneral(eVoteSource) == getID());
int iBestVote = -1;
int iBestValue = 0;
for (int iI = 0; iI < (int)kVoteSelectionData.aVoteOptions.size(); ++iI)
{
VoteTypes eVote = kVoteSelectionData.aVoteOptions[iI].eVote;
CvVoteInfo& kVoteInfo = GC.getVoteInfo(eVote);
FAssert(kVoteInfo.isVoteSourceType(eVoteSource));
FAssert(GC.getGameINLINE().isChooseElection(eVote));
bool bValid = true;
if (!GC.getGameINLINE().isTeamVote(eVote))
{
for (int iJ = 0; iJ < MAX_PLAYERS; iJ++)
{
if (GET_PLAYER((PlayerTypes)iJ).isAlive())
{
if (GET_PLAYER((PlayerTypes)iJ).getTeam() == getID())
{
PlayerVoteTypes eVote = GET_PLAYER((PlayerTypes)iJ).AI_diploVote(kVoteSelectionData.aVoteOptions[iI], eVoteSource, true);
if (eVote != PLAYER_VOTE_YES || eVote == GC.getGameINLINE().getVoteOutcome((VoteTypes)iI))
{
bValid = false;
break;
}
}
}
}
}
if (bValid)
{
int iValue = (1 + GC.getGameINLINE().getSorenRandNum(10000, "AI Choose Vote"));
if (iValue > iBestValue)
{
iBestValue = iValue;
iBestVote = iI;
}
}
}
return iBestVote;
}
Resuming ( for those less code able ):
-Ok , I'm a AI
-Oh, I'm Sec general and/or Apostolic Palace Resident
-Let's see what resolutions are possible in the moment.....
-Ok, I have some resolutions in hand.....
-Let's just toss a coin in the air and chose one
Well, this obviously has ample space for improvement. I don't have clear ideas of how to make it better, but surely a look to what the AI has would help ( force FR vote when having Sankore and Spiral minaret is not the birghtest idea of them all ..... ). Maybe decreasing the odds of voting for a already passed resolution would also help in some cases ( I have my fair share of games where the Sec general AI repeatedly asking to pass the already passed Emancipation or FR vote )
P.S How could I forget the myriad times where the AI dows and as AP resident or Sec general calls the end of the war in the next turn ?