Better BUG AI

The original code had this near the top:
Code:
if (getAnyWarPlanCount(true) > 0)
{
	return DENIAL_TOO_MANY_WARS;
}
The betterAI code moves that part right to the bottom, but puts something else at the top:
Code:
// Hide WHEOOHRN revealing war plans
if( getAtWarCount(true) > 0 )
{
	return DENIAL_TOO_MANY_WARS;
}
So if the AI hates you, it can still say "WHEOOHRN", but only to indicate that it is already at war. It won't say it if it is only preparing for war.

(I don't know if it is the same in this BUG version. I'm just looking at the betterAI code.)
 
But why should the AI tell you it has too much on it's hands even if it's at war? In BBAI the AI can open up multiple war fronts, by tripping this trade denial, it is saying it is too weak to consider another war. Why tell other players this? I can see the logic to tell this to it's friends, but why broadcast this to all players?
 
If an AI is not at war but WHEOOHRN then you know it's planning a war. If it's already in a war, then you don't gain any additional info by WHEOOHRN: the current wars could be tying the AI up, it could be a completely different reason, but in the end you don't learn whether or not the AI has any additional war plans from a WHEOOHRN of a civ that is already in war.
 
Based on my limited knowledge, my understanding is that the AI will never be bribed into a war while it is already at war. So although it may make it's own war plans on multiple fronts, it will not be bribed into fighting on a second front under any circumstances — regardless of its strength or the strength of the enemy. That's my impression from the bits of code we've been talking about, but I could be wrong.
 
But why should the AI ever tell you it's WHEOOHRN status if it's not your friend? How would the AI ever benefit telling a player this rather then "We just don't like you enough"? The rejection tips it's hand, and that only makes sense to do for it's friends? It just seems like a bad choice for it to make, given it's options. Why tell a player basically "We are too weak to take on, or plan any other wars" when it could just as easily say "Piss off" (or "We just don't like enough"). I see no reason for the AI to tip it's hand like this, except to give an advantage to it's opponents.
 
Based on my limited knowledge, my understanding is that the AI will never be bribed into a war while it is already at war.


This is not true with BBAI: f the AI doesn't calculate that it's current WarPlan is taking up it's resources it can select other war targets (and attack them) or be bribed into other wars.
 
If an AI is openly at war there is no use in hiding that fact in diplomacy. I understand you from a role-play point of view but hiding it simply isn't needed.

How could it be brided into other wars if there is a if (getAnyWarPlanCount(true) > 0) at the end which always prevents it?
 
Ah good point. But why then will it reject a bribe if it is still willing to select new war targets on it's own? Maybe this logic got cut, but I know for a while the AI would attack multiple targets.
 
I'm not saying it can't select other targets on it's own, it just won't get bribed into it.
I guess in RevDCM it can be brided into going to war with an already selected target with ruthless ai on but that's an exception, not the norm.
 
I guess in RevDCM it can be brided into going to war with an already selected target with ruthless ai on but that's an exception, not the norm.

Not true. CanTradeItem(&item, TRADE_WAR) checks for denials. (Code from memory)
 
Well then I guess the question becomes, should the AI automatically deny a War bribe, even if it would consider war with that target (and even could be planning it) when it is already at war; should this denial be automatic? IMO it should not.
 
Well then I guess the question becomes, should the AI automatically deny a War bribe, even if it would consider war with that target (and even could be planning it) when it is already at war; should this denial be automatic? IMO it should not.

I added this code in my mod, should be applicable here too:
Code:
DenialTypes CvTeamAI::AI_declareWarTrade(TeamTypes eWarTeam, TeamTypes eTeam, bool bConsiderPower) const
{
	PROFILE_FUNC();

	AttitudeTypes eAttitude;
	AttitudeTypes eAttitudeThem;
	bool bLandTarget;
	int iI;

//	FAssertMsg(eTeam != getID(), "shouldn't call this function on ourselves");
	//AI Autoplay calls this
	FAssertMsg(eWarTeam != getID(), "shouldn't call this function on ourselves");
	FAssertMsg(GET_TEAM(eWarTeam).isAlive(), "GET_TEAM(eWarTeam).isAlive is expected to be true");
	FAssertMsg(!isAtWar(eWarTeam), "should be at peace with eWarTeam");

	if (GET_TEAM(eWarTeam).isVassal(eTeam) || GET_TEAM(eWarTeam).isDefensivePact(eTeam))
	{
		return DENIAL_JOKING;
	}
/************************************************************************************************/
/* Afforess	                  Start		 04/06/10                                               */
/*                                                                                              */
/*  Ruthless AI: Refusing war when we are planning it anyway is silly                           */ 
/************************************************************************************************/
	if (AI_isChosenWar(eWarTeam) && (GC.getGameINLINE().isOption(GAMEOPTION_ADVANCED_DIPLOMACY) || GC.getGameINLINE().isOption(GAMEOPTION_RUTHLESS_AI)))
	{
		return NO_DENIAL;
	}
/************************************************************************************************/
/* Afforess	                     END                                                            */
/************************************************************************************************/
 
Actually that code is in RevDCM, and that was what I meant before when I said the ruthless AI, unless any other, actually can get bribed into another war .. if it was already planning it anyway.
 
I cannot get Tortoise to work with your svn directory. Whats the exact checkout link to your files?

I'm always getting errors like this:

Command: Checkout from http://bullai.svn.sourceforge.net/viewvc/bullai, revision HEAD, Fully recursive, Externals included
Error: Repository moved temporarily to '/viewvc/bullai/'; please relocate
Finished!:
 
Ty. Which C++ tools do you use?

I'm using Visual C++ 2005 Express, Platform SDK 2003 Server SP1, Visual C++ Toolkit 2003

and when I try to open your project file, it says something must get converted!? Any idea?
 
I'm using Visual Studio .NET 2003, so my file is the same format as the original project file from BTS' CvGameCoreDLL. Not sure if you can use that one with 2005 at all, but I guess you'll find out.
 
I think you're better off creating a new project. Since you're using the Express version, you won't get any of the compilation abilities and settings. All you need is to set up a new makefile project and add the files for easy editing.
 
Back
Top Bottom