When I said pointer, and talking about AI code, I'm talking about the CvPlayerAI* pointer that refers to the in-memory data structure that reflects the current state of a given player's AI.
The AI code for each player in Civ4 has full access to all of the other AI's state. We could make the AI "better" by examining that pointer, and figuring out what the plans of other AIs are, by reading the plans of the other AIs written down in plain view.
We don't do that.
As it happens, Civ4 AIs leak some of this information by giving excuses that translate pretty directly to "I am building up to go to war with someone" -- and, if this happens immediately after you refuse tribute, you pretty much know who it is they are building up to go to war with.
The AI in Civ4 has no need to use that 'feature' to read the other AIs war plans: it could just read it directly. But the AI in Civ4 doesn't do that, and betterAI doesn't do that. On purpose.
Ok, it looks i was not clear enough... I should had not used the word pointer. What Imeant is that the AI could be taught with 20 lines of code ( or something close ) to get the most likely target of a war prep of other AI just by reading diplo levels, worst enemy tags and power rating ... the algorithim is simple enough. There is no need for checking warplans ( and i would be obviously be against doing that )
Now on your examples... really Yakk, do you only see that kind of situations in game? Didn't you ever got a AI that decided war on you just because it didn't liked your face in the diplo screen on 1st contact? ( I did ) Or any other situations diferent of those? In fact, most of the wars that the AI declare for refusal of demands don't require "hands full" and only show them if they can't put the attack SoD out in the border in the turn they decide to war ( so that is a particularly badly chosen example ) ... they might even declare war directly on refusal of demand ( already happened to me ). And to add, EVEN with "hands full" as it is , in most times you can't be certain of who is the target of the buildup...
To end, the "hands full" intel does not only apply to possible wars vs you , it also gives intel about wars between the AI and third parties ( a thing that looks to had never crossed your mind in this thread ). IMHO making the AI aware of third party warpreps would be something that would really make them smarter
No: I want the AI to not tell other players, whom it doesn't want to know about war plans, about their war plans. For AI to AI, this can be done by just 'not looking'. For AI to Player, this can be done by only talking about your build up to war with people who you are sufficiently friendly with -- which is as simple as delaying that reason to refuse until every other condition is tested.
As you pointed, this is what
you want. Other player might want that the AI doesn't tell when it is not asked that it is afraid of the possible target power ... so cut the DENIAL_POWER_THEM ( in the end , it is a very telling piece of intel, because it reveals the ratio of the their power vs the target civ one, a intel you might not have via espionage or the Demographics ) or push to the end ( oh wait, you can't push it to end, the "hands full" is already there

)... and why stop here? Better cut all the denials ... that is a failsafe way of not letting the AI say too much
It also makes the AI more competitive against that player. One could call it better.
The AI no longer gives the most sensitive reason for joining in a war proposal first. This is smarter.
Well, sustitute "your proposal" in the quote you made for "playing with hands tied", "playing without a screen", "playing without electric supply to the computer" and see if that reasoning makes sense

... making the human player life harder is not making the AI better
On the second sentence... well, you are assuming that it is always a good idea to make the warpreps on the shadows. In fact, you see the RL history, there was no war in the XX century that had not had the war preps amply publicized ( and this century has it going in the same direction ). Why? Simple: a amply publicized war prep but without a defined enemy can make much more damage than the war it self. If you think this doesn't happen in Civ IV, I suggest you to look to the SG I'm hosting, where, due to the fact that it wasn't clear who was the target of one of the AI, the team was forced to make a military buildup that proved to be completely unnecessary and that it came in a very bad time ( lib race ).
Bottom line: ok, I admit that in certain situations the AI will be stupid to say to the world that is preparing a war, especially when it is dead in the water who is the target. But those cases are a minority, so making a case in top of that is a little bit shaky. And like i said, there are definite advantages in saying to the world that you are preparing a war, but without saying against who, and who knows if the original coder ( or the BtS coder ) didn't considered this advantages to outweight the negative effects of when the target is clear and put that denial on top on propose. Not having Soren or Blake in here to say of their justice, we will never know...
If I could teach the AI and the game to deal with a human vassal, and it was easy (that would involve coding many of the 'tendencies' that vassals have to kow-tow to their master into game rules), and it was easy, I'd do it.
Again you are showing that you think that perfection is acheived when there is nothing left to be taken away

That is definitely a strange answer to give in a forum of a mod that intends to make the AI to play better: it it gives too much work to make the AI to play decently , we can always tie the hands of the human player ...
In fact i see a contradiction in terms: you would be ready to make the AI to be smart enough to have a human vassal without shooting itself of the foot, but you are unwilling to make the AI to make assumptions on intel that the other AI give, and because of that you want to forbid the human to have acess to that intel ....
Because it is the most sensitive reason. The other hovers often describe what the other party could do to make it more likely that the AI would go with the proposal. "Be more friendly", "reduce the power of the person you want me to attack", etc. The AI wants the asker to know that information, because the AI really "wouldn't mind" helping a friendly ally against a low-power enemy in exchange for a bribe.
Again you are assuming that it is always in the best interest of the AI to be quiet about their warplans.... passing that, the "hands full" also says something of that kind: "make me change my mind or wait for me to change it on my own if you really want me to attack your target". Again, no real diference
I think that, immediately after making a demand, and the demand being refused, telling the person you threatened if the threat is almost certainly going to lead to war, and never bluffing, and never leveraging that follow through on the threat, is a stupid decision on the part of the AI.
There is a 'better' solution of having the AI lie about what reasons the AI won't do something in a way that makes the player do things the AI wants. But that is ridiculously complex.
Well, as I already said, even with "hands full", in the majority of the cases you have no certains of what the target of the build up is or even if the AI will take it all the way ( I was surprised in the other day while playing RR6 and seeing Boudica (!) backing out of "hands full" by it's own decision ... given that it is a quite agressive LH that has a UU that can get CR promos ( so it is far less likely to get their governors building trash ( this obviously taking the war decision in consideration ) like COUNTER and RESERVE units ), it was probably the last time I saw that

), so beating on that is moot.
You have a point in saying that making that the AI makes use of that intel for bluffing would probably give work. But most of the work would be making a robust "threat" function ( to check if the AI looks bad enough for the bluff to stick ), a thing that will surely be done sooner or later ( because it is needed for pretty much all the aspects of the AI warfare ). So it is a lot of work just for that, but it comparatively a lot less if you consider all the other things that the core of this improvement would be used for.
@ martin
To say the truth I don't like much that a single denial covers both warpreps and war in itself. They are diferent realities and the code should reflect that. The best thing ( and again a issue that it is not completely in the scope of this mod ) would probably be make a denial for when the AI is in war and doesn't want to pick other and other for when the AI is planning a war on their own and does not want to be interrupted on that ... but that is probably too much
And to be true to myself, I don't see much sense on the DENIAL_ATTITUDE as it is now, because it simply checks if the AI doesn't like you. Think on this: if someone that you aren't very fond of made a huge payment for you to try to give a beat to your worst enemy, would you say automatically no just because you aren't his BFF ? Making the first denial to be the attitude one IMHO is not a good idea because of that ... if the attitude one is changed to acept possible bribes to people that they hate more than you, then I agree on putting it first.