AI voting behavior for diplo victory

Tigger70

Chieftain
Joined
Dec 16, 2005
Messages
9
Hello all,

Very first post! Longtime lurker though.

I am interested in whether anyone knows or can determine what the formula is for how AI civs will vote in the diplomatic UN election. By this I mean not just generalizations on how they tend to vote (though those could be helpful and interesting too) but preferably what the actual formula is in the code that determines this - including under what conditions they abstain.

I think there is a lot of promise for strategically interesting games that pursue this VC but not knowing with sufficient precision what determines their voting behavior is an unfortunate limitation for pursuing it. One doesn't want to have a lot of time invested in a game, call a vote in a close situation, and end up losing for the sake of not knowing exactly what determines what they will do. In close situations it's just too much of a gamble with the information currently unknown (unknown at least to me).

Natually there are cases where it's obvious. The VC can be used to shorten a domination win by voting oneself in for example. Or if there are three civs left, the deciding vote is +14 with you and furious at your opponent. The really strategically interesting games though will be cases where it isn't this obvious at all. Cases where one really needs more info on how they vote to figure out where things stand.

I currently haven't played beyond Prince (played that in GOTM); looking to try Monarch for the first time whenever I get the chance. My experience on the easy levels has been though that things become trivial. With enough of a tech lead one can always leverage it for a military victory with enough patience to sit through all the turns necessary to move the pieces around. I'd like to find a level where the AI can keep up reasonably with the tech situation, making DomV or ConV untrivial, with a realistic chance for them to win by SS. Then the need to chase them down in time for a diplo win (or maybe cultural win) before they manage it. Preferably on a large map with many civs to keep the diplomatic situation fluid and interesting. Strategically complex diplomatic situation, reasonable military parity, aiming for DiploV. Many difficult strategic diplo decisions = most excellent game. For something that close and challenging though, concrete info is needed regarding what (exactly) determines their voting choices in close situations. I don't know if a difficulty level can be found that makes something like this both feasible, interesting, and not-impossible. This most excellent game is versatile enough though that I think there is a very reasonable chance that it's there. The need for concrete information on the voting calculations though remains.

I think if this is discoverable I may ask one of the knowledgable modder folks in the other forum if they might be willing to write a utility mod to show what the vote would be if it were to occur on a given active turn, so as to eliminate the need for manual calculations. But first things first. Need to know what the hard formula is that determines the voting.

Many thanks in advance to anyone who knows, or shares the interest and has the technical knowledge to find it in the code. I myself just don't know how to do that.

Best - Tig
 
After numerous trials, I have only concluded that the whole un thing is still flawed.... so GFL.
 
I'm not familiar with the "GFL" acronym.

I fear you may be right about it being fundamentally flawed. The diplomatic system though does seem much improved to me from what I recall in earlier versions. The major remaining problem as I see it is not knowing what the formula is. Why they haven't specified what it is I'm not really understanding. With the other VC conditions you have a reasonable understanding of where you're at. You can determine for example how many turns until that SS comes in, or until sufficient culture is accrued. Someone might beat you to it but you know where you stand. And that's pretty true too for the military VCs. The remaining problem is the gambling-effect of calling UN votes in close conditions without knowing how they're going to vote with respect to the diplomatic modifiers that are visible. If they vote in a weird and unexpected way, it could be Game Over. I do think there is reasonable promise for good games using this VC though if the formula were known. Nonetheless I can also agree that there is a murky element to pursuing it - much is going to depend on whether there are any random variables in the voting algoritms, or dependent variables that are not visible or accessible in active play.

Perhaps we will get lucky though and a knowledgable and interested party from the forums in here will figure out how to reveal it - along with a sensible and promising system in the code.

Thanks for adding to the thread.
 
I don't know the formula so will stick to trends. If they are a candidate they will vote for themselves 100% of the time. If they like one candidate a lot more than they like the second one they will vote for nmber 1. If they like both the same OR the better liked one is still not overly well liked they will abstain.
 
Many thanks for contributing your knowledge of trends Hawkeye. It may turn out to be the case that the only way to determine the hard formulas is to piece together observations and make an inference about the code, in the event that it is not accessible.

Some key questions though clearly are remaining here. It seems fairly intuitive that if civ X is a candidate, they will vote for themselves. We cannot know for sure without the code of course but it seems entirely reasonable to assume this is almost surely the case.

But then consider more closely the first observation you have made here:
"If they like one candidate a lot more than they like the second one they will vote for number 1"

The obvious problem here is determining what "a lot" amounts to, but there are other potentially interesting situations as well. Suppose civ X has +4 (cautious) with you but +3(pleased) with the opponent (I'm assuming it is possible for this to happen; maybe it isn't [?]). Difficult to know off the bat whether +1 is going to count as "a lot" but there is the secondary issue of status. Is civ X's vote going to be linked here in favor of the "pleased" status or will the higher +4 modifier win out? Or will they just abstain? It is close situations of this sort that I'm mostly interested in. One could take all sorts of guesses but calling a vote still means something of a gamble without knowing what the hard formula is. So: are there necessary conditions concerning the relation-type (and by extension what might they be)? Perhaps that is a good place to start.

The optimal way to go about this surely is to get straight to the bottom of it and find the formula directly in the code. Wish I knew how to do that. Maybe if contributors can post some results from close cases like this though we could infer it that way.

best, and many thanks again for contributing - Tig
 
AFAIK:

The AI votes for the candidate with which it has "pleased" or "friendly" relationship with. If it is a tie, they will vote for the candidate with the higher relations modifier totals (+4 brothers and sisters of faith, etc...)

If the AI has cautious or lower relations with both candidates, it will abstain.
 
I have been the only member of the faith, as well as the nicest person, and yet didn't get any of the votes. Go figure. I think there is more to this than the ratings lead us to believe.
 
from my xperience the ai votes for other ais if it it cautious or better and does not have a better standing with you (if your standing is greater then that of your competitor it will abstain if the standing is less then +10 with yourself)
a total positive standing of 10+ will usually net you the civs vote unless it has a better standing with the competitor (the other civ which can be voted for)
i have written a litle article about the diplomatic victory its somewhere down on the strategy article forum
 
Tigger70 said:
Many thanks for contributing your knowledge of trends Hawkeye. It may turn out to be the case that the only way to determine the hard formulas is to piece together observations and make an inference about the code, in the event that it is not accessible.

Some key questions though clearly are remaining here. It seems fairly intuitive that if civ X is a candidate, they will vote for themselves. We cannot know for sure without the code of course but it seems entirely reasonable to assume this is almost surely the case.

But then consider more closely the first observation you have made here:
"If they like one candidate a lot more than they like the second one they will vote for number 1"

The obvious problem here is determining what "a lot" amounts to, but there are other potentially interesting situations as well. Suppose civ X has +4 (cautious) with you but +3(pleased) with the opponent (I'm assuming it is possible for this to happen; maybe it isn't [?]). Difficult to know off the bat whether +1 is going to count as "a lot" but there is the secondary issue of status. Is civ X's vote going to be linked here in favor of the "pleased" status or will the higher +4 modifier win out? Or will they just abstain? It is close situations of this sort that I'm mostly interested in. One could take all sorts of guesses but calling a vote still means something of a gamble without knowing what the hard formula is. So: are there necessary conditions concerning the relation-type (and by extension what might they be)? Perhaps that is a good place to start.

The optimal way to go about this surely is to get straight to the bottom of it and find the formula directly in the code. Wish I knew how to do that. Maybe if contributors can post some results from close cases like this though we could infer it that way.

best, and many thanks again for contributing - Tig

The flowery language you use is so funny. My mother tongue is not English, but it's almost as interesting to read your posts like wtaching a Tony Blair speech( he speak very beatifully too) ;) I guess you are from England and you are a science teacher. :D just my 0.02$ :D
 
As far as I can tell, the votes for all of the Civics and bonus (+1 trade) will always pass. As for UN president... the only people I can get to vote for me are allies that are friendly towards me, otherwise they will abstain. Any running candidate will vote for him/herself.
 
In the couple dimplomatic ones I played it was simple: Friendly/pleased leaders voted for me and furious/annoyed/cautious ones did not.

What was tricky was reducing the population of a 'friend' who was the #2 candidate while preserving their friendship, and choosing global civics that benefited me the most.
 
DarkSchneider said:
As far as I can tell, the votes for all of the Civics and bonus (+1 trade) will always pass.

Hehe, actually, nope! I was attempting to cripple my opponent's economy, so I was trying to pass environmentalism to kick them out of state property. (Note that I actually had a pretty small land area, so it wouldn't hurt me much, as I was already using environmentalism). Unfortunately, that civ was able to get enough votes with one or two others to stop the civic.

However, normally I do agree with this comment.
 
I've won Diplomatic Victory on Emperor and Diety levels. Standard size/speed/#of opponents, everything. The Diety win was also an OCC game (One City Challenge). So I have quite a bit of trend data, but no formula. I'd love that! I hope someone works it out. Here are a few observations that contradict what many people believe:

I've had the AI vote for me with only a +7 relations. Maybe even lower, I think I had a 6 or a 5 once, but I can't check my numbers right now.
This was not because the AI hated the other candidate. I haven't used the strategy of instigating war (but I really like that idea). The problem with that strategy is, on Diety, you can't expect to survive a war against the top candidate. Remember, I only had 1 city and it's hard to have much of a military when you have to research like a mad man to get the U.N.

You don't need to have "a lot" better relations than your competitor, just +1 more as long as it's sufficiently high. One time +17 was NOT good enough because my competitor was +23! I simply voted in Free Religion and they lost the +7 for brothers/sisters of the faith, dropping their score to +16 and I won.

Tigger, I know exactly how you feel. You're so right about how Diplo gives you that feeling that you have no idea how close you are to flipping their vote. After you get a few wins though, you just know that they will flip if you keep improving your relations. The frustration has gone for me, and I really enjoy this victory condition which I previously avoided....but I'd still like the formula too.
 
I think that on top of your +/- modifier things like Defensive pacts, (and of course permenant alliances) greatly affect the outcome.
 
The problem I always have is with choosing allies. Ideally, assuming I'm #1 in score when the vote comes up, I'd like to be allied with the #3 civ and his buddies. If they don't like #2 and they're my buddy, they'll vote for me instead. Inevitably though, one of the civs I end up allying with becomes the #2, so he votes for himself, and the members of my own alliance could vote either way (usually abstain.) This creates a deadlock, and short of conquering the world to get 60+% of the population, diplomatic victory is impossible. I've had a couple of games where no other victory condition was feasible, so I ended up losing because of this.
 
Many thanks to all the contributors who have joined in the discussion. I will comment on a few of the postings.

mdbill says:
"I've won Diplomatic Victory on Emperor and Diety levels. Standard size/speed/#of opponents, everything."

This is excellent news! It means that the game I am looking for will indeed be possible when I am able to move onto higher difficulties. Many thanks for taking the time to post so that I know this. I am encouraged too that you have found the games to be strategically satisfying. I am definitely going to experiment with this VC when I have the opportunity to play again. Also:

"You're so right about how Diplo gives you that feeling that you have no idea how close you are to flipping their vote. After you get a few wins though, you just know that they will flip if you keep improving your relations."

This is clearly a big part of the uncertainty involved with this VC. It means that often one may not have a very accurate measure of turns remaining until the victory condition is satisfied, which could be important in a close SS race with the AIs. The other big concern here though would be cases where the vote may be close in the sense that the AI competitor might win(!). Here we could have the situation where the choice to call a vote results in game loss. What concerns me would be trying this VC on maybe a large or huge terra map (or whatever) so as to increase the strategic diplomatic situation via large number of AI civs. In this sort of situation it is likely that the competitor is going to have some sort of voting bloc. After taking your own bloc into account (if you can even determine it), some civs will remain whose votes are toss-ups in the sense that one can only guess what they might do. In situations like that the bloc of unknowns could potentially constitute enough votes that calling the election results in loss, in the event that too many of the unknowns opt to vote for the AI. Naturally one would want the unknown bloc to be as small as possible but practically it seems likely that it is going to exist if one opts to increase the strategic situation with large numbers of opposing civs. And of course any game of that sort will constitute a major investment of time (especially since I prefer to play on epic speed), which would make a loss due to not knowing the decision-procedure for determining votes incredibly frustrating.

I'll post some further comments on the discussion shortly. Must take care of something.
 
ok I have returned. I would like to see what might be learned by looking at the suggestions which have been offered in various postings.

We can consider first some of mdbill's findings. He reports:

"One time +17 was NOT good enough because my competitor was +23! I simply voted in Free Religion and they lost the +7 for brothers/sisters of the faith, dropping their score to +16 and I won."

This is sufficient to reject the thesis that one's modifier must be "a lot" higher than the competitor to win an AI civs vote, as mdbill notes in his post. One open question that remains here is whether there exists a minimal number for potentially qualifying to obtain a vote.

Then we have the thesis of spiceant:
"if your standing is greater then that of your competitor it will abstain if the standing is less then +10 with yourself"

This amounts to holding that having a +10 modifier is a necessary condition for obtaining an AI vote. That intuitively sounds far too stringent even based on the few diplo games I have played. Mdbill adds with respect to this:

"I've had the AI vote for me with only a +7 relations. Maybe even lower, I think I had a 6 or a 5 once."

So it would seem that the necessary-condition thesis provided by spiceant must not be correct.

There is also the open question concerning whether there exists a minimal relation-status required to qualify for a vote. Kamigawan apparently holds that there does:

"The AI votes for the candidate with which it has "pleased" or "friendly" relationship with."

So one way to proceed here: can anyone offer evidence of an instance in which an AI civ's vote was won despite having cautious-or-worse status in relations? We unfortunately won't find any evidence proving that this claim is correct other than missing evidence to the contrary.

It looks that I am running out of space so I will have to post and continue..
 
What else can be discovered here? There is an interesting conjunction of suggested theses offered by spiceant and kamigawan:

(S) the ai votes for other ais if it it cautious or better and does not have a
better standing with you

(K) If the AI has cautious or lower relations with both candidates, it will
abstain.

Let us suppose that both the human player and the AI election opponent have cautious relations with civ X. By (S) civ X will vote for the AI opponent. By (K) civ X will abstain. So we can conclude that at least one of these theses is not correct. Perhaps someone can offer evidence concerning which is false (keeping in mind the possibilty that both might be).

Alright so we have some findings here. mdbill has shown that the thesis about "a lot" concerning modifiers is wrong and that the +10 minimal condition claim is incorrect. And we know that at least one of (S) and (K) must be wrong. Some open questions:

(1) Can anyone show that it is possible to win an ai's vote despite having cautious-or-worse status? This concerns whether there is a minimal-status requirement.

(2) Does there exist a minimal qualifier number for competing for a vote? Perhaps some contributors could offer evidence of obtaining votes with low modifier numbers to get us some information about the possibilities here.

(3) Can anyone show which of (S) and (K) are false (keeping in mind the possibility that they both might be). That might get us somewhat closer to understanding the abstaining behavior.


Despite the progress this seems like a most cumbersome and roundabout way to proceed. Perhaps over the weekend I will post a request for discovery of the formula directly on the mod-forum (hoping that the moderators will permit the request to be posted there without conflict from the forum description). There are a number of very impressive posters in that forum who have significant technical capabilities. It is possible that we might be able to obtain assistance from a party over there who could discover this thing in the most effective way - though this would require that the formula is in a part of the code which can be read (apparently some of the source cannot be read, though I really do not understand such things as I have no advanced technical capabilities). I think that if this thing can be discovered I will perhaps write up an article about it for the strategy article forum so as to alleviate the continuing torture involved in trying to understand the election system.

My thanks and appreciation again to all who have contributed to the discussion - Tig
 
mdbill said:
I've had the AI vote for me with only a +7 relations. Maybe even lower, I think I had a 6 or a 5 once

Yup, i get this all the time. The minimum to get a vote is only "Pleased."


mdbill said:
One time +17 was NOT good enough because my competitor was +23!

Once you have achieved "pleased" or higher, the vote is based on relative modifier bonus. Doesn't matter if you have +99, you will lose if your competitor has +100. You need a higher modifier bonus than your opponent.



tigger said:
can anyone offer evidence of an instance in which an AI civ's vote was won despite having cautious-or-worse status in relations?

I have never had an AI vote for a cautious candidate. Even when I've razed their cities and relations are Furious to me (-10 or worse) / cautious to opponent, they have always abstained. You would think they would vote against out of spite. But I've never seen it happen.
 
Top Bottom