Thursday, October 21, 2010

The ideal AI

Perusing CiV forums over the last few weeks has made me wonder a few things.  In particular I have been thinking about what exactly people would want their ideal AI opponent(s) to do if they could set the behaviour themselves.  Obviously the intent here is not to make the AI a pushover since that is fun for a very short time and it also isn't to make the AIs team up and gang the player to death either but rather to have an AI behaviour that gives it a good chance against a variety of human strategies and makes the computers do interesting things with each other.  A good bit of the complaints about the CiV AI talk about how the AI is an extreme warmonger and will almost inevitably attack a player who is situated near them.  Some people evidently want to be friends with the AI in the long term and are frustrated by the fact that they end up in conflict with their neighbours.

The trick is that the easy solutions to that problem create bigger problems.  If you have an AI be very peaceful then the player simple makes a big army and surprises them with an assault and crushes them every time - not much challenge there.  If you have the AI make a huge army but be friendly then the player simply does not make any military at all and gets a fantastic economy going and smashes the AI once they get very powerful units and technology.  Setting up an AI to attack opponents far away is just setting them up to suck so they must either attack their neighbours or not attack at all.  The only real solution to making the AI survive against the inevitable player assault is to make them very aggressive towards people close to them and particularly so towards people who have a very small military.  Of course this leaves players who simply want to be friends and have few/no military units out in the cold but it does mean that the AI isn't simply fodder.

I think there are real challenges when talking about human behaviour in the context of games and in the context of real life.  In real life people generally behave according to the rules and try to keep others happy because long term it isn't helpful to anger those around you.  In a game like CiV though there is no long term; if you get wiped out by an attack you don't get revenge later on so there is every incentive to be the one doing the attacking rather than the one doing the dying.  It is certainly true that players act this way; even though I obey the laws in real life I am extremely aggressive in games and I will happily backstab someone I have been cooperating with up to this point to gain a sizable advantage if I think it will work.  If you don't take those sorts of risks you almost certainly can't win since others will be going for it and one of them will succeed.  In that sense AIs that recklessly attack, break alliances and backstab their former partners are behaving exactly as humans do; and I say this from a long history of playing diplomacy, risk, civilization and other such games.

Of course the AI is terrible in many ways, especially at managing combats and tactics, so even if it attacks with an overwhelming force it will get wrecked against a strong human player.  This doesn't mean that it shouldn't attack though, as the only way any wargame AI can ever consistently keep a player challenged is by constant offensive pressure.  This is true in Starcraft 2, it is true in CiV, and it has always been true in any similar type of wargame.  The computer needs a massive resource advantage to be competitive and it competes by being constantly aggressive - any other strategy is doomed to failure.  While it would be nice to know that others will play nice with you in your game it is guaranteed to make the game trivial to others who seek to exploit that behaviour.

No comments:

Post a Comment