Game Development Myths: Players Want Smart Artificial Intelligence

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:

  1. 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.
  2. 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.
  3. 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.

  1. gametechfromscratch reblogged this from askagamedev
  2. sadisticwolves reblogged this from askagamedev
  3. zobos0 reblogged this from askagamedev
  4. emaralez reblogged this from askagamedev
  5. nocturnalblade reblogged this from askagamedev
  6. cutegengar reblogged this from telirix
  7. jbrucke reblogged this from rocketverliden
  8. nameispotato reblogged this from rocketverliden
  9. rocketverliden reblogged this from booleanearth and added:
    Meh, I personally cannot fault developers who code an AI to use actual tactics instead of just standing around while I...
  10. epic-lee reblogged this from askagamedev
  11. ahr42p reblogged this from kingcrackers
  12. telirix reblogged this from kingcrackers
  13. kingcrackers reblogged this from booleanearth
  14. booleanearth reblogged this from askagamedev and added:
    I was also thinking about this earlier, and you should read it if you haven’t already.
  15. fourthera reblogged this from askagamedev and added:
    I agree and disagree with the point the developer makes here. We need games with enemies that try to beat the player not...
  16. coolgamingitup reblogged this from askagamedev and added:
    This is an interesting point because I think it highlights the importance of a holistic encounter design that mixes...
  17. starlight-dawn reblogged this from askagamedev
  18. science5life reblogged this from askagamedev
  19. erchamion reblogged this from askagamedev
  20. cabronacho reblogged this from askagamedev