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 newsletter!

Error: Please check your email address.
Rocket to Success - Your 10 Tips for Smarter ERP System Selection

Tags consumer electronicsGame platformsPC-based gamesMoon Collidergamesonline servicesIO Interactiveentertainment

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

Zach Miners

IDG News Service
Show Comments

Cool Tech

SanDisk MicroSDXC™ for Nintendo® Switch™

Learn more >

Breitling Superocean Heritage Chronographe 44

Learn more >

Toys for Boys

Family Friendly

Panasonic 4K UHD Blu-Ray Player and Full HD Recorder with Netflix - UBT1GL-K

Learn more >

Stocking Stuffer

Razer DeathAdder Expert Ergonomic Gaming Mouse

Learn more >

Christmas Gift Guide

Click for more ›

Most Popular Reviews

Latest Articles

Resources

PCW Evaluation Team

Walid Mikhael

Brother QL-820NWB Professional Label Printer

It’s easy to set up, it’s compact and quiet when printing and to top if off, the print quality is excellent. This is hands down the best printer I’ve used for printing labels.

Ben Ramsden

Sharp PN-40TC1 Huddle Board

Brainstorming, innovation, problem solving, and negotiation have all become much more productive and valuable if people can easily collaborate in real time with minimal friction.

Sarah Ieroianni

Brother QL-820NWB Professional Label Printer

The print quality also does not disappoint, it’s clear, bold, doesn’t smudge and the text is perfectly sized.

Ratchada Dunn

Sharp PN-40TC1 Huddle Board

The Huddle Board’s built in program; Sharp Touch Viewing software allows us to easily manipulate and edit our documents (jpegs and PDFs) all at the same time on the dashboard.

George Khoury

Sharp PN-40TC1 Huddle Board

The biggest perks for me would be that it comes with easy to use and comprehensive programs that make the collaboration process a whole lot more intuitive and organic

David Coyle

Brother PocketJet PJ-773 A4 Portable Thermal Printer

I rate the printer as a 5 out of 5 stars as it has been able to fit seamlessly into my busy and mobile lifestyle.

Featured Content

Product Launch Showcase

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?