Advertisement
Civilization Fanatics' Center  

Welcome to Civilization Fanatics' Center.

You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support.

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - Modpacks

Notices

Reply
 
Thread Tools
Old Sep 04, 2010, 01:26 AM   #301
karadoc
AI programmer
 
karadoc's Avatar
 
Join Date: Oct 2005
Location: Australia
Posts: 1,455
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.)
karadoc is offline   Reply With Quote
Old Sep 04, 2010, 01:32 AM   #302
Fuyu
Emperor
 
Fuyu's Avatar
 
Join Date: Nov 2009
Location: Austria
Posts: 1,147
nvm --- yes you are right, AtWarCount looked too similar to WarPlanCount

Last edited by Fuyu; Sep 04, 2010 at 01:36 AM.
Fuyu is offline   Reply With Quote
Old Sep 04, 2010, 03:13 AM   #303
phungus420
Deity
 
phungus420's Avatar
 
Join Date: Mar 2003
Posts: 6,296
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?
__________________
Do not PM me with questions about modding. I will not answer. If you want help with something, start a thread on it, or post in a related existing thread.
phungus420 is offline   Reply With Quote
Old Sep 04, 2010, 03:22 AM   #304
Fuyu
Emperor
 
Fuyu's Avatar
 
Join Date: Nov 2009
Location: Austria
Posts: 1,147
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.
Fuyu is offline   Reply With Quote
Old Sep 04, 2010, 03:40 AM   #305
karadoc
AI programmer
 
karadoc's Avatar
 
Join Date: Oct 2005
Location: Australia
Posts: 1,455
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.
karadoc is offline   Reply With Quote
Old Sep 04, 2010, 03:43 AM   #306
phungus420
Deity
 
phungus420's Avatar
 
Join Date: Mar 2003
Posts: 6,296
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.
__________________
Do not PM me with questions about modding. I will not answer. If you want help with something, start a thread on it, or post in a related existing thread.
phungus420 is offline   Reply With Quote
Old Sep 04, 2010, 03:45 AM   #307
phungus420
Deity
 
phungus420's Avatar
 
Join Date: Mar 2003
Posts: 6,296
Quote:
Originally Posted by karadoc View Post
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.
__________________
Do not PM me with questions about modding. I will not answer. If you want help with something, start a thread on it, or post in a related existing thread.
phungus420 is offline   Reply With Quote
Old Sep 04, 2010, 03:53 AM   #308
Fuyu
Emperor
 
Fuyu's Avatar
 
Join Date: Nov 2009
Location: Austria
Posts: 1,147
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?
Fuyu is offline   Reply With Quote
Old Sep 04, 2010, 04:02 AM   #309
phungus420
Deity
 
phungus420's Avatar
 
Join Date: Mar 2003
Posts: 6,296
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.
__________________
Do not PM me with questions about modding. I will not answer. If you want help with something, start a thread on it, or post in a related existing thread.
phungus420 is offline   Reply With Quote
Old Sep 04, 2010, 04:05 AM   #310
Fuyu
Emperor
 
Fuyu's Avatar
 
Join Date: Nov 2009
Location: Austria
Posts: 1,147
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.
Fuyu is offline   Reply With Quote
Old Sep 04, 2010, 05:51 PM   #311
Afforess
The White Wizard
 
Afforess's Avatar
 
Join Date: Jul 2007
Location: Michigan, USA
Posts: 10,652
Images: 8
Quote:
Originally Posted by Fuyu View Post
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)
__________________
"A Witty Saying Proves Nothing"
-Voltaire

Civilization 4 Mods: Rise of Mankind - A New Dawn 1.75
Civilization 5 Mods: Active City Defense, Tech Diffusion
Minecraft Mods: Spout & Spoutcraft Lead Developer
Afforess is offline   Reply With Quote
Old Sep 04, 2010, 07:01 PM   #312
phungus420
Deity
 
phungus420's Avatar
 
Join Date: Mar 2003
Posts: 6,296
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.
__________________
Do not PM me with questions about modding. I will not answer. If you want help with something, start a thread on it, or post in a related existing thread.
phungus420 is offline   Reply With Quote
Old Sep 04, 2010, 07:17 PM   #313
Afforess
The White Wizard
 
Afforess's Avatar
 
Join Date: Jul 2007
Location: Michigan, USA
Posts: 10,652
Images: 8
Quote:
Originally Posted by phungus420 View Post
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                                                            */
/************************************************************************************************/
__________________
"A Witty Saying Proves Nothing"
-Voltaire

Civilization 4 Mods: Rise of Mankind - A New Dawn 1.75
Civilization 5 Mods: Active City Defense, Tech Diffusion
Minecraft Mods: Spout & Spoutcraft Lead Developer
Afforess is offline   Reply With Quote
Old Sep 04, 2010, 10:10 PM   #314
Fuyu
Emperor
 
Fuyu's Avatar
 
Join Date: Nov 2009
Location: Austria
Posts: 1,147
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.
Fuyu is offline   Reply With Quote
Old Sep 13, 2010, 07:02 AM   #315
Cybah
Emperor
 
Cybah's Avatar
 
Join Date: Jun 2007
Posts: 1,453
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!:
Cybah is offline   Reply With Quote
Old Sep 13, 2010, 09:30 AM   #316
Fuyu
Emperor
 
Fuyu's Avatar
 
Join Date: Nov 2009
Location: Austria
Posts: 1,147
viewvc is for looking at the svn with a web browser. For svn clients you need https://bullai.svn.sourceforge.net/svnroot/bullai
Fuyu is offline   Reply With Quote
Old Sep 13, 2010, 01:03 PM   #317
Cybah
Emperor
 
Cybah's Avatar
 
Join Date: Jun 2007
Posts: 1,453
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?
Cybah is offline   Reply With Quote
Old Sep 13, 2010, 01:28 PM   #318
Fuyu
Emperor
 
Fuyu's Avatar
 
Join Date: Nov 2009
Location: Austria
Posts: 1,147
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.
Fuyu is offline   Reply With Quote
Old Sep 13, 2010, 04:00 PM   #319
EmperorFool
Deity
 
EmperorFool's Avatar
 
Join Date: Mar 2007
Location: Mountain View, California
Posts: 9,624
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.
__________________
Monkeys killing monkeys killing monkeys over pieces of the ground.
Silly monkeys, give them thumbs they make a club and beat their brother down.


BUG Mod - BTS Unaltered Gameplay
[ Forum | Download | FAQ | Known Issues | Troubleshooting | Modding Tutorial ]

BAT 3.0.1 QuickFix™ released Oct 24th
EmperorFool is offline   Reply With Quote
Old Sep 23, 2010, 04:57 AM   #320
keldath
LivE LonG AnD PrOsPeR
 
keldath's Avatar
 
Join Date: Dec 2005
Location: israel
Posts: 4,855
hey fuyu,

any chance of an update for this one?
__________________
keldath is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - Modpacks > [BTS] Better BUG AI

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Merging Better AI with BUG 3.5 Dresden Civ4 - Better AI 156 Jan 27, 2011 11:22 AM
Better BUG AI Bug King Flevance Civ4 - Creation & Customization 2 Jan 17, 2010 02:51 AM
Serious bug in euro ai Imagawa99 Civ4Col - Bug Reports 1 Oct 24, 2008 11:41 PM
Is this a bug or is the AI senile? dante alighieri Civ4 - General Discussions 3 Oct 08, 2007 10:53 AM
small AI bug LordOfTheDrinks Civ4 - Bug Reports 1 Mar 04, 2006 08:41 PM


Advertisement

All times are GMT -6. The time now is 10:19 AM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
This site is copyright © Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR