One day in the office, a few years back, I heard the creative director of the game I was working on escorting a group of students (or maybe they were gaming press… I wasn’t exactly sure) on a tour through the studio. While the lead AI programmer on the project was setting up a demo for our upcoming game, the creative director killed some time by talking up how smart that AI was. Our creative director was a great salesman. It’s how he got the other leads to sign off on his ideas. That day, he held the crowd’s attention by telling stories about how how smart the AI was, and how easily he’d get sniped for just peeking out even a little bit at the highest difficulty. He used body language to sell it, reeling back as if he had been physically shot in the face. Everybody laughed. A few minutes passed and the demo began in earnest. It’s funny, because that was the day that I witnessed a game developer perpetuate the myth that good artificial intelligence somehow equated to accurate attacking firsthand. It wasn’t until over a year later that I realized just how big a cognitive gap there was between truth and myth.
First, let me address the perpetual myth that more accurate AI is somehow “smarter”. That’s simply not true. If the game decides that the enemy is going to hit you, then the enemy is going to hit you. The game decides when you get hit, not if you get hit. Sure, you can add in factors to the simulation to decide… the enemy’s skill with the gun, the amount of recoil, the type of gun, the rate of fire, the difficulty level, and so on and so forth. But these are all artificial factors that are added into the simulation. They aren’t making the AI “smarter” any more than giving a D&D monster an extra +5 bonus on its attack roll makes it “smarter”. AI Accuracy is a shell game that people use to fool themselves into thinking an AI is smart when it’s really just been given a +5 to hit.
That said, I still think about that anecdote every now and again whenever I hear gamers talk about how they want real intelligent AI, better AI, not this stupid scripted stuff. At the time I heard it I just laughed and thought about how great a salesman our creative director really was, but later on, after the game was released and the inevitable criticisms of the AI system began rolling in from both critics and players, I really thought about what it was that had gone wrong. The more I thought about it, the more I realized that what the players and critics were complaining about wasn’t the AI at all.
Here, let me show you what I mean. Here is your basic first person cover-based shooter scenario from a top-down view. You’ve got a fairly wide open map that has some interspersed cover, and you’ve got 3 AI dudes engaged in a gunfight with the player. Most would suspect that the AI would just hole up, take shots at the player, maybe throw some grenades to flush him or her out. And they’d be right, because that’s how most games like this handle situations like these. At higher difficulty rates, the AI would be more accurate and deal more damage. Pretty standard stuff, right?
So the question here is… what should an intelligent AI do in this scenario? The AI guys on the team sat down and basically came up with this strategy for the bad guys:
One of the bad guys would move south and lay down covering fire (red arrow). Doing so would invariably draw the player’s attention and fire (blue arrow), and they would shoot at each other while still being mostly safe. If the player would try to stick his or her head out, the bad guy laying down covering fire would immediately take pot shots at the player, and the AI accuracy was good enough that the player would usually orient on the threat. While this was going on, the other two bad guys would move north (green arrow). Can you guess what happens next?
Yup. The other two dudes would flank the player (green arrow) and start shooting from the weak side that gave the player no cover (red arrow again). The player would then usually take a bunch of damage and be forced to deal with a very tactically bad position. The idea was that by making the AI gunmen act in a strategic manner, it would force the player to keep moving and find new tactically advantageous positions while fighting intelligent bad guys. Adrenaline pumping gameplay, no real safe spots, truly smart AI with real squad tactics. Sounds like it would be pretty fun, right?
Players hated it.
Why would they do this? Wasn’t this what shooter fans have been clamoring for? Intelligent squad-based AI! They took the lay of the land into consideration and formulated a tactically sound plan! The AI team worked hard with the level design team to come up with algorithms for the AI to figure out the best paths, the optimum places to lay down covering fire, where to come at the player and so on and so forth. The level design would dictate the AI tactics. It was going to be great.
In hindsight, the more I thought about it the more I realized just how wrong we were.
Here’s what actually happened:
- Players didn’t always see the bad guys doing the flanking. In fact, most of the time, they were so caught up shooting at the bad guy acting as bait that they completely ignored the other guys sneaking around to bust a cap in their asses. When the other guys finally appeared and started shooting at the player from their new position, the players complained about how the stupid game was cheating by spawning bad guys behind/flanking them.
- In order to combat this “unfair spawning behavior”, players would then tactically withdraw (run away) until they were in narrow hallways where the AI could not flank. There, the players could then pick off the AI at their leisure one by one, since they had nowhere to go.
- Because this is the only tactic that worked well consistently, the players complained that the AI was dumb for just running in and getting shot while they stayed in relative safety.
In essence, we had built an AI that really did outsmart most players and players really don’t respond well to being outsmarted, so they had turned the tables by repeatedly dragging the AI into situations where it was dumbest, and then winning through attrition. And that was a problem, because it wasn’t fun. But it sure was effective.
The sad thing was that if you watched from observer mode or the video replay, you could literally see the tactics play out legitimately. Worse yet, so much time had been spent on making “smart” AI that the AI team really didn’t have time to make a variety of AI. Most enemies all behaved in similar ways, because the idea was to have the lay of the land determine the actual tactics.
We tried a few things to make it better. We recorded voice-over audio of thugs basically spelling out exactly what it was they were doing. The bait would shout “COVERING FIRE” as he did so, the other guys would yell things like “I’LL GET HIM FROM THIS SIDE!” as they moved. The bad guys would all periodically shout “RELOADING!” when they were supposed to stop firing and give the player a chance to shoot back with impunity. It didn’t work. Most players still tunnel visioned in on the bait like tween girls on Edward Cullen. In the end, the AI team hastily cobbled together a second AI type which would rush the player in a suicide charge just for some variety.
In hindsight, I believe that the way we approached the problem was fundamentally flawed. We had erroneously chosen the role the AI took, and that had been our downfall. We made the assumption that the AI’s primary goal was to be given the same tools as the player, and to use those tools to defeat the player in an intelligent way. The problem with this approach is that it assumed the fun was inherent, when there was no real way to prove that out.
That is not what the goal should have been. The goal from the start should have been to design an AI that was fun to beat. This is a rather crucial difference that I think we glossed over at the beginning, and it ended up hurting us in the long run.
In retrospect, had we been able to do it over again, I would have erred on the side of more variety and less “intelligence”. If we had enemies who actually behaved differently it would then be up to the player to mentally come up with a strategy to deal with each (recognizable) type and thus improve and exhibit skill with the game. As long as we provided a steady stream of reasonably interesting and varied decisions and choices to make (a mix of snipers, assault types, pistol types, breachers, mid-long range rifles, etc.) then the gun combat would be more interesting and less frustrating. It may not have been the “smart” AI that some players clamor for, but it would have been fun to play against and beat, and that’s what really matters in the end.