• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days. For more updates please see here.

Report Questionable Behavior

jdog,

What's been your focal point for the next release, and when can we expect it?

(Sorry for the slow reply, I had a note drafted yesterday to answer your earlier posing of this question but must have gotten distracted ...)

With the new RevDCM release up I can now swing my focus back around to BBAI. Right now the next release is looking like a hodge-podge of a few things. It's got a couple of important bug fixes (the MP bug and new UP stuff), a new AI logging system so we can easily examine the AI's moves over the first 100 turns, and a rebuilt spy movement and mission AI.

The spy AI was really weak ... it picked targets basically randomly based on distance and attitude. Also, you know how sometimes your farm would get destroyed and you'd wonder WTH? Yeah, that behavior is completely random ... AI spies would never set out to destroy normal improvements (they do go after bonuses), but if they're wandering around exploring your territory and happen to start a turn on your farm, they'll go for it. Anyway, spies should now actually get in position and revolt down city defenses when attack stacks show up, something they couldn't do before since they moved after attack stacks so the 1 turn of revolt would have been pointless.

There's a few other odds and ends too.

Since some of the bug fixes are important I'm planning on putting it out soon ... definitely before Halloween, maybe this weekend. There was a bunch more I was planning (nuke AI ...), but since that's a separate issue it can wait.
 
Yes, although the real content of AI tech decision making is hardly changed.

I don't really care :) I just want that new tech value function so I can make my own AI changes that I had to put to the side because I was unwilling to untangle that messy best tech function ;)
 
The attitude of AIs towards you (or other AIs) remains their average of the attitudes of their team members towards you and your vassals.

It doesn't matter if you are a continent-spanning empire, and your vassal is a beat down single city in the corner you accepted capitulation from, or a small colony you split off.

The AI doesn't tell you that they no longer like you (as the AI attitude dispaly is based on player-to-player attitude, while behaviour is based off of team-to-team attitude, which the UI doesn't show).

This means that if you go to war with a hated enemy, then vassalize them, you can expect any diplomatic efforts you have undergone to be utterly randomized; similarly, if you ever spawn a colony, you are forever hostage to whatever that colony (no matter how small) is liked/disliked by your 'friends'.

I include a proposed fix.
Spoiler :

In CvTeamAI.cpp:
Code:
AttitudeTypes CvTeamAI::AI_getAttitude(TeamTypes eTeam, bool bForced) const
{
	int iAttitude;
	int iCount;
	int iI, iJ;

	FAssertMsg(eTeam != getID(), "shouldn't call this function on ourselves");

	iAttitude = 0;
	iCount = 0;

/************************************************************************************************/
/* BETTER_BTS_AI_MOD                      10/24/09                                ########      */
/*                                                                                              */
/* Diplomacy AI                                                                                 */
/************************************************************************************************/
	int iAttitudeWeight = 0;
/************************************************************************************************/
/* BETTER_BTS_AI_MOD                       END                                                  */
/************************************************************************************************/

	for (iI = 0; iI < MAX_PLAYERS; iI++)
	{
		if (GET_PLAYER((PlayerTypes)iI).isAlive())
		{
			if (GET_PLAYER((PlayerTypes)iI).getTeam() == getID())
			{
				for (iJ = 0; iJ < MAX_PLAYERS; iJ++)
				{
					if (GET_PLAYER((PlayerTypes)iJ).isAlive() && iI != iJ)
					{
						TeamTypes eTeamLoop = GET_PLAYER((PlayerTypes)iJ).getTeam();
						if (eTeamLoop == eTeam || GET_TEAM(eTeamLoop).isVassal(eTeam) || GET_TEAM(eTeam).isVassal(eTeamLoop))
						{
/************************************************************************************************/
/* BETTER_BTS_AI_MOD                      10/24/09                                ########      */
/*                                                                                              */
/* Diplomacy AI                                                                                 */
/************************************************************************************************/
/*
							iAttitude += GET_PLAYER((PlayerTypes)iI).AI_getAttitude((PlayerTypes)iJ, bForced);
*/
							int iMySideWeight = GET_PLAYER((PlayerTypes)iI).getTotalPopulation() + 1;
							int iTheirSideWeight = GET_PLAYER((PlayerTypes)iI).getTotalPopulation() + 1;
							if (GET_TEAM(GET_PLAYER((PlayerTypes)iI).getTeam()).isAVassal()) {
								iTheirSideWeight /= 3;
								iTheirSideWeight += 1;
							}
							int iLocalWeight = iMySideWeight * iTheirSideWeight;
							iAttitudeWeight += iLocalWeight;
							iAttitude += iLocalWeight * GET_PLAYER((PlayerTypes)iI).AI_getAttitudeVal((PlayerTypes)iJ, bForced);

/************************************************************************************************/
/* BETTER_BTS_AI_MOD                       END                                                  */
/************************************************************************************************/
							iCount++;
						}
					}
				}
			}
		}
	}

	if (iCount > 0)
	{
/************************************************************************************************/
/* BETTER_BTS_AI_MOD                      10/24/09                                ########      */
/*                                                                                              */
/* Diplomacy AI                                                                                 */
/************************************************************************************************/
/*
		return ((AttitudeTypes)(iAttitude / iCount));
*/
		// This function is the same for all players, regardless of leader or whatever
		// so it's fine to use it for the team's attitude
		return GET_PLAYER(getLeaderID()).AI_getAttitudeFromValue(iAttitude/iAttitudeWeight);
/************************************************************************************************/
/* BETTER_BTS_AI_MOD                       END                                                  */
/************************************************************************************************/
	}

	return ATTITUDE_CAUTIOUS;
}

Here I weight the importance of the attitude between two empires by their population, or 1/3 their population if the considered 'target' is a vassal.

Rollover is only a problem if the product of two civilisations populations approaches 2^31.

With 8 vassals or members on each team, we have 64 pairwise empires, or 2^6. Leaving 2^25 as the product; or 8 players on each team, each with up to 16,000 population points, do not cause a problem.

With 30 on each team, if each of the 30 empires on each side had 1500 population (!), there still wouldn't be a problem.

So I think the change is numerically safe.
 
which the UI doesn't show

I like your fix, however, if I may, I would like to make an additional suggestion. Expose this change to the UI, by adding a new diplomacy attitude modifier that merely shows this effect, saying something along the lines:


  • -3* "We dislike your vassal"
*This number is whatever the effect happens to be, -3 is just for illustrative purposes

Otherwise, your fix will only fix half the problems, and players can still be confused as to the real reasons.
 
That would be trickier. :) I don't know how to do it.

It would say "I don't like your allies" or "I like your allies", rather than vassals, as this code applies to both vassals and team mates (I believe perm. alliance makes team mates).
 
Hmm. If we hate the French, then it follows that we dislike any civ that has allowed the French to survive by accepting their capitulation/vassalage. I'm not sure that we should dislike the master civ more if the French have a higher population. However, we should dislike the master civ more if we hate the French more. For example, if the French start nuking us, we don't care if they only have one city - eventually, we will want to declare war on them and whoever their masters might be.
I'd be tempted to remove vassals from the Team Attitude calculation entirely, and instead modify the "you have signed defensive pacts with our rivals" attitude modifier to take into account the amount that the rival civ is hated.

On a related note, I just looked at the "you declared war on our friend" calculation in CvTeam::declareWar. It appears to work like this:

Do we like the team? If so, add one "-1 you declared war on our friend" to the declarer for each member of the team.​

This seems inconsistent. Either the decision should be based on the player attitude, or there should only be one "-1" for the entire team, not "-1" for each member of the team.
 
The attitude of AIs towards you (or other AIs) remains their average of the attitudes of their team members towards you and your vassals.

It doesn't matter if you are a continent-spanning empire, and your vassal is a beat down single city in the corner you accepted capitulation from, or a small colony you split off.

I think it's an error to make vassal insignificant to "fix" that. The population count is not what I would want a civ to consider. Explanation :

* Gandhi is the heathed fiend of Monty. Monty definitely want to wipe off Ghandi from the universe
* I vassalize Gandhi after taking his capital and some good cities because I am mean.
Then, I would like Monty to go on and stomp over me because he really want the indian exterminated ; in fact becoming his new worst ennemy because I protect the indian is more the way to go than a problem in my opinion.

For me, weighting by population is just making vassal painless for diplomacy. Yes, you don't control them and they will mess with your relation. That's what you get to give them some control over their action instead of conquering everythings.

The averaging is not the better way to team diplo. But I think it's a far better way than the horrible population average that have been proposed.
 
But why not make vassals painless for diplomacy? Vassal states are less useful than simply destroying an enemy civ as it is.

Usually you have great ideas Dom Pedro II, but I must say, that's the worst suggestion yet.

I frankly don't mind if the function stays as is, I just want to diplomatic penalty exposed to the player in the UI.
 
On this subject i gave my opinion elsewhere ( quoted here for energy saving :D ):
Well, I would not call the interface liar... the fact is that, if you look well, the intel is all there ( yes, including the hidden modifiers, if you care to look at the global diplo in a turn-per-turn basis ). But I would definitely call the interface badly implemented, because it doesn't show important intel in a easy way. Those things are very diferent: the UI will never tell you that a AI is pleased with you when it is annoyed with you ( thus is not a liar ), but it won't tell you that will act as it was annoyed with you in spite of being pleased with you because you have a vassal that it dislikes furiously ( the badly implemented part ).

On the mechanics proper : IMHO, and this is a opinion that I have for a long time, the averaging part is stupid, because it doesn't reflect the simple fact that , for what matters, the important part of the diplo ( war and peace ) is made with/taking account the relationship with the master. The averaging reduces the master just one more of that "team" and if there is a lot of vassals ( like in games with lots of civs , where it is not uncommon to see civs with 6, 7 or more vassals ) it makes almost inconsequent gaining good stances for the master ( even if I go to friendly with other civ, they will never be really friendly if it isn't friendly with one of my who knows how much vassals , so why bother? ) and will make less atractive to mend relations with people that is in ill disposition towards you if by acident they like your vassals a lot more than you ( it happens ).

I sincerily would had prefered that, in stead of averaging, they gave a positive or negative diplo bonus ( obviously not hidden ) per vassal. Something like +2 We like your vassal(s) or -2 We dislike your vassal(s) ( maybe with a -2 Your vassal is our worst enemy in top ) . That way the diplomacy would be decided by the relationships with the master, but taking in account who are the vassals of that master instead of treating master and vassals as equal partners, a thing they obviously aren't.
OFC this would enter in the game desing side of the barricade, but all the sugestions done so far in here enter there as well ;)
 
The spy AI was really weak ... it picked targets basically randomly based on distance and attitude. Also, you know how sometimes your farm would get destroyed and you'd wonder WTH? Yeah, that behavior is completely random ... AI spies would never set out to destroy normal improvements (they do go after bonuses), but if they're wandering around exploring your territory and happen to start a turn on your farm, they'll go for it. Anyway, spies should now actually get in position and revolt down city defenses when attack stacks show up, something they couldn't do before since they moved after attack stacks so the 1 turn of revolt would have been pointless.

:goodjob: for the changes to the espionage AI.

There are also missions the AI hardly ever uses (e.g. stealing money or causing unhappiness). For the latter it would be best if the AI would combine that with causing unhealthiness (something they do quite often). Also I wonder what decisions they make when picking a building to destroy...? I don't have the feeling they have a real plan here, e.g. choosing the ones which hurts you most, which could be an expensive one in a city with low production.
 
On the vassal/teammate attitude averaging question, there seem to be two issues:

1) The game mechanic

Averaging the attitudes of all team members makes sense - for most diplomacy actions like trading a tech or war, the AI takes that action on the team. Similarly, considering vassals as well makes some sense - for war decisions the AI would be going to war with the vassals, for tech trades there's a decent chance the tech will find its way to the vassal.

However, treating vassals as equals doesn't really make sense to me. If Japan declares war on China and India, and India whoops on Japan until they capitulate, why should the relations between India and China suffer much? For China to effectively spread the "-3 you declared war on us" between India and Japan is ludicrous.

But what makes a good mechanic for vassals? So far the suggestions have been:
- Leave averaging as is
- Weight the averaging based on empire size (population)
- Instead of averaging, add something between -2 and +2 per vassal based on attitude towards vassals
- Remove vassal consideration entirely

2) Transparency

What's available most readily to the human player are the various AIs attitudes to you as a player. However, the AI makes decisions based on its average attitude towards your team and vassals. This disconnect can cause confusion and frankly this lack of transparency may be the bigger issue ... the human player can adapt their strategy if they understand what the mechanic is.
 
But why not make vassals painless for diplomacy? Vassal states are less useful than simply destroying an enemy civ as it is.

Because they are quicker than clean conquest (and less war weariness), avoid the vassal to another civ problem, and avoid to kill you with maintenance cos of tundra city. And they can be put to good use without too much problem.

Anyway, I think it's a terrible idea to make vassal painless, because IRL vassals weren't painless.

(note : I'd better having the team diplomawy based off the worst case in the team, but they are two problem : the first is, I don't think the AI can attack the bad vassal first, second the power-deterrence are somewhat broken, so it's near impossible to be hated and deter warmonger from attacking you)
 
Just a note about my sugestion: as more I think on it, more I believe that the value of + 2 per vassal is excessive unless there is upper/lower limit on the vassal contributions for the diplo ... ideally the vassals should not be able to toss someone from friendly to annoyed, right? ;) ( we don't need another potentially infinite diplo factor ... nukes are more than enough :( ) So, or the total vassal contribution for the diplo is locked between ( for a example ) -8 and +8 or the individual vassal contributuion should have module 1.

Now on vassals being painless for diplo .... no. For what is worth , vassals , capitulated or not , are still in the game as separate entities ( they can still tech trade and do all the other diplo stuff except warring on their own ) and you pay/ be rewarded for who you chose to "protect" in the same way you pay/ are rewarded for the non-vassal friends and foes you get
 
ideally the vassals should not be able to toss someone from friendly to annoyed, right?

I strongly disagree. If I take, for example, Hitler as my vassal, and he has nuked tons of other countries, I think that the rest of the world should be horrified at my choice. I really don't mind the system that is in place now, I don't want to change it. I just want to expose it in the UI to players.
 
However, treating vassals as equals doesn't really make sense to me. If Japan declares war on China and India, and India whoops on Japan until they capitulate, why should the relations between India and China suffer much? For China to effectively spread the "-3 you declared war on us" between India and Japan is ludicrous.

But what makes a good mechanic for vassals? So far the suggestions have been:
- Leave averaging as is
- Weight the averaging based on empire size (population)
- Instead of averaging, add something between -2 and +2 per vassal based on attitude towards vassals
- Remove vassal consideration entirely
Interestingly, the three kinds of vassals are different.

Capitulation Vassals
Protection Vassals
Colony Vassals.

The game doesn't have that much memory of the difference between the three.

Colony Vassals don't share enough of the parent civilisations diplomatic history when they are created; you can easily create a colony, and discover your best ally considers this new colony their worst enemy! (I had it happen)

Protection Vassals, barring that issue, are like Colony Vassals.

Capituation Vassals are, as noted, the result of someone being beat to death. While some annoyance for "why didn't you finish that guy off" might make sense, as it stands taking a war vassal is diplomatic suicide (except, of course, to the guys who used to be that war vassals allies; go to war with a friends friend, beat that friend friend, then enslave it - and that doesn't hurt your diplomatic status!)

The Vassal diplomacy is somewhat reasonable for the 'Protection Vassal' case. Only somewhat; I still think that a huge super power, with a tiny little vassal or team mate, shouldn't result in both having the same impact on ones diplomatic status.
 
Back
Top Bottom