The Inner Workings of the UN and Diplomatic Victory

Jorunkun

AdvCiv for life
Joined
Oct 8, 2005
Messages
372
Location
Paris
Diplomatically victory in the UN is an elegant way of winning the game, and one that can reward both warlike civs (who can use their dominance in population to avoid tedious late-game invasions to take the land required for domination) as well as peaceful builders (who will need to focus early on making friends and allies). Unfortunately, the civilopedia is very vague on how the UN and diplomatic victory actually works in game-terms – when are elections held, how are they counted etc.

In the next post, I have compiled all I know about the UN and its inner workings, in hopes of collecting and refining information of how to play the diplomatic game well. However:

THIS IS A DRAFT VERSION - THE STATEMENTS AND NUMBERS BELOW ARE NOT VERIFIED! IF YOU HAVE MORE ACCURATE INFORMATION, PLEASE ADD IT.

The whole point of this thread is to a) get the facts straight and b) collect tactics to help win the game using the UN. If this interests you, please contribute questions and information.

Enjoy,

J.
 
1. Building the UN
The UN is a unique wonder that can be built after the discovery of mass media, provided the game was set up for three or more civilisations. Its cost is 1000 hammers. It can be rushed; a great engineer will complete about 90% of it.

Questions: How many hammers does the GE contribute exactly; is this dependant on gamespeed?

2. Effects of the UN
One turn after the completion of the wonder, a 16-turn-cycle of UN elections (one every four turns) begins. The first of these is the election for the role of secretary general, the next three are on UN resolutions selected by the secretary general; then the cycle starts anew.

Q: What happens if no secretary general is elected? Never had this happen ...
Q: What happens if the UN is destroyed? Do elections go on, do they stop for ever? What happens to resolutions already passed?

3. The voting cycle in detail
On the turn after the completion of the UN and after the selection of each new UN resolution by the secretary general, all civs are asked to cast their votes. However, the votes are counted on the beginning of next turn. This is important as the information on the number of votes you can cast and the totals required for a resolution or candidate to pass displayed to you on the turn you cast the vote will be different from the actuals on the turn the votes are counted, due to population growth, capture of cities etc between turns.

4. How votes are computed
The number of votes a leader is alotted is equal to the sum of the population points in all cities under his command on the beginning of the turn that the election is counted.

Note that I am pretty sure the total and share of pop-points is different from the population total and percentage share shown on the victory conditions screen and used in computing domination victories and score. For UN-elections, every pop-point equals one vote; but population for domination and score is weighted by the size of cities; bigger cities yield higher population totals. Thus, spamming small cities will help you increase your number of votes, but to boost your score and domination percentage it should make more sense to max out pop in cities rather than spam many smaller ones.

Also note that (to my knowledge) there is no info-screen that shows the current number of votes per civ.

Q: Is this information correct?
Q: Do unhappy/revolting population points count towards the vote?
Q: Are there any mods that provide better information on pop-points?

5. Election of the Secretary General
According to the civilopedia, the builder of the UN and the world leader in population points are the two candidates for the role of secretary general. If the builder of the UN is also the leader in population points, he will run against the leader with the next highest number of pop-points. The secretary general requires at least 40% of all votes (including abstentions) to be elected.

Q: Is this information correct?
Q: What happens if no secretary general is elected? According to the civilopedia, no secretary general means no votes for that cycle, but I've never seen it happen.
Q: If the owner of the UN wonder is different from the one who built it (i.e. if someone conquers the city with the building in it), who will be the automatic candidate for secretary general?

6. UN Resolutions
UN resolutions require at least 51% of all votes (including abstentions) to pass (except for diplomatic victory, see below). They take effect on the same turn the votes are counted. Global civics votes override each civs civic settings. The switch does not cause anarchy and takes effect even if the civ does not know the required tech. All UN resolutions function as toggles; they can be voted out after they have been voted in.

7. Diplomatic Victory
Diplmatic victory requires at least 62% of all votes (including abstentions). It is possible to win a diplmatic victory with only your own votes provided your pop-points make for 62% of votes; this is known as a "backdoor domination" victory (because you dominate in population but not in land). Victory is declared immediately on the beginning of turn the votes are counted. Diplomatic victory can be disabled in the game options.

What are score modifiers for diplomatic victory versus other victory types?

8. What drives AI voting behaviour
Civs will never vote for any candidate with whom they are annoyed or worse. If they are annoyed or worse with both candidates, they will abstain. However, their voting behaviour on UN resolutions is not influenced by their attitude to the secretary general.
AI Civs will reliably vote for a candidate with a total of +8 relationship modifiers, unless they are themselves a candidate. If both candidates have at least +8 relations, the candidate with the higher total will get the vote. If the two candidates have the exact same amount of modifiers, the one higher in the list will get the vote.
AI civs will never vote for global civics that force them to change away from their favourite civic.

Q: Obviously, there is a lot more to be added here – any takers?
Q: Is there a random element in the AIs voting decisions?
Q: I have never seen the AI oppose a nuclear weapons ban, have you? What are the drivers here?

9. Tips and Strategies for creative use of the UN

Global civic changes are an elegant way to switch out of wartime civics without anarchy.
Global civic free religion is very useful to to break religious ties or antipathy between civs; it generally levels the playing field and defuses diplomatic tensions.
Global civic free market disproportionately benefits the civ with the most cities.

Feel free to add anything of value here.
 
Thanks a lot for the post. Unfortunately I can't answer any of the questions. I'm sure others will be able to fill in some of that information, but in the meantime I'm glad you wrote this up. The Diplomatic Victory is a bit complicated, and this has helped me on my way to understanding it fully. Thanks again.
 
I have a question. If I want to gain positive modifiers by gifting technologies,on which turn do I do it?. The turn in which I vote for myself (diplomatic victory) or before the chance to vote for diplomatic victory comes along.

Also has anyone noticed that gifting gold has an effect, because I haven't seen a positive modifier for this, not in Warlords anyway.

Also I wonder of we lose the " you have chosen your civics wisely" modifier if a global civic is voted in.

VoiceOfUnReason said:
I think that you will find that CvPlayerAI::AI_diploVote explains most of the voting decisions made by the AI.

Whereabouts can this file be found??

OK Found it. If anyone's interested its in Warlords/CvGameCoreDLL
 
Jorunkun said:
[/B]One turn after the completion of the wonder, a 16-year-cycle of UN elections (one every four years) begins.

I think it would be better to call this a 16 turn cycle instead of 16 year.

The secretary general requires at least 51% of all votes (including abstentions) to be elected.

The Secretary General vote can be won with a 40% plurality instead of a 51% majority like the other votes. Source: iPopulationThreshold in Assets\XML\GameInfo\CIV4VoteInfo.xml

Diplmatic victory requires at least 61% of all votes (including abstentions).

The diplomatic victory vote requires 62% of all votes. Source: iPopulationThreshold in Assets\XML\GameInfo\CIV4VoteInfo.xml

VoiceOfUnreason said:
I think that you will find that CvPlayerAI::AI_diploVote explains most of the voting decisions made by the AI.

I just took a very quick look at that function. My interpretation is that the AI will vote for whichever candidate it likes the best as long as the attitude score is at least +8. A tie goes to whichever team is first on the list.

The main question I have with this is whether AI_getAttitudeVal returns the exact attitude you see in the interface or whether there are some hidden adjustments (ex. an AI to AI bonus). I'm pretty sure I can find an old save where Stalin abstained when this formula says he should have voted for me. (but I got the last laugh, because I won anyway!)
 
All the below is based on observation, not XML study ... btw, thanks for the link to the xml, not much of a coder but will give it a look.

mice said:
If I want to gain positive modifiers by gifting technologies,on which turn do I do it?.

The relationship modifiers of gifting technologies - unlike those for religion and favorite civics - are instant. The "our trades have been fair and forthright" effect goes from +1 to +4 and can be had relatively cheap, i.e. if you gift a tech when it's current; however I believe it deteriorates over time. To get the permanent "you shared your technological discoveries with us" you need to give quite a few technologies before seeing any results. Don't know the details, but don't count on getting this in one go; sometimes you need to gift in waves because the recipient needs to have the prerequisite techs for one turn to even be able to accept the gift.

mice said:
Also has anyone noticed that gifting gold has an effect, because I haven't seen a positive modifier for this, not in Warlords anyway.

Don't know about warlords, but my gut feel for the threshold to get +1 "fair and forthright" is somewhere in the 500s - this may be relative to the gold in circulation though.

mice said:
Do we lose the " you have chosen your civics wisely" modifier if a global civic is voted in.

Yes, you do, instantly. The inverse "you have chosen your civics wisely" takes about ten or so years to go up one increment, to a max of +4 (?)
 
Great stuff Doc, will update the post above asap. Thanks.

Dr Elmer Jiggle said:
The Secretary General vote can be won with a 40% plurality instead of a 51% majority like the other votes. Source: iPopulationThreshold in Assets\XML\GameInfo\CIV4VoteInfo.xml

Interesting that this is counter to what the civilopedia sais, but I had noticed that it was easier to become sec.gen than to get a resolution passed.

J.
 
Jorunkun said:
1. Building the UN
The UN is a unique wonder that can be built after the discovery of mass media, provided the game was set up for three or more civilisations. Its cost is 1000 hammers. It can be rushed; a great engineer will complete about 90% of it.

Questions: How many hammers does the GE contribute exactly; is this dependant on gamespeed?

A great engineer gives 500 + 20*(population of city your rushing in) hammers.

Q: What happens if no secretary general is elected? Never had this happen ...

There are no circumstances where this can occur. If no civ meets the normal vote requirements the position goes to the civ with the greatest number of votes.
 
Dr Elmer Jiggle said:
The main question I have with this is whether AI_getAttitudeVal returns the exact attitude you see in the interface or whether there are some hidden adjustments (ex. an AI to AI bonus). I'm pretty sure I can find an old save where Stalin abstained when this formula says he should have voted for me. (but I got the last laugh, because I won anyway!)

I don't have the SDK, but from my own (limited) experience, I think it also might take into account the Civ's nature. For the Sec Gen, I think +8 is enough. However, for a Diplomatic Victory, +8 might not be enough -- they appear to need to be "friendly" as well.

notopt
 
I've had pleased AI vote for me, so description of attitude clearly has nothing to do with who the AI votes for. But I don't think any AI will be less than 'pleased' with +8.

I am also thinking of writing a guide to diplomacy, but I think I shall focus on the 'how's and 'why's.
 
notoptimal said:
I don't have the SDK, but from my own (limited) experience, I think it also might take into account the Civ's nature. For the Sec Gen, I think +8 is enough. However, for a Diplomatic Victory, +8 might not be enough -- they appear to need to be "friendly" as well.

As aelf said, it's definitely not necessary for them to be friendly. I've had pleased leaders vote for me, though friendly is safer. Most of the time, a leader with a +8 attitude is going to be friendly. I think they would always be either friendly or pleased. I can't imagine you'd have a +8 and cautious.

Here's the SDK code that gave me the +8. As you can see (if you can read C++), iValue must be greater than iBestValue, which means AI_getAttitudeVal must be greater than +7, which is the same as greater than or equal to +8. I don't think there's any doubt that +8 is enough. The question is what is AI_getAttitudeVal returning? Is it the exact attitude that the UI displays for you, or are there additional factors that you don't see? It's a big function in the SDK, and I don't know the SDK enough to say for sure, but my initial impression is that it's related to the UI attitude but it isn't identical. It includes a lot of modifiers like the handicap (difficulty level) and the leader's base value that I don't think you can see in the game.

Code:
if (GC.getVoteInfo(eVote).isVictory())
{
    iBestValue = 7;
}
else
{
    iBestValue = 0;
}
eBestTeam = NO_TEAM;

for (iI = 0; iI < MAX_TEAMS; iI++)
{
    if (GET_TEAM((TeamTypes)iI).isAlive())
    {
        if (GC.getGameINLINE().isTeamVoteEligible((TeamTypes)iI))
        {
            if (GET_TEAM(getTeam()).isVassal((TeamTypes)iI))
            {
                return ((TeamTypes)iI);
            }

            iValue = GET_TEAM(getTeam()).AI_getAttitudeVal((TeamTypes)iI);

            if (iValue > iBestValue)
            {
                iBestValue = iValue;
                eBestTeam = ((TeamTypes)iI);
            }
        }
    }
}
 
MrCynical said:
There are no circumstances where this can occur. If no civ meets the normal vote requirements the position goes to the civ with the greatest number of votes.

Not true. I've had games, where I was not either of the candidates, where there was no secretary general, because enough civs abstained. A vote for secretary general kept popping up, but I forget if it was after every 4 or 16 turns.
 
One other thing to add:
It is possible for a vassal to build the U.N.
As the builder they do vote for themselves and if they get the most votes they do win -> you lose.
just another thing why i don't like vassal states...
source
 
OK, I dug up the final save from my last diplomatic victory and replayed it to confirm some things. The main result is that I've confirmed, I think, that there is something else going on in AI_getAttitudeVal besides what you see on the diplomatic screen. In this game, the diplomatic advisor shows that Stalin has a +8 attitude toward me (Wang Kon) and +5 toward my rival (Alexander), but he abstains instead of voting for me. Some unknown factor has evidently changed his attitude so it's below the +8 threshold. Screenshots and details follow.

Here we see that Stalin is pleased toward me and has a net +8 attitude.



He is also pleased with Alexander, but he only has a +5 score.



If you look at Stalin's column, this shot confirms my math on the +8 and +5 scores.



Finally, here are the results of the vote. Stalin abstains.



FYI, in case you're wondering why I'm in anarchy while I'm winning the game, that was an attempt to make Kublai Khan like me better. He didn't vote for me in the Secretary General election, so I was changing to his favorite civic to curry favor.
 
How do you get that 'Glance' tab in your Diplomatic Advisor?
 
aelf said:
How do you get that 'Glance' tab in your Diplomatic Advisor?

It's part of one of the advisor mods (Requies' , I think). I get it from the Hall of Fame mod, which I use on all of my games, just because it packs together a nice set of features that don't actually change the gameplay. The diplomatic and domestic advisors, in particular, are really nice.
 
That's a neat feature. What I would really like is also some way of knowing how much I'm getting from the Spiral Minaret and Sankore University because it seems in my Ramesses game that there's no way to know.
 
aelf said:
That's a neat feature. What I would really like is also some way of knowing how much I'm getting from the Spiral Minaret and Sankore University because it seems in my Ramesses game that there's no way to know.

Well there are several ways you can get an estimate of how much base gold and beakers you get... one is to just count the number of religious buildings of your state religion and multiply by 2. This information is summarised on the info screen (F9 and Statistcs).

Of course you might want to know what the overall research and gold income effect of the wonders is taking account of where they are are built and hence the city multipliers. I thought ...that is easy to do with Rameses... just save the game and switch to No State Religion or Free Religion to remove the two wonders effects on religious buildings. But I have just tried this (on your savegame in 1454 AD) and the city screens and the finacial advisor summary don't seem to update immediately :( ... you have to wait for the end of turn update before the new values become available, and that obviously means other changes (from city growth) can affect the values. I guess it is easier (but tedious) to calculate the benefit ... just multiply the bonuses by the research and gold multipliers.
 
Back
Top Bottom