Game developers employ AI for more adaptive play

Programmers reveal how they can code enemies to be smarter in games like 'Crysis' and 'Hitman'

Instead of charging directly at the player in the craggy martian landscape, as they might do normally, the aliens zigzag to take cover behind boulders and outcrops of rock, adjusting their approach as the hero opts for a less conspicuous route to his destination. The player changes his route again, and the aliens adapt their movements accordingly.Situations like this are becoming more common in video games as the product of a technique known as situational, or tactical, awareness. The concept is rooted in military tactics, but programmers schooled in artificial intelligence (AI) have started incorporating it into games to make enemies and other characters seem smarter. Situational awareness can play a big role in games that take place in immersive, "sandbox" environments, in which the objectives and challenges are not pre-set but rather determined by the player as he or she moves through the game. But situational awareness can be useful in any game that seeks to include intelligent beings in its cast of characters. 

Advances in processing power mean the approach can allow for more realistic experiences in games such as first-person shooters and role-playing games, or RPGs. Essentially it allows characters to adapt more intelligently to moves made by the protagonist.Traditionally, the movements and behaviors of characters have been less flexible. "Where people often start with this kind of system is hard-coding some specific functions for specific kinds of cover," said Matthew Jack, founder and AI consultant at Moon Collider, an AI development company that worked on the "Crysis" series of first-person shooter games. But Jack's work, and that of his peers, is focused on a more organic, adaptive type of intelligence. One programming technique, for instance, is to build measurement systems into a game so that distances between the protagonist and other characters are constantly recalculated and analyzed, allowing characters to make a variety of decisions based on those distances. One key application of this technique is "directness." Directness is a ratio that developers can employ to control an enemy character's movement toward the protagonist, for example. The calculation looks at the distances between the enemy character and an intermediary object, such as a rocky outcrop, and the protagonist. Using those relative distances, programmers control how the enemy characters advance toward the protagonist, Jack said. Setting the directness just barely above zero, for instance, could trigger flanking behavior by a group of enemies, since they would be moving closer to the protagonist via certain intermediary points but not close enough yet to attack, Jack told an audience of gamers and programmers at the Game Developers Conference (GDC) in San Francisco. Negative directness, on the other hand, can be used for retreating or fleeing, while zigzagging could be the result of establishing a directness of 0.5, which yields the least direct points of advancing upon a target. Another AI technique based on the same ideas as directness is the "golden path" method of measuring different location points between the gamer and some end goal or destination. Enemies might traditionally be scripted to appear along the most direct route to the player's goal, since that would be the most likely path for the gamer to take. But with the golden path technique, enemies could appear on the spur of the moment if the player takes a more circuitous route. A somewhat different type of tactical awareness was discussed by Mika Vehkala, senior AI programmer at IO Interactive, developer of the first-person shooter "Hitman: Absolution." Vehkala described a programming approach that determines the best location for enemies by looking at how "visible" any given location, or node, is to their target. As the player moves around, "it's constantly re-evaluating and seeing if there's a node with a better rating," he said. This sort of AI, however, works best in games built on static environments that do not change as much, Vehkala said. The techniques Jack described, on the other hand, are based on performing calculations and measurements as the game's obstacles and characters change. "My takeaway would be to build a language so you can iterate on your queries most rapidly and get the best results," he said.

Zach Miners covers social networking, search and general technology news for IDG News Service. Follow Zach on Twitter at @zachminers. Zach's e-mail address is zach_miners@idg.com

Join the Good Gear Guide newsletter!

Error: Please check your email address.

Tags Game platformsconsumer electronicsgamesMoon ColliderPC-based gamesonline servicesIO Interactiveentertainment

Struggling for Christmas presents this year? Check out our Christmas Gift Guide for some top tech suggestions and more.

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Zach Miners

IDG News Service

Most Popular Reviews

Follow Us

Best Deals on GoodGearGuide

Shopping.com

Latest News Articles

Resources

GGG Evaluation Team

Kathy Cassidy

STYLISTIC Q702

First impression on unpacking the Q702 test unit was the solid feel and clean, minimalist styling.

Anthony Grifoni

STYLISTIC Q572

For work use, Microsoft Word and Excel programs pre-installed on the device are adequate for preparing short documents.

Steph Mundell

LIFEBOOK UH574

The Fujitsu LifeBook UH574 allowed for great mobility without being obnoxiously heavy or clunky. Its twelve hours of battery life did not disappoint.

Andrew Mitsi

STYLISTIC Q702

The screen was particularly good. It is bright and visible from most angles, however heat is an issue, particularly around the Windows button on the front, and on the back where the battery housing is located.

Simon Harriott

STYLISTIC Q702

My first impression after unboxing the Q702 is that it is a nice looking unit. Styling is somewhat minimalist but very effective. The tablet part, once detached, has a nice weight, and no buttons or switches are located in awkward or intrusive positions.

Latest Jobs

Shopping.com

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?