clock menu more-arrow no yes mobile

Filed under:

Creating compelling AI NPCs for an open world

Open-world games are designed to allow players to explore and interact in it at will; creating compelling AI characters and enemy types for these games can be difficult when everything is built to scale and adapt to what the player does.

Jeet Shroff, senior programmer at Avalanche Studios, addressed this topic in their GDC 2014 talk, "Free-Range AI: Creating Compelling Characters for Open World Games." He discussed how open-world titles present the challenge of needing dynamic non-playable characters to help players immerse themselves in the game. Design decisions had to be made that allowed NPC behavior to accommodate player choices as well as emergent and open-ended gameplay segments.

Open-world games are sandboxes — they want players to have the power to craft their own experiences. Developers want this ideal to extend to all areas of gameplay, but by handing all control over to players, developers relinquish their own control over the game.

Enter AI — developers' way of having some control over the sandbox. According to Shroff, any AI introduced into an open-world game needs to be adaptable, reactive, scalable, interesting and fully-realized, otherwise its presence won't work in the game. It's also challenging to develop sandbox AI that doesn't creatively stifle the player or discourage them from setting out to discover and try new solutions on their own.

"The idea is to represent or script the intended player up front as an exercise, like you would do for any non-player character in the game," he said. "As AI programmers, we have to model perception and behavior."

AI developers on open-world games must be player-centric in their thinking, and need to determine what enemy types will cause players to search for their own solutions. Developers must trust players to create behavior variants on their own with each enemy they introduce.

The same goes for player motion. In Just Cause 2, players can move very quickly in any direction on the map — something complicated and difficult for developers to make. It's hard to deliver a consistent player experience that is positive when there are so many variants to script — staging, positioning and game pacing among them. Systemic solutions are key to creating AI that work in open world games, Shroff said.

The size of the world and complexity of decisions will also affect how complex AI can be. AI behaviors need to be easy to understand and less complex — behavior trees, a setup of branching paths of AI reactions, is developer and designer friendly, Shroff said. Behavior trees can also help developer determine what actions will be most obvious to the player. If AI take actions that players anticipate, this will make it easier for players to respond to them or defeat them, if they are opponents.

The biggest challenge in open-world AI is dealing with a limited amount of memory and making characters that are adaptable to a wide range of situations, Shroff said.

"Build systems and not moments — systems that work well with and for the player, so you're not just making moments," Shroff said.

Sign up for the newsletter Sign up for Patch Notes

A weekly roundup of the best things from Polygon