1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

AI Attitude Explained

Discussion in 'Civ4 Strategy Articles' started by ori, Jan 27, 2007.

  1. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,537
    Location:
    Baden-Württemberg, Germany
    :lol:

    You have been fooled by Nacht :p he uses a modded version of Civ which includes some visible modifiers that are usually invisible and/or some new modifiers...

    :D
     
  2. Bhruic

    Bhruic Chieftain

    Joined:
    Nov 15, 2005
    Messages:
    1,457
    I'm curious as to why you look at 4 & 5 as "bonuses"? I mean, basically it seems to me that it's designed to make warmongers dislike peaceniks, but like other warmongers. And peaceniks like peaceniks, but dislike warmongers. Not sure if that qualifies as "bonuses" or not in my book.

    Bh
     
  3. Nacht

    Nacht Chieftain

    Joined:
    Aug 27, 2006
    Messages:
    29
    Location:
    Amsterdam
    Well there are no minuses involved, so noone dislikes anyone because of it. It's just some AI's liking eachother by default.
     
  4. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,537
    Location:
    Baden-Württemberg, Germany
    This is not true for 4 (unless I misunderstand that code completely). If Gandhi gets a PeaceWeight of 13 and Monty one of 0 this should result in -9 between the two, if Gandhi gets 10 and Monty 3 it should be -3 which is quite significant...
     
  5. Nacht

    Nacht Chieftain

    Joined:
    Aug 27, 2006
    Messages:
    29
    Location:
    Amsterdam
    Having checked it again, it seems you're right concerning Item 4. That one indeed can be negative, although most of the time it is not, and it still singles out the human player. Item 5 is always positive though.

    My experience before I modded those out is that a lot of AI's were pleased with each other just after having met. In my current games everyone is cautious to everyone else at the start.
     
  6. Nacht

    Nacht Chieftain

    Joined:
    Aug 27, 2006
    Messages:
    29
    Location:
    Amsterdam
    crosspost ;)
     
  7. NKVD

    NKVD Cossack

    Joined:
    Aug 30, 2002
    Messages:
    1,686
    Location:
    Stalingrad, Québec
    what is this mod ? i know you'll call me lazy but just a name would be great
     
  8. Nacht

    Nacht Chieftain

    Joined:
    Aug 27, 2006
    Messages:
    29
    Location:
    Amsterdam
    It has no name, I made it for myself and it includes various interface changes and some minor gameplay changes.
     
  9. NKVD

    NKVD Cossack

    Joined:
    Aug 30, 2002
    Messages:
    1,686
    Location:
    Stalingrad, Québec
    i would like it...care to explain?
     
  10. Bhruic

    Bhruic Chieftain

    Joined:
    Nov 15, 2005
    Messages:
    1,457
    I guess we are having different experiences then. I've also modded in the displays to list all of the attitude modifiers, and I usually see a broad range of +/- listings. Of course, it depends who's in the game, but that's pretty random. With a decent number of AI, there is usually a good mix of people who like/dislike each other. Which in my mind makes for a more interesting diplomatic game.

    Bh
     
  11. oedali

    oedali Chieftain

    Joined:
    Apr 6, 2007
    Messages:
    840
    Gender:
    Male
    Location:
    Washington, DC
    Alright, so I've had way too much free time on my hands while changing jobs. Based on what I read in the AI Leaders Personality Matrix file posted by Ori, and the AI Attitude Explained thread, I put together this visual representation of where the leaders stand in terms of liking each other. Basically, the closer they are, the more they like each other, and vice versa. (The numbers on the axis are purely the 'invisible' peaceweights.)

    In addition, I put in a few more metrics just to make it more informative. The base attitude & warmonger respect have already been discussed many times. I pay attention to the NoWarAttitudeProb as well because it shows which AI leaders are more likely to stab you in the back. I did not give numerical detail on these to keep it simple - for exact percentage probability values see Ori's AI Leaders Personality Matrix file.

    Note that this chart is only meant as a visual tool to see which leaders will get along with who, NOT taking into account a host of other factors like religion, close borders, etc. It has helped me understand the AI attitudes better so I just wanted to share. Thanks to Ori for making that file and making the xml data easy to manipulate.

    Check it out & feel free to respond. Btw, I'm an analytic freak and if it interests anyone, I have tons more summary charts and tables like these that I made comparing different AI behaviors (e.g. which AI's are better to trade with, when will they open borders, join your war, etc. compared to others, etc.)
     
  12. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,537
    Location:
    Baden-Württemberg, Germany
    :goodjob:

    this post by Blake in the Better AI Mod threads might be interesting for you as well (and fits into the personality stuff, so why not repost it here ;) )

    and most importantly:
    :woohoo: Welcome [party] to :dance: CFC :band:
     
  13. oedali

    oedali Chieftain

    Joined:
    Apr 6, 2007
    Messages:
    840
    Gender:
    Male
    Location:
    Washington, DC
    Cool, thanks for sharing that! I had made charts before ranking the war likelihood values of the leaders (see attached) but hadn't seen it combined with the Train and WarPleased variables.. interesting.

    Also check out the Trades summary table I made (tab in same file) using the attitude thresholds info. (Orange face is annoyed, blue=cautious, green=pleased, pink=friendly) Note that these are the attitudes at which the AI will ACCEPT the trade, as opposed the xml definition which is the level it refuses - same thing in the end but I find it better to think about it this way. I find it useful because when you look up an opponent from here you can easily see, for example, Elisabeth & Tokugawa will never share their world maps so no use wasting your time bribing them if you know beforehand. ;)
     
  14. DrewTate

    DrewTate Chieftain

    Joined:
    Sep 4, 2005
    Messages:
    596
    Are things 'we think you are getting too big for your own good' and the 'we mourn fallen soldiers from your hands' new to warlords? Never seen those before.
     
  15. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,537
    Location:
    Baden-Württemberg, Germany
    Are you sure you are not using a mod? or BTS (since it came out in Australia yesterday I just have to ask that :p). I seem to recall Blake putting something like this into his BetterAI Mod - those are not part of Vanilla or Warlords I am pretty sure...
    Edit: :D I just saw that you refer to Nacht's post - he is using his own mod :p
     
  16. Duuk

    Duuk Doom-Sayer Supporter

    Joined:
    Dec 16, 2005
    Messages:
    1,835
    Gender:
    Male
    Location:
    Detroit, Michigan, USA
    I'd kill to get a hand on that mod that Nacht uses there.

    Someone pretty please release that!
     
  17. DrewTate

    DrewTate Chieftain

    Joined:
    Sep 4, 2005
    Messages:
    596
    ya i would also like that
     
  18. ruff_hi

    ruff_hi Live 4ever! Or die trying

    Joined:
    Oct 24, 2005
    Messages:
    9,037
    Location:
    an Aussie in Boston
    Do you have the code for winning the GenSec or Pope vote? Sorry if you've already posted it.
     
  19. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,537
    Location:
    Baden-Württemberg, Germany
    there are two team votes: victory and secgeneral (pope is the same as secgeneral). Basically the same code applies for both types of teamvotes apart from: the threshold is +7 for victory as you quoted and 0 for secgeneral (i.e. iAttitudeVal has to be positive for the secgeneral and +8 for victory).

    Spoiler code :

    Code:
    PlayerVoteTypes CvPlayerAI::AI_diploVote(const VoteSelectionSubData& kVoteData, VoteSourceTypes eVoteSource, bool bPropose)
    {
    	PROFILE_FUNC();
    
    	CivicTypes eBestCivic;
    	int iOpenCount;
    	int iClosedCount;
    	int iValue;
    	int iBestValue;
    	int iI;
    
    	VoteTypes eVote = kVoteData.eVote;
    
    	if (GC.getGameINLINE().isTeamVote(eVote))
    	{
    		if (GC.getGameINLINE().isTeamVoteEligible(getTeam(), eVoteSource))
    		{
    			return (PlayerVoteTypes)getTeam();
    		}
    
    		if (GC.getVoteInfo(eVote).isVictory())
    		{
    			iBestValue = 7;
    		}
    		else
    		{
    			iBestValue = 0;
    		}
    
    		PlayerVoteTypes eBestTeam = PLAYER_VOTE_ABSTAIN;
    
    		for (iI = 0; iI < MAX_TEAMS; iI++)
    		{
    			if (GET_TEAM((TeamTypes)iI).isAlive())
    			{
    				if (GC.getGameINLINE().isTeamVoteEligible((TeamTypes)iI, eVoteSource))
    				{
    					if (GET_TEAM(getTeam()).isVassal((TeamTypes)iI))
    					{
    						return (PlayerVoteTypes)iI;
    					}
    
    					iValue = GET_TEAM(getTeam()).AI_getAttitudeVal((TeamTypes)iI);
    
    					if (iValue > iBestValue)
    					{
    						iBestValue = iValue;
    						eBestTeam = (PlayerVoteTypes)iI;
    					}
    				}
    			}
    		}
    
    		return eBestTeam;
     
  20. ruff_hi

    ruff_hi Live 4ever! Or die trying

    Joined:
    Oct 24, 2005
    Messages:
    9,037
    Location:
    an Aussie in Boston
    thx Ori - 8910
     

Share This Page