# Putting the "A" in "AI"

Posted on October 5, 2005 by psu

I got to thinking about the A.I. in games while playing the first few levels of the new Xbox shooter, Far Cry: Instincts. By coincidence, I had also recently replayed a few levels of Halo 2 and my first impressions of Far Cry were that the A.I. was much worse than the A.I. in Halo. So, while I spent some time in the rain forest with the little Far Cry mercenaries, I also thought about why they were less effective as artificial opponents as the grunts and elites in Halo.

The A.I. in a shooter, it seems to me, operates on two levels. First, the enemies should be able to act in ways that are tactically appropriate. They should hide from you when you shoot at them. They should gang up on you and beat you down when they get the chance. They should snipe you from afar before you know where they are, and so on. Of course, the developer has to balance these smarts so that the game is neither too hard nor too easy. It would be no fun if the sniper on some level killed you every single time you stepped out in the open. This aspect of A.I. emphasizes the intelligence more than the artificial. You want the enemies to be smart enough to be challenging.

The second aspect of A.I. in a shooter has more to do with the artificial more than the intelligence. Since it’s not likely that we’ll ever really build a real person simulator for the Xbox (or the Xbox 360 for that matter), it’s not really feasible for a game character to seem believably real in a Turing Test kind of way. It is important that they be interesting enough to make the short interaction that you will have with that character fun.

In shooters, this means that you hope that the enemies have enough variation in their behavior to make you believe that they are not completely robotic in the minute or so that you will be with them before you blow them into the sky. They shouldn’t always run in the same patterns or use the same attacks. They shouldn’t always “spawn” in the same place. And, most importantly, if they talk, they shouldn’t always say the same things.

This second aspect is really where Halo differs most from Far Cry. I think the tactics that the aliens use aren’t all that much better than the jungle soldiers. They both run away from you, and both perform effective gang attacks. The enemies in both games are kind of stupid about actually hiding behind cover. You can easily run around their flank and beat them down, for example. The Halo enemies are a bit better with ranged weapons and grenades, and they will also beat you down more often than the soldiers will. But what really makes the enemies in Halo more interesting are the non-tactical things that they do. They are never in exactly the same place when you enter an area. They don’t always chase you in the same way. And, most of all, they had much better writers for their dialogue. The effect of this should not be underestimated.

The early levels in Far Cry feel much more repetitive than Halo if for no other reason than in Far Cry you get really tired of the same voice yelling the same dialogue over and over again. There are only about four different lines (“I could use a little help here!”, “You’re dead meat now!”, “I see you!”, and “Why don’t you come out and fight?”, and so on) and they all speak with the same voice. And that voice is generic and boring. It’s almost as if a member of the development team recorded the voice-overs in his basement with his brother and put a comment in the code like:

// XXX - replace with something better later XXX

But then they never got around to it. The interesting thing about this is that other Ubisoft games developed by completely different developers have similar problems with their A.I. Splinter Cell is like this, Rainbow Six is like this and Ghost Recon 2 is like this. I stopped playing both Rainbow Six and Ghost Recon primarily because both the enemy and friendly A.I. were so boring. To be fair, those games are more about their multiplayer modes than the single player campaign, but the similarity to Far Cry is what tickled this idea in my brain, because my main objection in every case had more to do with their bad dialogue than anything else.

In contrast, one of the best things in Halo are the literally hundreds of pithy lines of dialogue that Bungie wrote for the non-player characters. The marines and grunts have the best lines. The elites have less variety, but they still make sure to never taunt you in the same way twice when they kill you. This attention to a seemingly minor detail serves to make the game seem much less repetitive than Far Cry even as you replay the same area over and over again because of the stupid save-points. As a result, the characters in Halo are more enjoyable to interact with even if they aren’t really that much more believable as people simulation devices.

The lesson to take away from Halo is that when it comes to A.I., getting the “A” right by faking the small things well can actually be more important than implementing any “real” simulation of intelligence.