Some general thoughts on AI behaviour

Ace of Spades

GEM Fanboy
Joined
Feb 18, 2003
Messages
210
Location
Munich, Germany
Hello everyone,

since I have been following your project with great interest, I wanted to start a discussion here about some features of AI behaviour. I am aware that these are not the ones that you have currently been focusing on, but maybe they might become interesting in a later stage of development.

Mostly, this is about general AI behaviour. I feel that there are two possible ways for the AI to behave:

a) the AI tries to "role-play" a civilization, building up friendships and grudges against other civilizations and using attitudes to decide with whom to ally and whom to attack. Its decisions would mostly be based on the personal situation and gains of a civilization. A civilization would be willing to agree to a trade that it benefits from, even if that meant that the other side would gain a strategic benefit from it that would probably win him the game (like trading away that aluminium needed for space rade victory).

b) the AI remains rather sober, with its only goal being to eventually win the game. It does not care whether it just lost four cities to another civilization, it will try to consider the global situation every turn and estimate which actions would take it closest to winning the game. Possibly this could mean that the AI would try to ally itself with others to keep a certain civilization from progessing towards its victory conditions once it becomes close, probably mostly by means of wars or trade embargoes.

I guess a human player will play to win most of the time. Most players have no moral qualms to declare war and obliterate a neighbouring civilization they have been friendly with for the whole game, if it brings them closer to victory.

From what I gather, the AI currently does not put an attitude penalty on "back-stabbing" behaviour - there's only "You declared war on OUR friend." and no "You declared war on YOUR friend" - even though such a behaviour would usually dissuade other possible allies. There's not much use in being friendly with anyone who would just turn on you if it gave him strategic advandtage. However, the human player can exploit this "weakness", while - as I read in some other thread here - the possibility of the AI even considering to do such a thing is only 10%.

I guess this has to be considered on a meta-level. If the AI ruthlessly played to win, it should not really care if its cities got razed or someone declared war on its friend - since it would have acted like that itself, the behaviour of the other party is therefore expected. However, currently - with the AI being forced to use attitudes while the human player can disregard them without too much trouble - humans get quite an edge on the strategic level. To my mind, this is one of the reasons the AI can be somewhat manipulated by a human player in large-scale games with many players.

Another small issue that I sometimes dislike is the behaviour of the AI towards its vassals, or even the decision to let itself be vassalized by another AI or the human player.

The AI seems prone to give techs to its vassals, which is a dangerous game. Whenever your heartland gets attacked, your vassals might break free and become your rivals. This seems to happen quite often, so maybe the AI does not take those things into account very much.

Let's say a warmongering civ capitulates three other - less technologically advanced - civs in a row. Each of them is a third their size in population and land. Combined, they are as big as their master. So basically, half of the population and land of the master civilization is under uncertain control. Now the AI has two choices:

a) give them techs and ressources, so they become more powerful. This makes sure the overall power of the civilization increases, but also increases the risk of vassals breaking free due to excession of the 50% population/land limit.

b) exhaust their ressources and offer them no aid at all. This incurs the risk of another civilization striking at the colonies once a war has begun, since they are probably poorly defended. Perhaps a third option would be to send defenders to the colonies yourself. Again, if half of your vassals territory is conquered, you risk losing the other half.

So what do we conclude from this? Personally, I believe the AI should be more hesitant to accept vassals and capitulations, and try to conquer most of the cities for themselves, only accepting vassals that are significantly smaller than itself when it would have the option of conquering most of the cities instead.

Of course, the matter of a civ allowing itself to be vassalized is another matter... although I have to confess that I'm not sure what happens if a vassal completes certain victory conditions. Conquest/Domination seem unlikely, but maybe Cultural or Space victories are possible for vassals. I'm not sure whether the decisions to capitulate or voluntarily vassalize are determined by this... if the AI goal is to win, I believe it should only enter a state where it basically cannot win if there are "realistic" hopes of breaking the vassal agreement at some point.

I guess it's tough to say what strategy would be best for a vassalized civ... help your master and try to take advandtage of military victories, like trying to capture cities, expanding faster than your master to break the vassalage at some point... or rather trying to hurt your master indirectly by subverting its war efforts. Even allowing invaders to conquer some of your cities to allow you to break a vassalage agreement and sign a truce with the original aggressor might be a viable option.

Well, I guess I'd rather stop at this point, since I get the feeling that I'm going pretty deep into theory right now without close connection to the actual AI code, which I am not familiar with. My assumptions are only based on observation of AI behavoiur during my games. I hope these thoughts are of use to you :-)

Best Regards,
Ace
 
Some good thoughts Ace! Certainly the issue of whether the AI should role-play or play the game like a human player is a constant that will always hang over every Civ game. On of the things Blake really brought to the Civ4 AI is a heightened sense of playing the game ... the AI now chooses intentionally to go for cultural victories or to declare war or boost its population when near domination victories, before the AI never adjusted its behavior when it had a chance to win.

Most of the AI decision making falls into two broad categories: thresholds and probabilities. There are certain classes of decisions where the AI has to pass some threshold, below the threshold there's no chance of the decision and if it's above the threshold then it passes on to other logic. In other circumstances there are probabilities, where say 1/3 of the time the AI will choose one course of action and the rest of the time it will do something else.

War decision involve both, thresholds on power comparisons to check whether the AI is out classed and probabilities of checking for war against certain opponents based on relations.

The existing standard in the code is to very selectively tweak both thresholds and probabilities when running Aggressive AI. On normal the AI will roleplay more and be a bit more peaceful while on Aggressive it will choose war more often even when on good terms with the other player. To me this generally seems like the right approach, keeping war decisions largely based on variables the human player can easily see in the game but with probabilities creating uncertainty in what strategy the AI choose at any time.

Relations have to be meaningful or a whole section of the game becomes irrelevant. The human player can certainly choose to ignore them completely to achieve its goals but it's much harder for the AI to make that kind of decision ... when does it make sense to declare war on someone who you have good relations with? You can get a lot from that player peacefully and the AI definitely does, from sharing techs to sharing wars. If the other player is small and backward then they'll happily become your vassal and put you that much closer to domination without firing a shot. If the other player is competitive with you then the cost of a protracted war plus the loss of an ally makes it a bad strategic decision.

In Civ3 IIRC there was effectively a "you declared war on your friend" penalty in the form of reputation ... it seems like a good idea, but many people complained about it basically because they almost always were considered rats. These reputation systems have also never been transparent in game, one of the reasons Firaxis has all the +/- details for relations in Civ4. Anyway, I think instituting a "you declared war on your friend" penalty would be essentially confusing relations with reputation, the AI shouldn't really care if you choose to beat up on one of your allies unless they like your ally too IMO which is how it works currently.
 
Back
Top Bottom