Tag Archives: AI

The Challenge… errr, Challenge – DTO Part 2

Last time I talked about co-op games and the need to tweak the difficulty in the name of a better experience.  I mentioned that inflating the total number of hit points can work, but it can lead to the trap of The Numbers Game, where your existing health and damage are scaled together, resulting in a constant game challenge that only shifts when you fall outside of what the game deems “fair”.  This can work for RPG’s, but is troublesome when used on shooters.

Bag o' Hit Points
Bag o' Hit Points

This argument isn’t particularly constructive for the FPS designer, the poor soul who is scrambing for anything to keep things balanced and exciting in the wild wooly west of random online pick-up groups. We can’t really blame them for falling back on pure numbers when necessary (full disclosure: X-Men Legends was an unabashed example of the Numbers Game…). Solving this problem through other means is a tough one, but it is worthwhile to pursue avenues other than the venerable Bag of Hit Points.

Challenge Stage

When looking for ways to increase difficulty, game developers often wish the answer was as simple as adding more enemies to each encounter… “No problem! Double the players equals twice the enemies! BAM!” Sadly, very few game technologies give developers the luxury of unlimited enemies onscreen… It’s a yoke that just about all of us constantly struggle with. Back in the sprite days of Doom and Heretic it wasn’t a big deal; those games had extra enemy spawns that were triggered at higher levels or during coop. In these days of high-fidelity characters, however, most technology still keeps the population somewhere in the single digits.

There are tricks to give a feeling of greater foe count… Placing additional enemy encounters in the “dead spots” between the “standard” encounters works, if you never overlap the encounters to keep the maximum enemy count low. It can be tricky to pull off but it can give the player a sense of a relentless onslaught, requiring him to manage ammo and health more carefully even though he never sees more than a few at a time. Unfortunately, by leveraging this method you can ravage any sense of pacing, leveling out those tension peaks and valleys into a steady drone, and changing the game in perhaps unintended ways.

Another population trick is to deliver more enemies to the battlefield through respawning. This allows enemies to repopulate places that were previously cleared out, denying players a safe retreat and keeping the pressure on. This approach can be reviled by players because it denies them a sense of “completion” within a level (it was a contentious feature in Soldier of Fortune, for example), but it can be used to great effect. My first experience with respawning as a gamer was Doom’s Nightmare mode, where all enemies regenerated after 1 minute or so. (Damn that was hard!) More recently it was embraced in Left 4 Dead, where zombies can pour out of just about any opening, inaccessible fences area, rooftop, etc. Careful use of this mechanic can help a game level feel as though it is packed with hundreds of foes, even if your tech can’t handle it (although L4D did a damn good job with the population too)…

Up to 11

In contrast with developers, a majority of gamers wish that higher difficulty was just a matter of making the enemies smarter… perhaps implying the existence of a Jules Verne-era dial with “IQ” scrawled on the side that can be cranked past 10. Unfortunately game AI is never so easy that you’ve got unused slack somewhere that you’re not using. Generally it’s not decision-making that challenges the AI programmer or designer, but rather environment response and navigation. Sure, humans can walk across an obstacle-ridden field without even thinking about it, but an AI that does this naturally requires tremendous work whether the difficulty level is baby-like or insane.

Even if the leap from floor-traversing mouth-breather to devious mastermind were easy, I’ve repeated many times that “smarter enemies” don’t always pave the way to “more fun” anyway. Aside from major boss-level fights, the opponents in many games don’t last long enough for you to really experience their brilliance… showing off would require for the player to see them, which means they’re probably already busy killing them. Sure, you could make the enemies tougher so that you might see their amazing kung-fu, but then you’re back to turning them into HP bags.

pixelshot

Some games emulate enemy “smarts” by simply increasing their shooting accuracy or giving them uncanny perception. Let me be clear, this is not fun. Most games with gun-toting enemies need them to be inaccurate at long ranges. If an enemy pops into a play space a long distance from the player, chances are the player is not aware of their presence immediately… a bit of warning is needed before he gets a bullet in the head. If an enemy’s accuracy is simply dialed up arbitrarily, the player suddenly starts taking significantly more damage from enemies a few pixels in size… you’ve turned the game into a walk through a room full of snipers. Statistically the enemies are just doing more damage to the player each second anyway… so that’s what you want, just crank the bullet damage and be done.

There are some better models out there for bullet inaccuracy that can help remedy the fun, but they are still aren’t used enough (that would be fun to talk about in another post).

Phases of Death

While technically it is a variation on adding health to opponents, but one way of amping difficulty is giving them additional damage states, each of which has to be “killed”. Examples of this are the humans that become “tentacle heads” when headshot in Resident Evil 4, or the aliens in Blacksite: Area 51, that can sever their torso after being “killed”, crawling after the player. These imply non-realistic opponents or a heavy art burden, but it can also be done by having the foe walk with a limp in phase 2, or switching weapons each phase.

This may sound familiar because it is the way that just about every classic boss encounter works… and for good reason. Bosses are “tough” and hence can soak up a lot more damage… without small player victories and new behaviors coming into play, defeating them would be a tiresome exercise in shoveling damage until it goes down (and many action games still use this model).

Cleverly-designed damage stages also have the advantage of not always being used. A 3-stage robot can skip stage 2 and 3 in easy difficulty, last for a second stage in later levels, and die only after all three in harder difficulties. Depending on how an enemy is designed, it might even be possible to regenerate them to a previous state if not killed in time for even more challenge.

A distant relative of the staged model is a mechanic where an enemy must be in a certain state to be killed. For example, a foe may have a “stunned” state which provides you with an opening to slice off their head. By this I don’t mean “Japanese boss-style” where every 15 seconds the monster opens up his eye-dome and can be hurt, but rather a system that gives the player the tools to introduce a vulnerable state. Another example is a robot who must be immobilized with an electric shock, before you step in to disable his control chip. Or a soft-bodied creature that must be frozen first and then shattered (similar to how the freeze-wrench combo works in Bioshock). Games like modern military shooters are more limited in this respect, but if you have the luxury to play with your enemy ecology (that is, their function and response to various stimuli), a large number of additional options open up to you. As above, you can scale difficulty by sprinkling in these new mechanics more aggressively later on (say, early robots don’t have an “overdrive chip”, but all of them do at higher difficulty).

Smarty(er)-Pants

Other tricks aside, there’s still a value in delivering a smarter enemy… or at least one the gamer will recognize as “smarter”. One example of that is to add some coordinated behaviors between multiple foes. A simple trigger that makes several enemies charge at once or synchronize multiple grenade tosses can add difficulty in a hurry. Throw in an audio cue to draw attention to it and suddenly the gamer has a newfound respect for your AI mojo, baby. More complicated relationships like an enemy that lays down covering fire while the other charges can be good also, but the more complex they get, the more likely they are to fail or get lost in the shuffle. Sure, it makes things harder, but look for ways that are going to make the player feel the added pressure.

Left 4 Dead in particular leveraged this synchronization through their “AI Director”. While not technically an issue of “smarts” (the zombies are, well, zombies) when the director decided that the experience needed a massive assault for added danger, the player knew that the game was turning on the heat. The perception of challenge is perhaps as important as the actual difficulty increase.

fallenshamanfallenAdding enemies with interrelated behaviors is also a method to give a feeling that they are “conspiring against you”. A prime enemy that adds challenge to any group is the buffing opponent. The Shaman in Diablo II and the Arch-Vile in Doom II could resurrect fallen opponents, making the whole group for more deadly and interesting to fight. Other, more mild examples of this type of enemy are enemies that have an aura that heals or increases the strength of their nearby friends.

A player must completely change his tactics and adjust when fighting a group that has a buffing foes added. Even one can add considerable challenge, and multiples can be devastating. Beyond just spawning extra ones, their behaviors can be tweaked for difficulty by increasing the buffing effect, casting time, or the radius of their ability.

Looking closer, any type of environmental object that enemies can utilize can add challenge and an extra feeling of intelligence, no matter how simple. Enemy buffs could be provided by emplacements rather than spawned foes. The health stations in BioShock kept you from leaving your nearly-dead foe alone, because he might return fully charged. Emplaced totems such as those in World of Warcraft are similar.

Final Thoughts

Reflecting on what I’ve written above, I see that there is no “magic bullet” for scaling difficulty (although I hoped that writing about it might shake one loose). The techniques that must be used will certainly vary from game to game… My main suggestion is to look beyond the traditional D&D numerical “crutch” when faced with systems that need to scale. I understand why we do it: it’s not just our inner fanboy screaming to get out… numbers are a necessary part of our job and getting results. However, I love designs where the player doesn’t have to be steeped in numbers in order to succeed.

You might also come out of this thinking that I turn my nose up at RPG’s. On the contrary, it’s one of my favorite genres, and Diablo II is still my favorite game of all time.

Finally, I certainly mean no disrespect for what Resistance 2 has accomplished in its multiplayer mode. Along with Call of Duty 4, I think it has laid a foundation for great semi-persistent online experiences for shooters. What others might build upon these concepts in the future makes my mind reel.

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.

Archive 1: Kingdom Hearts Review

Over the past 15 years I’ve written a bunch of stuff, public and private, that I was looking for a repository for.  Right now I only have a few articles, but I’ll be growing this as I uncover material and write more.

 Anyway, I figured I’d start out light…  This is a review of Kingdom Hearts that I wrote for internal distribution at Raven.  If anything, it gives a feel to the style that I use.

Game Developer Review: Kingdom Hearts

By Patrick Lipo
February 2003

Kingdom Hearts was released in September 2002 to a reasonable amount of fanfare. The first effort of its type and scope, Disney worked closely with Japanese game giant Squaresoft to create an epic RPG that fused the world and characters of Disney with the concepts and design of a Square game. This no doubt was a true leap of faith for Disney to entrust such a large chunk of their closely-guarded properties to any company, much less one of an entirely different culture and perspective. Reportedly the new, Japanese-styled characters that were created for this game will even become part of the Disney mythos in Japan. The game certainly has the production effort to match the scope of the partnership. Vast armies of artists, animators, programmers and voice talent were brought to bear to bring the game to fruition. It went on to ship over 3 million copies worldwide as of December, and I believe that even now it is in the top 20 overall selling games. Gamerankings.com has already collected the reviews for a respectable
average of 87%.

The Disney tie-in:

Rating: Surprisingly cool. The story revolves around Sora, a boy who lives on a little island which is consumed by a black scourge known as the Heartless. Sora is thrown into another world where he meets Donald Duck and Goofy, who join forces with him and journey through various Disney-styled worlds to deal with the mounting threat. The cinematic sequences initially feel surreal to watch; seeing your character conversing with Goofy about such grave circumstances seems ridiculous at first, but quickly becomes quite natural. The explanation of all the different mythos of Disney being part of this multiverse seems a bit forced sometimes, but it goes together reasonably well in the end. Tying everything together was certainly a big challenge for the art staff, bringing together the more realistic forms like Snow White together with the more stylized characters like Tarzan and the all-out cartoony characters like Goofy and Ursula the octopus, not to mention the anime-styled original characters. Overall they did good work with this by blending the looks for the original content, by blending stylized forms with more cartoony clothing, or by adding splashes of color to some of the more dreary environments. However, I can’t guarantee that the mixing of styles will please you, as I have heard enough online grumbling from those who just couldn’t accept it.

All-Age Appeal:

Rating: Pretty good. Kingdom Hearts is rated E (Everyone), and definitely seems to want to have something for young and old. The grave subject of a black terror devouring worlds seems to defy the for-kids feel of the game, but everything is softened slightly by a Disney wrapper that gives even the shadowy Heartless a place alongside Alice and Minnie Mouse. Villains feel dangerous, but there is an element of whimsy to them to keep from really scaring kids too much. There’s a fair amount of gameplay depth, and the story is reasonably involved. I’m not really a huge Disney fan, and in general I believe that an older or hardcore gamer enjoy playing Hearts, although possibly in fear that their friends will somehow find out that they are spending their evenings summoning Bambi… Make no mistake however, those that can’t get past the so-called “kiddie” look of Mario or Zelda games won’t find this any better. As for kids, I do think the game is pretty grave for very young kids, and some of the mechanics are pretty complex also.

Gameplay and Control:

Rating: Weak at first, good later on. Sora is an interesting character to watch and control, with flamboyant and interesting moves and attacks. However, the motion, particularly while jumping, has a “floaty” feel to it that will definitely throw off those used to controlling of Mario, Spyro or Link. You will miss many jumps initially due to the odd feel until you adjust. Luckily, while there is a fair amount of jumping in Hearts, the penalty of a missed jump is never serious, resulting only in some inconvenience as you return to your jumping point.

The combat is fun and easy, really easy to get absorbed in. Punching the attack button results in rather simple attacks, but by toggling a button, the player can lock onto any enemy and start hacking away. This is where the “floaty” feel works to your advantage, as the character will automatically turn, leap and dive to reach a targeted enemy. Without even touching the jump button you can slash at one of the many airborne enemies multiple times before gently falling back to terra firma. The downside to the game’s fighting is that it can get repetitive. Entering or re-entering a room will result in waves and waves of creatures attacking. It almost seems unfair, because instead of residing in a room, they will “spawn” around you as you enter a given area, drawing you to fight until you clear out multiple waves with that area or eventually retreat. Luckily, as the game progresses, the variety of enemy types and your own abilities makes even repeated encounters with the same creatures engaging.

Enemies, Allies and AI:

Rating: Quite good. Throughout most of the adventure, Sora has two allies who fight alongside him, usually Donald and Goofy, although other characters such as Aladdin or Tarzan can be used also. The AI of these allies is very good. They are competent enough to take out enemies on their own, but are not so potent that you aren’t engaging in the bulk of the action. All characters have spells, and will use them offensively and defensively in appropriate situations. They navigate well as Sora jumps and climbs throughout areas, although the game does help out in cleverly “teleporting” them to you when you’re not looking. The only fault that might be had with them is that regardless of the aggressiveness level you set them to, they tend to vastly overuse resources such as healing and mana elixirs, so you generally have to ration out valuable items to them in very small numbers.

As I said above, the variety is the most notable element of the enemies. Most are carefully designed, with unique movements, patterns and vulnerabilities that inspire different strategies to defeat them. This is good, because otherwise the AI is not too special. Since the Heartless do not appear until you get within 10 feet of them, and since they disappear if you get too far from them, there is no need for serious navigation or tactics. I found that combat was pretty dull until a few worlds into the game, when there are enough enemies introduced and Sora picks up enough special abilities that things start to pick up. Finally, the large bosses are handled very well, many being very large ones that require you to actually jump on top of them and target specific parts of their bodies.

Polish and Presentation:

Rating: Ungodly. While I do think the gameplay is more rewarding further into the game, I have always told people that you really play Kingdom Hearts for the spectacle above all else. The Disney world is amazingly portrayed here, giving the worlds of Tarzan, Little Mermaid and Nightmare Before Christmas their own charm and flair, often with differing art direction within. Unfortunately the first world, Alice in Wonderland, is not quite as special as some of the later ones, but taking flight around Big Ben in the Neverland realm offers one of the bigger feelings of wonder I’ve felt playing a game. Some of the worlds are fairly small in size, but there is a lot of variety, and you find new Disney mythos popping up in a huge number of places. It’s really only in some of the original worlds where the spark is lost, seeming far more bland after being severed from the source material.

As if the sheer resources of Square weren’t enough, this game uses the Disney studio resources quite heavily also. The voice recording in particular is well directed, and sports a very good cast. More interesting than the menu of young celebrities chosen for the new characters, many of the Disney universe voices are taken directly from the same people who have done them for years, even for small bit-parts. Overall it brings the universe together very well.

The technology that is brought to bear to create some of the Disney spectacle is quite impressive also. While fighting opponents in real-time, it is possible to summon one of several Disney characters to help you out. The game segues immediately into a summon sequence with incredible effects, backdrops, and camera work. The game then puts the player right back into the fight, having covered up any loading that might have been necessary. The Lion King summon to me was one of the coolest things in the whole game.

Longevity:

Rating: Whatever you make of it. As an indicator for how much people will replay this game, the GameFAQs entry for Hearts is always in the top ten for visits, regardless of the other new games that might be out (Vice City and Final Fantasy X are the other ones that stay in there). There are a large number of player-made documents about collecting all the weapons, how to unlock secret battles, or how to defeat optional bosses like Sephiroth that are practically unbeatable. There is one misfire (the Gummi ship minigame is so terrible it could make kids cry), but overall I felt that there was still a fair amount of stuff for me to discover after finishing the game, and I had already invested around 60 hours.

Summary:

So why is this game successful? If it isn’t obvious already, the Disney license and the amazing quality with which it was realized is enough to net young and old. In addition, the easy, accessible play let younger players get involved, but in the end there is a lot of complexity and depth. The combat, puzzles, or even the story weren’t the things that made me feel good about this game. It was the variety and the incredible presentation that made it worth the time I put into playing it.