What makes a “smart” AI?

For a few weeks now I’ve been studying about AI in computer games, wishing to know what makes it so difficult and perhaps learn what makes a “good” AI opponent/side-kick. Turns out the course was all about the programming of it (which I should’ve known, as it was a programmer course called “AI programming for computer games”), but after some scratch-the-surface research (ask people and ask google) I found no course (at least in Sweden) about the subject. So I started googling if there was anything released on the topic, and did find a few worthwhile sites to read. I’ll try to not make it another Link-Tips, even though it’s very tempting (and way easier and faster).

The first impression of this quick research is that computer games AI is a fairly programmer-dominated area. Most of the links appearing gives the impression of code-related tasks, such as techniques here and there and stuff. But just a few links away and I started to discover some really interesting things. First off a page I read a long time ago and been trying to find again ever since – a very design-oriented piece giving 7 ways to make the AI opponent smarter. Although it only scratches the surface, it gave a good overview. Use some scripting for entries and exits, make sure the player is aware of what the AI is doing, don’t make them shoot (if they shoot) really inaccurately, make it robust, design the levels to utilize the strengths of the AI and, lastly, if you have a good AI, increasing their health will make them seem smarter as they’re alive longer to show their smarts off.

Just a bit of searching later, I stumble over an old GDC session about the AI of Halo. It seems like they learned some of the things the former link mentioned, but they seemed to have a very methodical approach – design the characters so they map between visible character and AI in an obvious way (“if it’s not too obvious, it too subtle”), increasing toughness will give the illusion of smarter AI and play test, play test, play test to make sure the intention of the AI’s design gets across.

Another article that gives a good, although theoretical, picture of how it’s done is at bittech.net. Although not giving practical game design-lessons on AI, it says a lot about how the programmer-design of the AI affects the final outcome. And sheds good light about why AI can become so very complicated. Take this quote, for instance:

Chris Jurney, a senior programmer for Relic, offered the example of the state machines in its RTS, Dawn of War 2, to illustrate this. “The AI for Dawn of War 2 has roughly three main layers: the computer player, the squad and the entity,” says Jurney. “The squad and the entities are both hierarchal finite state machines, and we have roughly 20 states at the squad level and 20 at the entity level. The states at the squad level pretty much map directly to orders that can be issued by the user.”

The article then goes on to explain how much of what we percieve as AI is in the proper animations at the right place and how dynamic terrain makes it even more complex.

Then, when I’d started to think it’s all about animations, some links turns up which ties it in to game-play, as well. In their pre-panel discussion about AI and designers, Soren Johnson et al mentions that the strenghs of the AI should be taken into consideration when designing mechanics that would give players an unfair advantage (which they’ll already have by being humans, anyway). And on ai-blog.net, where the authur Paul Tozour argues for navigational meshes as replacement for waypoint graphs, the question appears why no FPS:es are mentioned in said article, with the following reply:

The problems are still there in many first-person shooters, but they’re harder to spot due to the nature of the gameplay.

– Most AIs don’t live long enough to let you spot the flaws in their pathfinding.
– AIs will usually stop and shoot the moment they have line-of-sight to you, so their paths are a lot shorter.
– In many single-player FPS games, AIs don’t move very much, and will attempt to snipe you from a relatively fixed position.
– A lot of modern FPS games provide AI sidekicks who will kill the enemy AIs so quickly they don’t have time to move very far.


So, what’s the conclusion of all this? Well, pretty much that a “smart” AI isn’t supposed to be smart, but rather the dumb guy showing off all the smart things he does and makes a big scene of being defeated when you triumph him, so you felt you out-smarted someone smart. To create the illusion of smartness, the following can/should be done:

  • Consider the AI’s ability when designing mechanics. What is the AI’s strength? How can the mechanic play at those? Will this mechanic make the AI seem dumb?
  • Make everything the AI does give visual or audible feedback so that the player knows what the AI is doing and why it is doing that.
    • If the AI reacts to something, make an animation and/or make it shout something to say what its doing (“grenade!”, “suppressive fire!”, “cover me!”).
    • If there are different kinds of AI opponents, make it obvious which one is what. “If it’s not too obvious, it’s too subtle”.
    • What the game chooses to portray can affect how much is demanded to make the AI believable. We expect less of animals then of humans, and you can get away with more of aliens or robots or something then with humans.
  • Adapt the level-design to play at the AI’s strengths, just like how you did with the mechanics.
  • The longer an agent lives, the more visible its strenghs and weaknesses will become. If the AI isn’t that smart, it probably should be killed off pretty quickly by either the player or a side-kick (which then must feel smart). If the AI is smart as it is, making it live longer is more likely to give the player the impression of the AI being smarter.

Last, but not least, actually the most important of all: The AI isn’t there to be smart. It’s there to make the game more fun.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: