Category Archives: Game Design

Making the Rules: Great Enemies

complicated_flowchartPreviously I’ve talked about how games adjust AI difficulty because of the need to fulfill the player’s fantasy, and provide them with success and positive feedback. This time I’d like to talk about perils and pointers for creating good combat AI. Now, while many articles that wish to address “great AI” contain heavy jargon or equations and diagrams depicting line of sight, or reticular splines or some such, let’s put that aside for now. It can be a great deal simpler than that (although in some ways more challenging).

Out of Sight, Out of Mind

Imagine dropping a player in a sprawling maze… hedgerow, factory, prison, whatever… that is impossible to be known beforehand. Within there is one incredibly realistic, human-like AI… It operates on its senses, with no unfair information about the maze or the player, but it executes on some crazy supercomputer with a million factors that it takes into account, from its knowledge of combat tactics to its own preferences and personality. Hell, let’s even keep track of what it had for breakfast in case we want to simulate a chance of it having an upset stomach. This AI’s job is to start searching for the player and make assaults as he moves through the maze. For a moment, as we watch the AI, we can see it moving through the maze, tracking the player’s scent, thinking about how to flank him… when it hits a fork in the path, it decides to go left or right based on tactical decisions, or its own tendencies, or whatever a human-like AI should do. Perhaps it has a human-like idiosyncrasy like alternating… Whatever. The important thing is when it finds the player, whether by crafty wiles or just dumb luck, it switches to combat tactics and starts attacking the player without warning, pressing any advantage it can. When it is out of the player’s view, he is completely stealthy, undetectable until he encounters the player again.

Wolf3dNow imagine this experience from the player’s perspective. He’s moving through the maze, starting to get familiar with his surroundings. Assuming the brilliant AI is quiet like he is, the enemy could be around any corner. The first time he encounters him, the attack could be anywhere, behind, ahead… who knows. If the AI is particularly crafty and sets up a sniper ambush, the player could die in a single shot to the head. To the player it’s a chaotic, unpredictable experience… Perhaps a fun one for some, perhaps not.

Now let’s replace the AI with a more rudimentary version, one that makes more random decisions about what path to take while moving through the maze. This is sporadically punctuated with the AI taking the best path to the player, using perfect information. The enemy will still use intelligent tactical decisions once the player has engaged it in combat, but when it is out of the player’s sight, the AI is entirely artificial. For the player, assuming the general frequency and predictability of the enemy appearance is similar, very few audience members will notice the difference.

Now let’s go even further, and replace the AI with a spawning routine that creates an enemy at the edge of the player’s awareness at a similar frequency and predictability as either of the other approaches. Certainly there are a few cases where it would make a wrong choice, such as spawning the enemy from a dead-end, but how often would this become apparent to most players? .

Now what point am I making here? That “real AI” is worthless? Of course not! When the enemy is within the player’s view, it needs to act extremely effectively, to provide the player with sufficient combat challenge and to keep the illusion up that this is human-like behavior. However, once the player has lost all perception of the enemy’s movements, there is a significant drop-off in the impact of sophisticated AI on the player’s game experience… That enemy could go off and play chess, consult his favorite tracker’s handbook or compose humorous limericks about the death of the player, but none of it makes much of a difference if the player is not aware of these activities. And it doesn’t advocate delivering “good enough”, it’s just that we could be using that supercomputer for better things.

A Pinch of Player Feedback

Soldier of Fortune 2-1Of course there are better ways of selling an interesting “hunt” scenario between a player and an AI. The game might have remote cameras out in the world that allow you to sporadically see his activities. The enemy can leave a trail that you can pick up. He can make noises that might give away their position or distract you. These additions almost universally add additional player awareness of the AI’s activities when he is out of sight.

Sure, you can add some clever AI tactics that go beyond spawning… he might feint in one direction to lure you off, then work around and flank you. However, consider that we are adding to events in a chaotic, confusing combat situation to begin with. How would most players feel if they went towards an enemy who disappeared, appearing not much later to shoot him in the back? He might feel confused, or cheated, like the AI did something illegal. There is no satisfaction to be gained by guessing the enemy’s next action and planning accordingly. There is no learning process to “outwit” the opponent, nor is there any way to increase one’s skill to defeat him, aside from simple reflex improvement such as firing a gun accurately.

The development of most game features require the creator to balance of the investment of time and computer performance, versus the gameplay value created. No feature is free, and in a shooter, if the AI programmer spent all their time creating AI’s that can independently recreate all the works of Shakespeare, the time would generally be wasted… such effort and horsepower doesn’t help the player… this is a game about combating the enemy. Back when I was working on Soldier of Fortune 2, there were some enemies that had the ability of tossing clips to each other if one ran out of ammo. However, nobody knew that feature existed. Why? Well, the clips were never exchanged unless the two enemies were behind cover, completely out of sight. Also, the ammo level of any individual enemy was never a significant issue in the game, since fights tended to be very short and deadly. This was a time to invoke a cardinal rule of game development: Features that do not notably affect the player experience are usually not worth implementing.

Half Life 1Contrast that to the AI in the first Half-Life, which critics and consumers unanimously celebrated as one of the most significant contributors to their enjoyment of the game. In Half-Life the enemies did all sorts of things, from flanking you to spotting your thrown grenades and responding accordingly. However, combat against the deadly Black Mesa soldiers was a very hide-and-shoot affair, so there would have been little opportunity for the player to understand their tactics and smarts. However, some exceedingly smart individual at Valve decided to give the player a radio that intercepted the soldier’s communications, which gave the player a window on their reactions and strategies. Sure, it would have been even more challenging for the player if he had absolutely no clue to what the enemies were going to do next, but it is far more impactful to the player’s experience to allow him to understand how smart the enemies are. Arguably, beyond every other feature the enemies in Half Life had, the radio was the single most significant invention of that game.

Enemy communication of their intent has been used in other games, such as Halo, where the slightly comical alien grunts would spout exclamations like “there he is!” or “where’d he go?” when they observed a specific situation. Metal Gear Solid soldiers talk to themselves, saying “what was that noise?” and so on. Of course it’s not realistic, but it makes things more fun. Concealing those mechanisms actually creates a less compelling experience than when you lay out the rotating gears in front of a big window that the player can see.

Great AI lives in the player

mgs2iceSo if a more human-like opponent leads to unpredictable, and often unsatisfying behavior, and realistic, limited information plunges the player into a chaotic, random-seeming experience, what is the player asking for when he or she is asking for “better AI” or a “smarter” opponent? The answer to this harkens back to a previous point, that the player wishes to fulfill a specific fantasy that they have. They wish for their opponents to respond as they imagine they would in their fantasy. In the case of a super-spy fighting against armies of henchmen, it’s a set of opponents that appear to fight against the player effectively, yet die or fail to kill the player at appropriate moments so that the player can feel powerful.

In a player’s fantasy, an enemy is still capable of many things. There is a great deal that a gamer can imagine his electronic opponents doing to try to outsmart him. This includes flanking the player, hearing noises and investigating, changing ammo types, and spotting and responding to thrown grenades. In fact, it could be said that a large variety of actions at the enemy’s disposal is what might make him seem “smart”. However, again, with limited information confounding the player’s ability to appreciate this rich palette of AI options, there is but one avenue to make a character seem intelligent… we must inform the player of some of the choices that are being made while they are being made, so that the player can feel even cooler when taking them out.

Frantic, Fearless and Fun

Ridge Racer 7I picked up a PS3 the other day and still have yet to purchase a retail game for it…  Aside from staring at the crossbar and wishing I had a Blu-Ray movie to watch, I’ve spent much of my PS3 time playing demos.  After whipping through miniature slices of Motorstorm, The Darkness and even my coveted Heavenly Sword, I was still a bit bored.

Just for kicks, and because I was running out of diversions, I threw Ridge Racer 7 into my download basket.  God, I mut have been desperate…  That game hadn’t changed in like a million years.  I used to love RR, having played the hell out of the very first one on the Playstation, holed up in the basement offices during the early days of Raven Software.  However, other interests took my attention, so I hadn’t really played one seriously since R4, the last of the PS1 incarnations.

However, the moment I fired up RR7 and hit the accelerator, it was like coming home.

I raced around the track, not knowing the layout at all or the new mechanics like nitro boost and drafting.  However, I happily whipped around the corners like a madman and never even touchedthe rail.  I felt like a racing god for just a moment.  Holy crap!  After playing other (somewhat) realistic racers for a while like Gran Turismo and Forza, it felt incredibly liberating to just keep that accelerator down and try to skid around by the seat of my pants.  I don’t like to drive strategically, where I have to manage speed like a precious resource, I like to drive stupid fast and have to rely only on my wits to carry the day.  Obviously Burnout is the only other game that scratches that itch in the same way.

Sure, it’s not real racing, but it’s fun.

This got me thinking about other playing habits I exhibit.  For example, when it comes to shooters, from Doom all the way to this test build of Stranglehold I’ve got on my desk, I tend to really enjoy situations where I can head into danger, balls-out, and manage the situation on the fly.  Back in the Doom days, I got insanely good at shotgunning soldiers and imps, after leaping into rooms teeming with them and just barely manage to destroy each one as they lunged at my digital throat.  (I somehow did this playing only with a keyboard, somehow).  Does that mean I don’t like strategy, or a game that requires planning or thought?  No, I wouldn’t say that, but when it comes to shooters these days I do tend to lean more towards the Serious Sams of the world than I do the Ghost Recons.

Sure, it’s not real combat, but it’s fun.

To consider this to be a conflict between reflexes and strategic thinking isn’t the whole story.  To me the key is a loss of control, having to dive into danger and not quite know how you’re going to get out.  Assuming the game is forgiving enough and doesn’t punish you for those types of choices, it remains a fun experience.  If you can take the chaos of a situation and “surf it” to where you want to go, it’s a blast.  That’s what Ridge Racer drifting does for me, and sometimes my love for that type of experience leads to certain design choices I make, whether it has to do with driving, combat, or who knows what.

Storytelling in Children of Men

Since Children of Men was released on DVD, I picked it up and got to see it again. It’s a fantastic movie, just as good the second time around… I recommend it, and will try to avoid any spoilers when discussing it below.One thing we’ve talked about around the office is how game-y the script was. I’m not saying it in the sense sense that “boy, a Children of Men game would rock” (I’m not even sure it would), but rather that its method of storytelling was extremely well-suited to games…. It was simple, yet very powerful.

Game developers have struggled over the entire existence of video games to integrate deep stories into their gameplay… To an outside observer, it seems easy to demand that they “just hire a writer to create a story that doesn’t suck”. However, even with the most brilliant writer, it can be extremely difficult to get the player immersed in your fiction. Because of sporadic playing habits and limited attention spans, over the years I’ve seen subtlety whittled away from many scripts out of necessity. Unfortunately, as a result, characters with extreme depth and subtle motivations tend to give way to ham-fisted dialogue and characters that wear their hearts on their sleeves. For example, Japanese games that are renowned for great story is full of characters that puke up their deepest desires at the slightest provocation, and even very good stories like Final Fantasy XII is still delivered with very plain statements of motive.

In the case of Children of Men, a story was delivered where: Continue reading Storytelling in Children of Men

Thinking about GTA IV

A couple of months back, the gaming community was abuzz (thanks to a well-played hype engine) about the upcoming official trailer for Grand Theft Auto 4. What was the time period? Which characters would be in it? Where would it be set? Would they move on to new locations like Mexico or Europe, or would they return to the U.S.?

At the time, with a smug “experienced developer” sense of authority, I felt fairly certain of what GTA IV held for us. When they finally released that first trailer, I was surprised… they made a couple of choices I expected, and some others that I didn’t.

What led me to my assumptions were a few elements that I felt were key to the original success of the franchise:

Continue reading Thinking about GTA IV

Making the Rules: Realistic Battles vs. Fun Fights

There are things that developers grow used to over the years. One of them is the regular appearance of articles that basically say “Make better games!” or “Where’s my next-gen, bitch!?” They generally contain a laundry list of expectations, such as this one:

Where are the FPS bad guys who can adapt their strategy on the fly? Enemies who themselves have six different guns and switch up according to what the situation calls for? Bad guys who work in teams, who strategize, who create diversions to distract you? Where’s the enemy Solid Snake who sneaks up on you with the silence of a ninja’s church fart?

We have seen this argument since the days of Wolfenstein 3D, and it’s our own fault, really… We’re the ones who push the player into more and more realistic places. What should players expect from an incredibly realistic environment, except an incredibly realistic experience?

doom3_092303_001Computerized enemies are the most common target. That’s fair… many game enemies can’t even move properly, much less act realistically. But when gamers call for AI opponents that act as realistically and cleverly as a human player, you have to pause and think about what they are saying…

I mean, come on, how many of you want to be stalked by a ninja that silently sneaks up and slits your throat? To many, that would be like running around and then just randomly falling over dead due to a coronary or something. There are some tempting points in the above excerpt, like bad guys who strategize and all that. This sort of thing is great when it happens, but we have to make sure that we measure each advancement to the fun factor and more importantly, the core values of each game. To take the point to ridiculous extremes, I doubt that Pac-Man would be made better if the ghosts pursued you in 2-by-2 cover formation…

As for military games, how many players really want to feel like they are in a real war? To be cogs in an operation of thousands? To sit in terror that a bullet might come out of nowhere at any moment, striking them dead? Of course not. While gamers want to feel like they are in a “real war”, they also want to show off their skills by dispatching enemies and accomplishing important objectives. When they pick up Call of Duty, they want to feel like they “lived WWII”, but they also want to be the powerful, successful, and much-more-important-than-your-average-G.I. protagonist. Players generally do not want to be in a real war, but rather they want to be in a war movie.

mgs2icet’s important to remember that games are not just about storytelling or creating a realistic illusion, but they are also about fantasy fulfillment. Consider the source material that fuels the player’s fantasy… an enemy in a typical movie is often poor at being able to shoot the protagonist. He is dangerous in numbers, but he will warn the hero before doing something really deadly. Compare that to the typical hero, who can dispatch dozens of enemies without serious injury. So while players want to believe that the enemies are as deadly as they are, they still expect to be able to kill them en masse. He or she wants to feel potent, effective, and important… everything a fantasy is supposed to deliver.

A classic target for AI criticism is Metal Gear Solid. Gamers see an enemy that searches doggedly to try to find them, and then after a certain amount of time abandon the search and pretend the player was never there. “That’s unrealistic,” they cry. However, would the game really have been more fun if the enemy cornered him or her into a storeroom and then filled it with poison gas to guarantee the player’s death? Or perhaps the enemy should shut down the entire secret facility at the first sign of intrusion and begin a systematic burn of all areas, creating a “game over” the first time the player is spotted? Much more important than this is our duty to help the player feel crafty and smart.

DW3Another classic game where battle-lines are drawn is with the Dynasty Warriors series. The player is able to wade through hundreds and hundreds of warriors on a battlefield in an effort to turn the tide of a major battle. Gamers see combat against a single individual as lacking any depth, where they just slash at them a few times and move on. “Look at that unresponsive AI,” they shout. Of course, imagine having to engage in brutal, one-on-one combat with every individual… times a thousand. Or worse yet, these hundreds could use the strength of numbers to simply weigh the player down and skewer him like a trapped pig. Again, this isn’t helping the player feel like “an army of one”, a hero who can survive being outnumbered a hundred to one.

So, in conclusion, am I suggesting that enemy AI in games will never progress beyond where we are right now? Of course not. There are a hundred ways that game characters can be made to be more interesting, more resourceful, and more satisfying to fight, but that is a discussion for another time. There are also titles such as fighting games that need realistic one-on-one conflict against the most cunning enemies we can devise. Overall, however, it is important for us to understand our job when it comes to making games. Regardless of what players demand, we are here to help them have fun. It is up to us to interpret their fantasies and bring them to life.