When I was in college, I asked a coworker of mine what his major was. He replied that he was studying artificial intelligence. The conversation kind of went like the following:
Me: Oh, cool!
Him: Well, actually, it’s probably not what you think…
Me: So are you studying neural nets and expert systems?
Him, visibly surprised: …Uh, yeah, actually.
I think he expected me to believe that artificial intelligence was just as it is in science fiction movies and books. He probably thought I was excited that he was learning about making sentient robots or something. The fact that I knew the term “expert systems” and that it was related to AI research seemed surprising. No one writes books about exciting expert systems in science fiction, right?
I suppose the reason why I knew about what courses in AI would be like is because I originally expected them to be about making computers reason and think. Then I looked into it, and I found that it wasn’t always that sexy. Some research is about computer reasoning, but a large chunk of the research is really just a series of if-statements, when you get down to it: IF this object is a mammal THEN XYZ. IF this object is a reptile THEN ABC. When you look at knowledge bases, such as Microsoft’s, it’s the result of AI research. If you are expecting to encounter romanticized science fiction in college AI studies, you’ll likely be disappointed. A lot of the AI you’ll study is about developing better ways to answer questions for an automated tech support call center.
I was hoping to take a course in AI and learn how to write autonomous agents in a video game. Expert systems aren’t quite what I had in mind. Instead of taking such a course, I read articles online and bought books. Kids today are lucky as GameDev.net has way more articles on AI than I had access to when I was in school. I do own O’Reilly’s “AI For Game Developers”, which has the sub-heading “Creating Intelligent Behavior in Games”.
Why would I care about expert systems? Would an expert system help me with making the computer opponent in platformer look intelligent? Finite state machines, fuzzy logic, pathfinding, obstacle avoidance, chasing and evading…these are things I wanted to learn. They seemed to be the most practical for a game developer.
According to the Wikipedia entry on AI, you can identify two types of AI applications: classifiers and controllers. Classifiers identify entities as fitting a pattern or set of objects. Controllers basically use classifiers before deciding on an action. The latter seems closer to “IF player is nearby, then send wave of enemies in delta formation”.
Still, there isn’t really a need to study too deeply into these details if you want to make games. Don’t think that the AI in Quake was very intelligent. The model had a number of assumptions about the nature of the level layouts and information about player locations. Someone made a 2D volleyball mod using a Quake engine and found that the movement was strange because the AI assumed it would have room to turn around. The computer-controlled players weren’t moving in a very smart way at all. I remember reading one player’s comment as he talked about how moronic they acted.
And I suppose that reaction is all we have to worry about. You can try to make your AI as smart as you can, but if it does things that aren’t very smart, people will notice, and your AI will be considered weak. Perception of intelligence is more important than actual intelligence. Just like in real life. B-)
When people played my Space Invaders clone Killer Kittens, one of the common reactions I heard was someone cursing the last alien. Just like in the original Space Invaders, the last alien moves much faster than it did when there were still other aliens around it. People were getting mad at it, but in a good way. To these players, it wasn’t an algorithm I wrote that sped up the alien’s movement. It was the alien getting tricky, or becoming afraid, or doing something intelligent. It sometimes seemed to drop a bomb right on top of the player’s shot, which seemed to be an intelligent way of shielding itself. In reality, the bomb being dropped was random, just like any of the other drops. But hey, if the players think it seems intelligent, then I don’t need to spend time trying to get it to drop the bomb more intelligently.
I remember when Goldeneye 64 was released. The enemy seemed intelligent…until you came across two guards with their backs to you. You could run past them with your guns a-blazin’, but you could also take them out quietly. Unfortunately, you’ve run out of bullets for your silent pistol, so you pull out the rifle you took from one of the other enemies. You have to be quick. You aim at one guard, shoot him, aim at the other guard, but then realize that he isn’t moving. His colleague just dropped dead in front of him, but he didn’t even blink. Wha-? It was very weird the first time I realized that the AI isn’t that intelligent at all.
Game AI is getting more intelligent these days, but in the end, the only thing that seems to matter is how players perceive it. In this way, it is similar to the importance of story in games.