As the title says, my aim is to increase the number of candidates offered by the game when choosing leaders for the AP and UN. I've had a look through the code and my assumptions are made below. (Please feel free to correct me if I have made a mistake).
I have looked in the VoteInfo.xml file and can see that for VOTE_POPE and VOTE_SECRETARY_GENERAL, the value of bSecretaryGeneral is set to 1 so both these voteInfo types will set a secretary general (or pope) when invoked.
Looking at CvGame.cpp in the doVoteSelection() procedure I can see that there is a timer which is initialised by the value of DIPLO_VOTE_SECRETARY_GENERAL_INTERVAL and decremented each turn until it is zero. At zero the game compares voteTypes to make sure that they match the respective voteInfo requirements, ie voteType is DIPLOVOTE_POPE and voteInfo is VOTE_POPE.
A VoteSelectionSubData struct is now initialised and AddVoteTriggered is then called passing the VoteSource and VoteSelectionSubData structs as parameters.
This is where my confusion starts. At no time has the game set which two players are to be selected as candidates.
If we then move to the addVoteTriggered function, these parameters are assigned to a VoteTriggeredData struct and the game then iterates through MAX_CIV_PLAYERS checking to see if each player can vote and if that player is human, it then provides them with a popup. If they are AI then the AI player casts its vote using the AI_diploVote function.
My two questions are:
I was hoping to alter the popup to provide more leaders (in a 64 player game I find a choice of 2 leaders a bit silly) and also to get the AI to make a choice between those leaders using their attitude towards them.
Thanks in advance for any advice you can offer
~Ted
I have looked in the VoteInfo.xml file and can see that for VOTE_POPE and VOTE_SECRETARY_GENERAL, the value of bSecretaryGeneral is set to 1 so both these voteInfo types will set a secretary general (or pope) when invoked.
Looking at CvGame.cpp in the doVoteSelection() procedure I can see that there is a timer which is initialised by the value of DIPLO_VOTE_SECRETARY_GENERAL_INTERVAL and decremented each turn until it is zero. At zero the game compares voteTypes to make sure that they match the respective voteInfo requirements, ie voteType is DIPLOVOTE_POPE and voteInfo is VOTE_POPE.
A VoteSelectionSubData struct is now initialised and AddVoteTriggered is then called passing the VoteSource and VoteSelectionSubData structs as parameters.


If we then move to the addVoteTriggered function, these parameters are assigned to a VoteTriggeredData struct and the game then iterates through MAX_CIV_PLAYERS checking to see if each player can vote and if that player is human, it then provides them with a popup. If they are AI then the AI player casts its vote using the AI_diploVote function.
My two questions are:
- How does the game provide the choices to the player
- Where does the AI choose between the two players when voting for a leader (I assumed AI_chooseElection but since the game uses the word 'election' to mean a choice in general, things aren't always as they appear)
I was hoping to alter the popup to provide more leaders (in a 64 player game I find a choice of 2 leaders a bit silly) and also to get the AI to make a choice between those leaders using their attitude towards them.
Thanks in advance for any advice you can offer

~Ted