Wednesday, December 8, 2010

The Future of A.I. in gaming

Artificial intelligence in games has matured significantly in the past decade. Creating effective AI systems has now become as important for game developers as creating solid gameplay and striking visuals. Studios have begun to assign dedicated programming teams to AI development from the onset of a game's design cycle, spending more time and resources on trying to build varied, capable, and consistent non-player characters (NPCs). More developers are also using advances in AI to help their games stand out in what has already become a very crowded marketplace, spawning a slowly growing discussion in the industry about redefining game genres. Think tanks and roundtables on advances in game AI have become prominent at the annual Game Developers Conference (GDC), while smaller AI-dedicated conferences such as the annual Paris Game AI Conference and developer-run online hubs such as AiGameDev.com are garnering a big industry and community following. While industry awareness about the significance of AI in games continues to grow, GameSpot prompted Matthew Titelbaum from Monolith Games, Remco Straatman from Guerrilla Games, and AiGameDev.com founder Alex J. Champandard to share their thoughts on the future and growth of game AI.

The Halo franchise is recognised as a leader in the field of game AI.
Unlocking new possibilities

While faulty AI is easily recognised, an AI system that is doing its job often goes unnoticed. No one stops halfway through a level to admire the idiosyncrasies displayed by NPCs unless they are doing something completely out of character--the more unremarkable, the better the AI system. While achieving this result is still a priority for game developers, making games with an AI system that stands out for being good is a relatively new concept: few studios want to dedicate costly man-hours to chasing innovation in a highly technical field that, for the most part, is likely to go unnoticed. However, there are some exceptions. In 2007, AiGameDev.com launched its annual game AI awards, nominated and voted by the site's community. The purpose of the awards was to spotlight the games that showed promise in the field of AI, either by trying something different or exhibiting technical proficiency. In 2009, the Best Combat AI and the overall Best Game AI awards were won by the same studio--Guerrilla Games for Killzone 2. Remco Straatman, lead AI programmer at Guerrilla, says a lot has changed in game AI in the last five to 10 years, with more developers trading low-level scripting for more advanced NPC decision systems.

"In general, I think game AI has gone from the stage where it was an achievement if it did not stand out negatively to the point where AI in most big games is solid, and some titles are using innovative new ideas," Straatman says. "More development teams have also moved from simple state machines to behaviour trees and using planners in NPC AI systems describing knowledge of the world around the NPCs have improved with better knowledge for navigation over changing terrain, and more knowledge about strategic properties of the world such as cover. I also think advances in animation systems with better ways to combine various animations and physics have become available, which now allows for more realistic movement and responses to being hit [in combat AI]. Most of these systems were not around 10 years ago or simply could not run on the hardware available."

Creating a solid game AI system involves successfully networking smaller systems together. For example, a system that deals with the problem-solving capabilities of individual NPCs goes hand in hand with a system that makes sense of the gameworld and its parameters and helps NPCs make relevant decisions. Thankfully, developers don't have to build these systems from scratch: they use specific planners that generate increasingly complex networks.

"At the moment [Guerrilla Games] is using a specific type of planner for our NPCs called Hierarchical Task Network (HTN)," Straatman says. "This is capable of generating more complex plans than what we had before Killzone 2. We also keep on improving things like the CPU performance, which means we can support more NPCs in Killzone 3 than we could in Killzone 2. The terrain-reasoning systems we generate have also evolved over our various titles. We are now able to deal with much more dynamic terrain (like obstacles moving around or changing shape) than ever before. Our data on where there is cover has also become more detailed, something that allows NPCs to deal with more complex environments such as multistory buildings, etc."

Killzone 2's lead AI programmer Remco Straatman believes the industry is still struggling to make NPCs as human as possible.
Back when Straatman and Guerrilla began work on Killzone and Shellshock, the team’s goal was to make the AI system as capable of making its own decisions as possible, realising this would make things all the more fun for players. However, doing this in a consistent way proved to be a lot more work than the team anticipated, particularly when dealing with combat AI. While the goal of normal AI is to emulate the real-life behaviour of a particular nature (for example, doctor, civilian, or shopkeeper), combat AI works very differently. Firstly, its main objective is to be as entertaining as possible. In some cases this means being efficient at killing players; in other cases, it's more about making intentional mistakes and "overacting" by way of signalling to players what is about to happen.

"Where normal AI tries to emulate an expert medical specialist or world champion chess player, game combat AI is more like emulating an actor," Straatman says. "At the end of Killzone 2 we found ourselves looking at the NPCs doing things that we did not expect, and this surprised us positively. Reviews and forum feedback confirmed we had at least partly achieved the vision we had so many years back, and people playing the game recognised and appreciated it."
One of Killzone 2's most commended features in the field of AI was the game's skirmish mode. Because this mode is more team-based and tactical than the single-player campaign, the AI bots in this part of the game need to do more than simply run around and kill one another. Guerrilla based the skirmish AI in Killzone 2 on the real-time strategy model, building two levels of AI on each individual bot. The first is a commander AI, which controls overall strategic decisions; the second is a squad AI, which translates the commander AI's orders into orders for the individual bots. The team then taught the bots how to use the in-game badges as part of the order given to them by the squad. For example, if an engineer bot is ordered to defend an area, he will first build a turret at a tactical position before starting to patrol. While some might argue that AI bots no longer play as important a role in multiplayer games--given that most gamers now play online--Straatman says bots improve gameplay and give players a chance to test out multiplayer strategies before going up against other human players.

"They give people a testing ground for real multiplayer--getting to know the maps and the game modes in a game against human players can be too much to start with."

According to Straatman, the area that needs most improvement in the game AI field is buddy AI. Because buddy AI systems often have contradictory constraints, getting this system right is often a big challenge: the buddies should be visible and close to the player but not get in his line of fire; they should stay close and respond to the player movement but not move around all the time; and so on. Buddy AI is also much closer in view to players than enemy AI, making any errors easier to spot.

"Enemy NPCs know what other NPCs of the same faction are going to do because they are all computer-controlled and can tell each other what they will do next. However, players are much harder to predict--if you would look at movement patterns of players, you will see they are quite strange at times. This is made worse by the fact that player turn rates, movement speeds, and acceleration are very high. The last point is the expectation of the player: enemies are only supposed to shoot at you, whereas buddies are supposed to fight and interact with you in a sensible way. We are working hard to make the buddies work better, because we feel that they can add a lot to the player experience when done right."

The AI director in the Left 4 Dead games is an example of how developers can use AI to reach beyond traditional individual NPC behaviour.
Straatman believes the struggle to make NPCs as human as possible is still very much at the top of the list for many AI programmers, with the future set to change the way we think about in-game interaction.

"The ideal is always to immerse the player in the game: the NPCs should feel like they are living and breathing creatures, and this illusion should not be spoiled anywhere. Within the relatively limited interaction you have in a game, it may be achievable to make the distinction very small. I think human behaviour is so interesting, and yet subtle interactions such as conversations are still out of reach of autonomous AI; games rely on clever scripting or cutscenes to get that across. If we as a field will master these types of interactions, more parts of the game can be interactive, and possibly whole new game genres may become feasible."

"I think this will make games more approachable and immersive. If we are able to maintain the immersion by having realistic behaviour in the interactive parts of the game, you will get a seamless experience from cut scenes to combat. I also think we are ready to use AI for more than just individual NPCs--the director system in Left 4 Dead is one interesting first step in that direction. We probably will see more combinations of AI systems that before were limited to one type of game: RTS games will have unit AI that will come closer to what you now see in first-person shooter games. MMOs could also start using more elaborate AI, potentially even to command hordes of NPCs. I hope we will see some brave studios try to create these new systems that are now becoming possible."

Share/Bookmark

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...