Is there a way to stop the AI repeatedly asking for the same thing e.g. help with war

I would say I get just as many well intentioned erroneous trades as I do threats and requests for help. And again, I don't see how the diplomacy feature is not staggered in the direction of the AI when they will NEVER bribe you into helping them.
Fair enough. I think it's because, when an AI is bribed into war, it will actually attempt to fight that war, but the human player can simply take the tech and do nothing.

But you almost always MUST bribe them into war. I have no problem with outright threats. Like I said earlier, I have less qualms with taking a "you refused to give us tribute" hit, from refusing a threat, than I do someone who is pleased with me offering up a trade that it subjectively percieves as fair (5 gold for industrialism) and taking a "you refused to trade with us" hit.

According to Bhuric's post, this is actually not true. I haven't looked at the code, so I don't know for sure, but I'm inclined to believe Bhuric. I don't think I've ever observed an AI giving me a penalty for refusing an "unbalanced" trade.

And again, in regards to help and the AI persistently dogging you for war...Christ...who doesn't understand something to the effect of "We have too much on our hands right now." There is nothing reasonable about going from friendly to cautious with your closest alley when you are fending off five armies, and he's fending off five different armies. You would think that friends and pleased, and even cautious leaders would understand the concept of, "He'd help us if he could, but he can't because he's in a war of his own."

I disagree. If a country is at war, and you don't help them, they should penalize you for that. The fact that you are at war yourself is irrelevant. If the nation you wish to seek help from has "too much on their hands" to help you, then you certainly CAN penalize them in the same way, by cutting off trade and/or declaring war on them.

Or how about this one: What's the deal with me getting a negative diplo hit for declaring war on someone elses friend when THEY declare war on you? That is ******** and staggered against the human player.
I don't believe this is true, either.

Come on. Argue the points. Stop mincing words. A lot of this could be eleviated if some sense of reasonability was programmed into the AI. Some AI's could even be more reasonable than others. It also shouldn't have been that too hard to differentiate between a threat and a legitimate trade.

I'm still not big on trading alphabet away for all those paltry early techs...

Anyhow, this all boils down to something that's still staggered towards the AI. You B-line to get a tech that the AI doesn't favor, and then trade for a whole slue of lesser techs. There are very few conditions or AI characters that give even trades for anything.

See Seven05's post, above. The AI assigns a particular value to a particular tech, and trades for that value. I will admit that at best, the AI will always want a little more value than they are offering. I believe this is tied to difficulty level as well as the individual AI personality. At higher difficulty levels, the AI has a different calculation of what is considered "fair." Additionally, if you want to trade a tech with the AI it will often simply offer what it can afford, regardless of whether or not that is enough to be considered "fair."
No Way! I could have sworn that was actually Mansa Musa in there! You mean it's not?!!! Lighten up man. Stop mincing words. I'm obviously not talking in a literal sense.
Obviously. But much of your irritation seems to come from the idea that the AI isn't "human" enough. As it is, the AI has specific and predictable behavior that can be manipulated to the human player's advantage, if the human player understands the system and is willing to play by its rules. If not, then the human player can accept the diplomatic hit and play on. I believe that this is, in fact, working as intended, and is a good system overall.

Now wait. You said earlier that the AI is geared to want multiple resources when you NEED something, but it doesn't. Now, why shouldn't that be a two way street? I mean, if Catherine REALLY wants that fish, so far as I'm concerned she should be offering me more than one resource. Not turn around and be insulted because I wanted to haggle.
Yes, this could be possible. However, it seems very exploitable to me. I don't know how much the AI leaders broker deals between two or more other AI leaders, but if the human player is able to do this, then the AI should start doing it, too.
So wait...capitulation was just another short cut to avoid good AI programming or what? Either that, or capitulation has nothing to do with what I was talking about.
Short cut? Perhaps. But it has everything to do with what you were talking about. You were complaining that a civ would rather face annihilation than give up a resource, and I responded by saying that, through capitulation, the civ WILL in fact give up resources to preserve itself.
Nothing I've suggested inherently makes the game easier. It just makes it more interesting and layered. I said earlier in the game that I would much prefer a better programmed AI to the cheeky short cuts used to create parity via the diplomacy mechanisms. The problem in what you suggest is that there are clear, concise "best" decisions to make. I'm sorry, but more often than not, the decisions are horrible or worse.
Sometimes it's good to give a civ freebies if a high diplomacy score with that nation will help you gain an edge over another rival civ or to achieve diplomatic victory. In my observation, these types of decisions, especially the decision to go to war for diplomatic reasons, tends to be an "expert" strategy employed by "expert" players. Most players (myself included) would rather just say "no" and take the diplomatic penalty, rather than face the consequences of a hasty war declaration. Again, I refer you to the Strategy section of this site, where you will find several open games and walk-throughs that demonstrate the value of exploiting the diplomatic system to its fullest.
Sure it would. If you are building a space ship, and someone is going for a diplo victory that is MUCH more powerful than you, then what I propose would make it beneficial to vote for AI in the diplo victory to avoid getting utterly destroyed so you can launch your spaceship.
How is losing the game to Diplomatic Victory any "better" than losing due to war? A loss is a loss.
 
bardolph said:
One solution that I mentioned previously is to allow the human player to "red out" trade items that they are unwilling to trade, and having the AIs silently rack up the negative modifiers without bothering the player about it. This would preserve the current gameplay, but reduce the annoyance factor for those who don't want to be bothered by unreasonable requests.

This is from one of your earlier posts. It is a very imperfect solution but still better than what we have at the moment. Again, it would be far better for the AI to have some sense of which requests are sane and which aren't.
 
This is from one of your earlier posts. It is a very imperfect solution but still better than what we have at the moment. Again, it would be far better for the AI to have some sense of which requests are sane and which aren't.
It has nothing to do with "sanity." These requests/demands are made in their best interest, not in your best interest. There are situations where a diplomacy bonus is worth more than a war declaration or a free tech, but it takes experience to recognize those situations.
 
Regarding diplomatic victories....

The AI will vote for the AI. Humans won't vote for the AI.
The AI will vote for humans. Humans won't vote for humans.

I fail to see how the AI receives any different treatment?

Further, would that mean that the game was ok when diplomatic victory was turned on, but everyone who plays a game with that off has a valid complaint about broken diplomacy? Is it really that context sensitive.

================

And the accusation that others are obsessed over -1 penalties is an insulting strawperson.

Some people are interested in the cumulative effect, true, but they seem to be assuming the burden of describing where the threshold lies... haven't you seen remarks about how much slow-down of gameplay occurs with 30 civs? (Surely you would agree that there is a reasonable limit, if there were so many diplomatic requests per turn your computer couldn't function is obviously too far.) I have also noticed some people who just want neutrality to be lightly penalized. Conflating these lines of argumentation down to penalty-phobia is irresponsible.

Some people are interested in symmetry and don't care at all about bonuses. They want to be able to redline out some techs they won't trade, they want to be able to refuse contact. They want the AIs to pester one another with refused demands. Conflating this argument to penalty-phobia is wrong and silly.

Some people want logic in the diplomatic model, that trading with a worst enemy never makes one a worst enemy, winning a war establishes that one didn't need to pay tribute, that kind of thing. Conflating this argument to penalty-phobia is wrong but understandable.

Some people want more options, like a counter-offer stage in the help requests...."no I won't give you Rifling, but maybe Paper would help you out?" or options like "bribe me" in the war request stage. Or my pet favorite, cut off the ambassador's head in response to a threatening demand. Conflating this argument to penalty-phobia isn't even credible.

Above and beyond my characterizations of their positions, further evidence may be found in the solutions these characters propose. Very rarely is the emphasis on the penalties. Very often I hear them say "I'd accept a penalty to do blahblah." Very often naysayers propose solutions that ignore penalties that are embraced, although sometimes by only one of the above populations.

So that suggests a challenge to anyone who seriously intends to accuse that this thread is about penalty-phobia. Craft a solution to the above problems that isn't about the penalties and measure the extent to which it is embraced.
 
Regarding diplomatic victories....

The AI will vote for the AI. Humans won't vote for the AI.
The AI will vote for humans. Humans won't vote for humans.

I fail to see how the AI receives any different treatment?
In those terms, it doesn't. However, that supports my claim that the AI isn't generally "anti-human," which is the point that I was trying to make.

And the accusation that others are obsessed over -1 penalties is an insulting strawperson.
I'm not claiming that "penalty-phobia" is the only complaint people are voicing in this thread. It happens, however, to be the single complaint that I disagree most with. Other complaints (gameplay slowdown, etc) I agree with, and so have not taken the time to refute them.
Some people are interested in the cumulative effect, true, but they seem to be assuming the burden of describing where the threshold lies... haven't you seen remarks about how much slow-down of gameplay occurs with 30 civs? (Surely you would agree that there is a reasonable limit, if there were so many diplomatic requests per turn your computer couldn't function is obviously too far.) I have also noticed some people who just want neutrality to be lightly penalized. Conflating these lines of argumentation down to penalty-phobia is irresponsible.

I agree that gameplay slows down substantially with a great number of civs. I would also like to point out that the "default" settings have far fewer than 30 civs. I think it's 11 for a Huge map. The complexity of the game increases enormously when you increase the number of civs you are playing against, and this includes having to deal with more requests from other civs.

Some people are interested in symmetry and don't care at all about bonuses. They want to be able to redline out some techs they won't trade, they want to be able to refuse contact. They want the AIs to pester one another with refused demands. Conflating this argument to penalty-phobia is wrong and silly.

This is a separate issue from penalty-phobia, but another one that I disagree with. How can there be symmetry, when one entity is human and the other is computer-controlled? I think that giving the human player a decent challenge is more important than delivering symmetry.

As far as redlining techs or refusing contact, I consider these to be features of the diplomacy system, since it saves me the time of asking only to be refused. I agree that it would be nice for the human player to be able to redline out techs or set a "refuse to talk" flag in order to suppress those nagging requests. However, I don't believe that those features, if implemented, should protect the human player from diplomacy penalties.

Should the AI personalities give "you refused to help us" penalties to each other? I suppose so, as long as they also give each other "your trade has been fair and forthright" bonuses as well.

Some people want logic in the diplomatic model, that trading with a worst enemy never makes one a worst enemy, winning a war establishes that one didn't need to pay tribute, that kind of thing. Conflating this argument to penalty-phobia is wrong but understandable.
I'll take "understandable" ;)

Some people want more options, like a counter-offer stage in the help requests...."no I won't give you Rifling, but maybe Paper would help you out?" or options like "bribe me" in the war request stage. Or my pet favorite, cut off the ambassador's head in response to a threatening demand. Conflating this argument to penalty-phobia isn't even credible.
Yes, these would be good additions. However, I don't think that having the AI bribe the human player to enter a war would be a good idea. It's too exploitable, since AIs can be programmed to honor such commitments, whereas human players can never be forced to do so.
 
I'll try to say this without taking sides, I've spent a lot of time modding the AI so my hope is to help people understand it a bit more. In defense of the Civ 4 AI it isn't nearly as bad as it's made out to be, I've worked with far worse AI in other games. The thing that makes it look bad in most cases is the flexibility that was built in. That is to say that the AI doesn't know what 'paper' is, but it does know that a tech with the name of 'paper' allows them to trade maps. This makes it possible to add techs, remove techs and modify existing techs to your hearts content and the AI will generally continue to function as designed. I'll leave the AI programming details alone at that :)

In regards to diplomacy, the AI applies no penalties for trade negotiations regardless of the outcome. So if they offer you 5 gold for fission and you refuse, you're out 5 gold and they don't get the tech, nothing more. They will apply bonuses for accepting a favorable trade deal but never for refusing one. Demands & requests for help are different, both have bonuses and penalties depending on your choice. Disregard what you read in the diplomacy window or how the animated leaderhead acts when negotiating a trade deal, just remember that there are no penalties unless they're demanding or asking for help.

The only time you get a penalty for cancelling trades is when somebody else asks you do to it and you do. If you cancel trade deals on your own there is no penalty other than possibly losing a bonus for things like open borders and supplying them with resources.

The reason you can't 'red out' trade options in a litteral sense is because you can achieve the same result by simply refusing. Adding such an option may sound like a nifty idea at first but the extra overhead and the fact that you'd have to keep doing it everytime you learned a new technology or connected to a new resource means it really wouldn't solve anything, it would merely make a new tedious task to replace a different one. And, it would need to be handled in MP games and allow exceptions for team members, allies, vassels (or masters) etc. Just because one person never makes permanent alliances with or give valuable techs to the AI doesn't mean nobody does so the possibility needs to be taken into account.

The player to AI relationships are defined heavily by your choices when interacting with them through the diplomacy screen. This is a game mechanic and clearly intentional. Without such actions and their consequences the game would stagnate quickly or be reduced to a series of holy wars. Having the AI arbitrarily assign penalties behind the scene in the case of a player selecting a 'refuse to talk' option would create a lot of problems. Consider that the only people having any significant issues with it are those running modified games allowing for more than the officially supported number of civs on a map. Then, consider what would happen when an average player 'forgot' that they're refusing to talk to their best buddy and suddenly finds themself at war for 'no reason.' Whether or not the option is a good idea is less important that whether or not it is better than the alternative.

Now there are some options available to you right now that may help. If you're running a 30+ civ game you're obviously not against mods so you could make a few minor changes to offset the above average number of civs you use. In the CIV4LeaderHeadInfos.xml file each leader has a chance of contacting you, a delay between similar contacts, a modifier based on the result of the contact and a memory decay for that modifier. Essentially what will I contact you for, how often can I do it, how upset will I become and how long will I hold it against you? :)

Here's an example using one of your favorites:
Code:
				<ContactRand>
					<ContactType>CONTACT_JOIN_WAR</ContactType>
					<iContactRand>25</iContactRand>
				</ContactRand>

				<ContactDelay>
					<ContactType>CONTACT_JOIN_WAR</ContactType>
					<iContactDelay>10</iContactDelay>
				</ContactDelay>

				<MemoryDecay>
					<MemoryType>MEMORY_ACCEPTED_JOIN_WAR</MemoryType>
					<iMemoryRand>150</iMemoryRand>
				</MemoryDecay>
				<MemoryDecay>
					<MemoryType>MEMORY_DENIED_JOIN_WAR</MemoryType>
					<iMemoryRand>100</iMemoryRand>
				</MemoryDecay>

				<MemoryAttitudePercent>
					<MemoryType>MEMORY_DENIED_JOIN_WAR</MemoryType>
					<iMemoryAttitudePercent>-100</iMemoryAttitudePercent>
				</MemoryAttitudePercent>
The iContactRand value is a 1 in 'this number' chance of them chosing that option, so a high number makes it less likely to be selected. So with our bud Alexander here we have a 1:25 chance of him asking us to join a war.

The iContactDelay is the minimum number of turns that must pass before he will contact you for the same thing. Again, our bud Alexander here can potentiall nag you every 10 turns.

Then we have the decay rates, like the contact rands these are a one in 'this' chance that their memory will decay, lower numbers equate to a shorter memory.

Finally you have the modifier. This is a bit more complicated than it needs to be but as long as you understand that higher number (or larger negative values) equal bigger bonuses or penalties you'll be ok. It essentially works out in the game to 1/100th of this amount so -100 would show as a -1 in the game. Notice that there is no bonus for joining the war when asked, that's handled with the mutual military struggle bonus :)

Anyway, hopefully thats some encouragment for you so you can tweak it to your liking since it's pretty obvious that you'll never get the entire community to agree on anything. I know I've changed my own quite a bit because I have very different tastes than you do.
 
Fair enough. I think it's because, when an AI is bribed into war, it will actually attempt to fight that war, but the human player can simply take the tech and do nothing. - bardolph

And I always thought that this was another short coming of diplomacy, and how uncreative Fireaxis was in regards to diplomacy. If you get bribed into war, and you don't participate in it, or if you don't participate in it enough, then there should be a negative diplo hit. To go further, the AI doesn't always participate in war. They are just as likely to sit on the sidelines and enjoy the new technology as a human player. And more often than not, their efforts in war are half hearted at best. The one thing that have an AI declare war on an enemy almost always does, is if you have a SoD on your doorstep, and the AI you bribe into war declares, the enemy will almost always withdraw his SoD.

I disagree. If a country is at war, and you don't help them, they should penalize you for that. The fact that you are at war yourself is irrelevant. If the nation you wish to seek help from has "too much on their hands" to help you, then you certainly CAN penalize them in the same way, by cutting off trade and/or declaring war on them. - bardolph

But realistically, nobody does that. In a multi-player game, nobody does that. In real life, that doesn't happen. Do you do this in a game? When you are dogpiled do you get angry when your friendly AI who's also getting dogpiled won't, or CAN'T help you? Do you cut of your trade? Or are you just simply saying that a mechanism in the game is reasonable even though you'd never do such a thing yourself? Because, of course, it makes no sense to do what you describe.

Additionally, if you want to trade a tech with the AI it will often simply offer what it can afford, regardless of whether or not that is enough to be considered "fair." - Bardolph

This is sometimes true, but I would say 50/50 you get offered unfair trades when the AI has techs that it doesn't wanna trade. It doesn't see those tech's that it doesn't wanna trade, and offers up something ridiculous anyhow because that's just what's left over. Again, geared against the human.

I don't believe this is true, either. - bardolph

Okay, try this out then. Do one game where you don't declare war on ANYBODY. Not one single person. Have Shaka, Monty, Izzy, and some other irrationals in there to ensure that you will DoW'd. Then scroll through all the AI's. I garauntee you that you will see someone in that list complaining that you declared war on their friend.

But much of your irritation seems to come from the idea that the AI isn't "human" enough. - bardolph

No. My irritation comes from the fact that the AI wasn't programmed for s--t. It was half donkey'd.

Short cut? Perhaps. But it has everything to do with what you were talking about. You were complaining that a civ would rather face annihilation than give up a resource, and I responded by saying that, through capitulation, the civ WILL in fact give up resources to preserve itself. - bardolph

You're taking it a whole 'nother unneccessary step though. Who wants to capitulate? Come on man. If I stack three SoD's along your borders to completely Blitzkrieg your entire civilization, are you going to give up that oil? Or are you gonna let me declare war on you, capitulate, give up that oil anyway, and lose a heaping lot of points? I mean, if you and I were playing multiplayer, and I did that to you, what would you do? Seriously.

Like I said, if capitulation is an engine to get the resource you want anyway...then it's just really uncreative AI programming at hand.

Sometimes it's good to give a civ freebies if a high diplomacy score with that nation will help you gain an edge over another rival civ or to achieve diplomatic victory. In my observation, these types of decisions, especially the decision to go to war for diplomatic reasons, tends to be an "expert" strategy employed by "expert" players. Most players (myself included) would rather just say "no" and take the diplomatic penalty, rather than face the consequences of a hasty war declaration. Again, I refer you to the Strategy section of this site, where you will find several open games and walk-throughs that demonstrate the value of exploiting the diplomatic system to its fullest. - bardolph

Oh please, spare me. Anybody can manipulate diplomacy to their favor. Anybody can give up everything to boost relations. Who cares. The point is that you shouldn't have to do all that crap in the first place. And half of the begging is unreasonable and unneccassary, and is done as a short cut. It detracts from the game. Makes the game less fun.

To go further, there's nothing...expertish...in giving up everything. The expert is the person that says no to everything, because it can, and just wipes the floor with the AI anyhow.

------------------------------------------------------------

In defense of the Civ 4 AI it isn't nearly as bad as it's made out to be, I've worked with far worse AI in other games. - Seven

In defense of the St. Louis Rams, the Dolphins might be a lot worse than them, but that doesn't mean the St. Louis Rams have...a lot of room for improvement.

If you get my drift.

just remember that there are no penalties unless they're demanding or asking for help. - Seven

How do you differentiate between the two?

The reason you can't 'red out' trade options in a litteral sense is because you can achieve the same result by simply refusing. Adding such an option may sound like a nifty idea at first but the extra overhead and the fact that you'd have to keep doing it everytime you learned a new technology or connected to a new resource means it really wouldn't solve anything, it would merely make a new tedious task to replace a different one. - Seven

True to an extent. However, I find redding out a trade to the AI to be far less tedious than refusing to trade the tech 50 times. And again, I think this feature would make the game a little bit deeper.

The player to AI relationships are defined heavily by your choices when interacting with them through the diplomacy screen. This is a game mechanic and clearly intentional. Without such actions and their consequences the game would stagnate quickly or be reduced to a series of holy wars. Having the AI arbitrarily assign penalties behind the scene in the case of a player selecting a 'refuse to talk' option would create a lot of problems. Consider that the only people having any significant issues with it are those running modified games allowing for more than the officially supported number of civs on a map. Then, consider what would happen when an average player 'forgot' that they're refusing to talk to their best buddy and suddenly finds themself at war for 'no reason.' Whether or not the option is a good idea is less important that whether or not it is better than the alternative. - Seven

Who's gonna refuse to talk with their best friend? I don't play any of these 30 civ, or 24 civ games. 18 is the max for me. My computer handles it perfectly fine, even in the late game. At the very least, can we at least agree that it would be a good OPTION?
 
In defense of the St. Louis Rams, the Dolphins might be a lot worse than them, but that doesn't mean the St. Louis Rams have...a lot of room for improvement.

If you get my drift.
Not quite the same thing. Here your hitting technologicial limitations, remember a computer can only do one thing- count. Now it can count really, really fast but that is still all it can do. Until hardware architecture changes it will always be a matter of comprimises, the compromise here is the the Civ4 AI was designed for flexibility at the expense of some 'intelligence' whereas the alternative would handle specific situations a little better (most of the time) but would be completely incapable of adapting to changes.

How do you differentiate between the two?
It's pretty easy. A trade is when you have the opportunity to get something in exchange for giving them something. A demand or request for help only gives you the option ot accept or refuse.

True to an extent. However, I find redding out a trade to the AI to be far less tedious than refusing to trade the tech 50 times. And again, I think this feature would make the game a little bit deeper
I don't know about deeper but maybe more pleasant for some people :)

I have to wonder if you and some other people aren't unintentionally encouraging this behavior, I don't see it enough in my games to be a pain at all. Maybe I'll poke around the code some more tomorrow and see if I can find anything interesting.
 
The reason you can't 'red out' trade options in a litteral sense is because you can achieve the same result by simply refusing.

Seven05,

Thank you for your well-reasoned and well-supported post.

With redlined options, the inevitable AI requests/demands could be for other items, which I then might accept. This is obviously not the same outcome as refusing.

I think CIV players have some tolerance for the micromanagement necessary to protect a key tech or two, I sure would. Options like, redline uniquely held techs, or strategic resources, etc. seem to be trivial to answer some of your objections... automate redlining would be a button you could click on your governor, just mimic generic AI redlining.

=======

Look, I don't want redlining, I am in the wants-MUCH-better-diplomacy camp. But I definitely think that symmetry is a bare minimum.... and so I am willing to argue on that behalf until something better presents itself.
 
bardolph said:
It has nothing to do with "sanity." These requests/demands are made in their best interest, not in your best interest. There are situations where a diplomacy bonus is worth more than a war declaration or a free tech, but it takes experience to recognize those situations.
I would love an AI that acts in its best interest, however I don't think that those requests give the AI any real benefit, I think they actually harm the AI more. Let's go over them in turn:
Grossly uneven trade requests:
No obvious detriment to the AI, but at the very best very naive on its part. There is only a minute chance that an "expert" player will agree to that trade as part of some obscure diplo win strategy, so a really tiny chance of any benefit. Not as much benefit as proposing a better trade and not really worth annoying the player for.
Help requests:
Again, a minute chance of any benefit, but a very real chance of detriment to AI. I've already posted this, if the AI amasses enough "You refused to help us!" modifiers to push it past the no tech trade or no open borders threshold, it will actuallty hurt the AI because it will have no chance of getting at the player's techs and will lose possible trade route revenue.
Requests to join in war:
Again, minute chance of benefit, but real chance of harming itself when it amasses negative modifiers - see above. Also, say, you have a large army and would be willing to join in Darius' war against Shaka to do some pillaging and maybe try and take couple of Shaka's cities while he's busy elsewhere, for a couple of extra techs. In the meantime, Darius is getting fifteen kinds of <censored> kicked out of him by Shaka, still all he will try to help himself is the old "Zulu must be destroyed, don't you agree" pitch.
So to me it seems like those requests are really not for the benefit of the AI civs at all but just a clunky mechanism to try to make life more difficult for the player. And I don't think it even does a very good job at that - at Monarch I still manage to keep reasonable relations with most AIs despite those modifiers.
One more thing - I don't think I've ever seen a "You refused to help us" modifier in an AI-AI relationship breakdown in "At a glance" screen. I don't think AI ever asks other AI for help, at least nowhere near as often as it asks the player. So much for no anti-human bias.

========================================================
Seven05 said:
In defense of the Civ 4 AI it isn't nearly as bad as it's made out to be, I've worked with far worse AI in other games.

I actually think that the CivIV AI is on the whole pretty good, I've certainly seen far, far worse AIs. However, the diplomacy part of the CivIV AI is at times very poor IMO. It is actually all the more disappointing to see an AI act quite competently throughout the game and then come up with a proposal completely out of the leftfield, when you think "What the ...?? Ah well, it's only an AI".

Seven05 said:
Consider that the only people having any significant issues with it are those running modified games allowing for more than the officially supported number of civs on a map.

I play standard Huge Terra or Continents (or sometimes Big and Small) map, with 11 other civs, I have issues with it :)

Seven05 said:
The reason you can't 'red out' trade options in a litteral sense is because you can achieve the same result by simply refusing. Adding such an option may sound like a nifty idea at first but the extra overhead and the fact that you'd have to keep doing it everytime you learned a new technology or connected to a new resource means it really wouldn't solve anything, it would merely make a new tedious task to replace a different one. And, it would need to be handled in MP games and allow exceptions for team members, allies, vassels (or masters) etc. Just because one person never makes permanent alliances with or give valuable techs to the AI doesn't mean nobody does so the possibility needs to be taken into account.

As Merkinball has pointed out before, many people would still prefer that to what we have at the moment. Besides, if you want to trade a redlined tech to a friend/vassal/teammate you can contact them yourself and trade or gift them that tech. Or you could redline techs etc on a per-civ basis, that is, redline it for some civs but not the others.

Seven05 said:
The player to AI relationships are defined heavily by your choices when interacting with them through the diplomacy screen. This is a game mechanic and clearly intentional. Without such actions and their consequences the game would stagnate quickly or be reduced to a series of holy wars

If the player-AI interaction is limited to refusing a lot of dumb requests and amassing some negative modifiers than I'd rather have series of holy wars. However, there are so many more choices and factors that affect diplomacy apart from religion: matching civics, mutual wars, past wars against each other etc etc. Besides, I very much welcome interaction between player and AI affecting diplomacy as long as this interaction is intelligent, however that is not really what we have at the moment.

Seven05 said:
Then, consider what would happen when an average player 'forgot' that they're refusing to talk to their best buddy and suddenly finds themself at war for 'no reason.' Whether or not the option is a good idea is less important that whether or not it is better than the alternative.

As pointed out by Merkinball, you would have a 'refuse to talk' option on a per-civ basis, so you most likely would not refuse to talk to your best buddy, although you certainly could.

Seven05 said:
Not quite the same thing. Here your hitting technologicial limitations, remember a computer can only do one thing- count. Now it can count really, really fast but that is still all it can do. Until hardware architecture changes it will always be a matter of comprimises, the compromise here is the the Civ4 AI was designed for flexibility at the expense of some 'intelligence' whereas the alternative would handle specific situations a little better (most of the time) but would be completely incapable of adapting to changes

I don't believe that you would need to give up any flexibility at all to give the diplomatic AI some intelligence. Certainly I don't believe the current AI behaviour has anything to do with hardware limitations.
In trade requests, any tech, regardless of what it is, has to have a beaker cost, which the AI should be (and is) capable of evaluating. I have posted this before, AI is capable of evaluating whether the trade it is offering is uneven, it is just that it is programmed to still offer this trade. Just have it calculate the value of what it is about to offer against the value of what it is trying to get, if the value is below maybe 60-75 percent then do not offer the trade, as simple as that. I would assume that the relative trade value threshold would be configurable through XML. All it would add is a minimal overhead.
Help requests, just have the AI not ask for a tech as a favour. Ever. No extra overhead there, even an improvement in performance. For those few "expert" players who want to cosy up to the AI to get a Permanent Alliance, just have the AI give bonuses when the player offers the tech for free. I don't think AI gives any diplo bonuses when you offer help on your own initiative. I have in the past tried to gift techs to Tokugawa to get him to open borders with me, made no change at all.
The war declarations - in principle I'm OK with AI sometimes asking for help in war. However, at least check a few basics first: does the player have a big army? Does the player have better relationship with you than with the civ you're asking him to go to war with? Is the player at least cautious with you? Ideally the threshold should be 'pleased' or above. Is the player already involved in 3 other wars? What it the distance between the player's land and the land of the civ that you're asking him to go to war with - the greater the distance the greater the probability of not asking for help in war. I don't know how hard the last one would be to code, but I imagine it is possible. Finally, bribe the player to join your war. Again, this is some overhead, but not too overwhelming. I'd rather have the AI think longer about its move but act more intelligently when it makes that move.
Many thanks for the XML modifier tip though :goodjob: , I'll be doing some editing of this file for sure. However, I don't think this should have been necessary in the first place, and it should not be a requirement for all players to edit XML files to enjoy their game. Still, again thanks for the help. I wonder if you could be even more helpful :) and tell me which file (or files) in the dll source code is responsible for AI diplomacy. I think I'd like to have a look at some point.
 
Not quite the same thing. Here your hitting technologicial limitations, remember a computer can only do one thing- count. Now it can count really, really fast but that is still all it can do. Until hardware architecture changes it will always be a matter of comprimises, the compromise here is the the Civ4 AI was designed for flexibility at the expense of some 'intelligence' whereas the alternative would handle specific situations a little better (most of the time) but would be completely incapable of adapting to changes. - Seven

Well, I play on a laptop. About as good of a Dell M1210 XPS as you can buy. I have absolutely no problem running 18/Terra games. Also, if performance is that much of an issue, than couldn't there at LEAST be an option of advanced diplomacy? To go further, in the grand scheme of things, would the diplo modifications I've recommended throughout the thread really bog down performance as compared to the combat engine? The only time I notice slowdowns, is when massive wars break out.
 
Help requests, just have the AI not ask for a tech as a favour. Ever. No extra overhead there, even an improvement in performance.
I gave you instruction on how to do this for yourself, easy change :)

I don't think AI gives any diplo bonuses when you offer help on your own initiative.
They do, depending on whatever it is you give them is worth to them at the time. Gifts will typically be worth the same as giving in to a demand/request, depending on how much they value what you give them. Sometimes they can be worth even more, you can see the effect in the 'our trade realtions have been fair...' modifier.

I have in the past tried to gift techs to Tokugawa to get him to open borders with me, made no change at all.
Thats Tokugawa, you'd have better luck convincing Montezuma to adopt pacifism. :)

Still, again thanks for the help. I wonder if you could be even more helpful :) and tell me which file (or files) in the dll source code is responsible for AI diplomacy. I think I'd like to have a look at some point.
My experience is pretty limited concerning changing how they decide what to ask (outside of the XML sample posted). I've spent a lot of time working on relationships (modifiers) so I know where that code is, the rest of the diplomacy code is spread out as far as I can see. Most of the imprtant stuff is in the CvPlayerAI.cpp and CvTeamAI.cpp files. You'll probably want to start in CvPlayerAI.cpp and look at how attitudes are calculated. You can look at CvDiploParameters.cpp but it won't help much, ironic eh? Keep in mind that a lot of the diplomacy code will be dependant on un-related code, for example war plans are important in AI diplomacy so you'll want to look at those functions to see how the AI determines its war plan too. I'll look around for some of that specifically later and point you to a better location if you haven't already found it yourself.
 
Well, I play on a laptop. About as good of a Dell M1210 XPS as you can buy. I have absolutely no problem running 18/Terra games. Also, if performance is that much of an issue, than couldn't there at LEAST be an option of advanced diplomacy? To go further, in the grand scheme of things, would the diplo modifications I've recommended throughout the thread really bog down performance as compared to the combat engine? The only time I notice slowdowns, is when massive wars break out.
It's not a speed issue, it's an architecture issue. Compare your laptop to an old 24MHz 386, it's a lot faster but it isn't any smarter. There is no way to take one of these fancy counting machines and make them smart right now, and until there is you're going to keep hitting the same limits with artificial intelligence, that is it will definately be artificial but rarely intelligent.
 
Ok, did some digging around so I could give you a better answer. :)

In CvPlayerAI.cpp and CvTeamAI.cpp you have a series of denial methods. This is where the AI 'red's out' items in the list and determines the text that will show when you mouse over it. In almost every case if the target is a human player (meaning the person whos list of tradeable items is being drawn) it doesn't do anything except allow it (NO_DENIAL). This is obviously essential for MP games and the biggest hurdle with simply treating the AI and players the same is that the player has no attitude value with AI civs and unlike the AI the player may want to make exceptions.

Now, you can address specific issues with limited solutions assuming you don't want the hassel of creating new interfaces and making it all work :)

In CvPlayerAI.cpp there is a method caled AI_doDiplo() where the AI makes its decsions about who to contact and for what reason. You can search for some strings like CONTACT_JOIN_WAR to find specific instances. In fact, here is the SDK code for the AI's determination on wether or not to contact another civ to ask them to join the war (I wouldn't even look at it unless you somewhat familiar with C++, no worthwhile comments in there):
Spoiler :
Code:
									if (GET_PLAYER((PlayerTypes)iI).isHuman() && (GET_TEAM(getTeam()).getLeaderID() == getID()))
									{
										if ((AI_getMemoryCount(((PlayerTypes)iI), MEMORY_DECLARED_WAR) == 0) && (AI_getMemoryCount(((PlayerTypes)iI), MEMORY_HIRED_WAR_ALLY) == 0))
										{
											if (AI_getContactTimer(((PlayerTypes)iI), CONTACT_JOIN_WAR) == 0)
											{
												if (GC.getGameINLINE().getSorenRandNum(GC.getLeaderHeadInfo(getPersonalityType()).getContactRand(CONTACT_JOIN_WAR), "AI Diplo Join War") == 0)
												{
													iBestValue = 0;
													eBestTeam = NO_TEAM;

													for (iJ = 0; iJ < MAX_CIV_TEAMS; iJ++)
													{
														if (GET_TEAM((TeamTypes)iJ).isAlive())
														{
															if (atWar(((TeamTypes)iJ), getTeam()) && !atWar(((TeamTypes)iJ), GET_PLAYER((PlayerTypes)iI).getTeam()))
															{
																if (GET_TEAM(GET_PLAYER((PlayerTypes)iI).getTeam()).isHasMet((TeamTypes)iJ))
																{
																	if (GET_TEAM(GET_PLAYER((PlayerTypes)iI).getTeam()).canDeclareWar((TeamTypes)iJ))
																	{
																		iValue = (1 + GC.getGameINLINE().getSorenRandNum(10000, "AI Joining War"));

																		if (iValue > iBestValue)
																		{
																			iBestValue = iValue;
																			eBestTeam = ((TeamTypes)iJ);
																		}
																	}
																}
															}
														}
													}

													if (eBestTeam != NO_TEAM)
													{
														if (!(abContacted[GET_PLAYER((PlayerTypes)iI).getTeam()]))
														{
															AI_changeContactTimer(((PlayerTypes)iI), CONTACT_JOIN_WAR, GC.getLeaderHeadInfo(getPersonalityType()).getContactDelay(CONTACT_JOIN_WAR));
															pDiplo = new CvDiploParameters(getID());
															FAssertMsg(pDiplo != NULL, "pDiplo must be valid");
															pDiplo->setDiploComment((DiploCommentTypes)GC.getInfoTypeForString("AI_DIPLOCOMMENT_JOIN_WAR"), GET_PLAYER(GET_TEAM(eBestTeam).getLeaderID()).getCivilizationAdjectiveKey());
															pDiplo->setAIContact(true);
															pDiplo->setData(eBestTeam);
															gDLL->beginDiplomacy(pDiplo, (PlayerTypes)iI);
															abContacted[GET_PLAYER((PlayerTypes)iI).getTeam()] = true;
														}
													}
												}
											}
										}
									}
In that code (PlayerTypes)iI is the player being contacted and (PlayerTypes)iJ is the 'enemy' team. So a good option here is to add a check looking at the attitude of iI to iJ unless iI is human in which case you'd look at iJ's attitude towards iI which is a bit more complicated since iJ is a team, not a player. Anyway, once you know the attitude you could then figure out how to limit it, a good option may be to see if the demanding civ's attitude with iI is higher than iJ's attitude with iI. To make it less confusing let's take an example... Say Monty was at war with Izzy and Monty is Cautious towards you while Izzy is pleased towards you. In this case using my suggested option Monty would not ask you to join the war but Izzy might.

The same effect could them be applied to the demand to stop trading. In either case you could also opt for 'hard limits' like not allowing them to ask you to join the war with anybody who is not either Furious or Annoyed with you. Or, even easier, only let them ask you if their attitude with you is friendly or pleased. So using the above example again, Monty couldn't ask because he's cautious with you, he couldn't even ask if Izzy were furious with you.

Of course you could make it even more complicated by defining the limit based on state religion or enthnic group. This could let you do some fun things like allowing people with the same state religion as you ask you to declare war on your friends, the infidels with a different state religion but perhaps only if both of you were running under theocracy.

Interestign stuff... I think I'm going to have to play around with this for my mod :)
 
Hey guys, just a couple of words from the sideline.

The whole detailed debate shows that there is something to do with diplomacy. No less Civ4 discs were sold out, if there were an "Enhanced diplomacy" option to be clicked on if you like.

I am keen on making diplomacy on a wider range. Just let those programmers in Firaxis drink an other coffee and stay in front of their computers to strengthen the AI !!!!
 
Anybody want to test a DLL with modified diplo parameters? :)

What I've been able to do rather easily was add in a simple check that ensures that the 'requester' has better relations with that 'requestee' than the 'target' does before asking you to join a war. It only affects the game where the 'requestee' is human and applies no bonus or penalty if the check fails and the request isn't made. Since the only bonus you receive when the AI asks you to join a war is the mutual military struggle, which you receive even if they don't ask you, you still have the ability to join on your own to improve relations.

I haven't messed with anything else yet. I'm still not sure what the best way to handle stop trading requests is. I'm worried that too many changes here will make it easy (even very easy) to stay neutral. In my mod that may work OK since I've made it more difficult to get open borders and trade techs which makes neutrality less advantageous but I think the vanila game may suffer from that. Perhaps it's as simple as making sure the requester's relations with you are at least equal to the target's relations with you rather than requiring them to be better. Oh well, something to do tonight.
 
Seven05, that's great, many thanks for the information. I can code a bit of C++ but just wouldn't know where to start with the code. I'll definitely want to play around with it at some point though.
Re your DLL with modified diplo parameters - I doubt I'll be able to do much this week, sorry, but over the weekend I'll can give it a go, just let me know where you want to upload it. I'm not sure if we're going a bit offtopic with this though, maybe this should go to the customization forum.
 
Seven05, that's great, many thanks for the information. I can code a bit of C++ but just wouldn't know where to start with the code. I'll definitely want to play around with it at some point though.
If you can handle C++ it's easier to just try the change yourself so you don't have to deal with any of my other changes. Just find this line in CvPlayerAI.cpp:
Code:
iValue = (1 + GC.getGameINLINE().getSorenRandNum(10000, "AI Joining War"));
And replace with:
Code:
if (AI_getAttitude((PlayerTypes)iI) > GET_PLAYER(GET_TEAM((TeamTypes)iJ).getLeaderID()).AI_getAttitude((PlayerTypes)iI))
	iValue = (1 + GC.getGameINLINE().getSorenRandNum(10000, "AI Joining War"));
else
	iValue = 0;
The 'catch' here with my method is that I use the team leader's attitude for the 'target' team. So if an AI wants you to join a war against another civ that is a vassal state it will use your relationship with the master, not the vassal. In the case of permanent alliances it will use your relationship with the highest scoring player in the alliance.

To replace it with static attitudes you just use the attitude type enums in place of getting the attitude of the target team's leader. So things like ATTITUDE_CAUTIOUS or ATTITUDE_PLEASED. Or you can flip it and ignore the attitude of the requesting player and just evaluate the attitude of the target in much the same way.

You can also do some other things like moving down to the code after- if (eBestTeam != NO_TEAM) and adding a loop in there to change the AI contact timer for all AI players. This way if one AI asked you to join a war NOBODY would be able to ask you again until x number of turns passed. That would eb a good way to maintain the current flavor but simply reduce the frequency of requests.
 
I finally uploaded my mod (see sig) if anybody is curious about seeing the changes in action. Unfortunately you'll have to deal with the rest of my changes to the game. It actually works very well, so thanks for the encouragement to make the change :)
 
Back
Top Bottom