AI in Computer Games
Introduction
Computer game development is one of the most spectacular field of engineering which requires coding skills and out of the box thinking capabilities. As the demand for computer games are increasing, more technologies are incorporated into these games to make them stand above from others. One such trend is blending Artificial Intelligence (AI) into normal gaming algorithms to make the user experience more immersive and interactive.
Computer gaming field is more prone to AI research activities as they generate more revenue than other commercial applications because games are not only used for entertainment but also in the military, sports, education, medical training etc. AI games takes the user to a more interactive and adaptive experience by learning and adapting to the behavior of the player (user) while playing.
However in the recent year’s, game development has gone through a drastic change in terms of graphics, animation, audio etc. with little amount of AI in it. Use of AI techniques makes the games more interactive and interesting. Development of ‘serious games’ used for military simulations, medical procedure practices and gems for entertainment requires a huge effort from the game developers and testers. As the gaming industry grows further the use of AI and related techniques also increases which thereby increases the demand for skilled programmers. Further researches are going on in this field to make the development of AI games smoother and less complex.
Adaptive Gaming
The term adaptive gaming refers to games which can adapt themselves to unforeseen situations and adaptive games can improve the player experience by learning the game play style of different users and thus changing the gameplay experience.
Adaptive game development reduces the effort of the developers, since it is able to make changes and decisions by themselves.
The process of incorporating AI into computer games is more complex than standard game development technologies and to get a better understanding we can divide the case study into subsections.
- Requirements of different games from AI perspective
- Challenges presented by games to AI community
- CBR (Case Based Reasoning) approached for AI games
Requirements of different games from AI perspective
There are different types of games like action, role playing, adventure, strategy games, god games, individual and team sports games. In addition to these genres there are two other categories such as interactive drama and educational games.
- Interactive drama : These type of games have a storyline behind them which changes or adapts as the player progresses in his/her gameplay. The author of the game tries to communicate a strong story or plot to the player which involves change in the situations and atmosphere according to the progress of the gameplay course. These types of games are open-ended and adapt to the player interactions as the story unfolds.
- Educational games: Educational games have a purpose of teaching a particular or set of concepts to the player. These types of games monitors the skill of the player as he/she progresses in the gameplay and makes the upcoming tasks easy or complex and hence makes sure that the aim of the game is met.
By understanding the aim and purpose of the game genres the application of AI can be divided into two;
- Character-level AI : produces more intelligent and believable behaviours for the characters
- Game-level AI: applies to the whole game and watches over the player interactions.
Different genres of game applications require different combination of both character-level and game-level AI’s.
When it comes to interactive drama game applications both character-level and game-level AI’s are
Required as game-level AI technique is used to make an overall change in user experience when the game story unfolds and character-level AI’s make believable character and language modification to the gameplay characters.
When it comes to role play and adventure games the emphasis is more on character-level AI as the characters in the application should look realistic and the behaviours and reactions to different situations must not be repetitive in nature.
Challenges in Computer Game AI
As said earlier, it’s not an easy task to build AI powered games. There are many challenges involved in developing AI based games.
Some of the common challenges are listed below.
- Complex Decision making techniques: Most state-of-the-art computer games involve complex strategic (real time strategy games) or believable behaviours (interactive dramas). Both kind of behaviours share the characteristic of having huge decision spaces, and thus traditional search-based AI techniques cannot be applied.
- Knowledge Engineering: Incorporating all ideas and behavioural patterns into the games requires huge human effort. The developer should have a completer knowledge of the domain used.
- Authoring Support: Behaviours and situations are codes that may be developed by developers having little knowledge or zero knowledge in AI technique, so they should be given adequate training and support in AI techniques to avoid human generated “bugs” or not achieving the desired result.
- Unanticipated situations: During the course of gameplay there may be situations that can’t be predicted during the development phase of the game application. This makes it difficult to develop believable behaviours that react in an appropriate manner to these unforeseen circumstances.
- User-Specific Adaptation: As the final application is used by different users the gameplay experience also should adapt to the strategies and skills of the player. As the developers include uses modelling into the application the AI strategy ad behaviour must in turn be adaptable based of the user model.
- Replayability and variability: Whenever a player comes across repeated situations and behaviours in a game play he/she may get bored. Even for making simple variations a large repository is required, which increases the development effort and time.
- Rhetorical objectives: There are cases where the game has to realize that the intended objective of the game is met whether if it is an entertainment or training game. To achieve this the repository of the game should be engineered efficiently.
AI based Behaviour Modification
In most of the real world games, the illustrated characters have their own behaviours and characteristic which makes the game more realistic and interesting.
To achieve this milestone the developers have to make huge effort as they won’t be able to foresee all the possible combinations of situations that the character may encounter in the game play. It will be really difficult as most of the games are dynamic in nature and is almost unpredictable to foresee the upcoming situations.
There may be another situation where some characters reproduce same behaviours throughout the game, which effects the believability of the character and the game itself. Another problem arises when the character is unable to identify the failures in the intended behaviour and they continue to exhibit them continuously.
Ideally for a perfect game the character should automatically adapt to every situations occurring in the game world. To address the above said issues a Behavior transformation system can be uses.
Behavior Transformation System
A behaviour transformation system consist of two layers namely reactive layer which handles the real time interactions and a reasoning layer which handles the monitoring and making repairs to the state of the character.
A behavior language is used to define the character library of the game characters and is used as the reactive layer. The behaviour language has a fast runtime execution module which makes it better for real world game processing. The library is composed of behaviors and constantly captures the characters state in various game play scenarios.
The reasoning layer consists of two components. The first component tracks long-term patterns in the characters behavior execution and detects violations of the author specified behavior contract when a contract violation is detected, it uses the execution trace to perform blame assignment, identifying one or more behavior’s that should be changed. The second component applies behavior modification operators so as to repair the offending behavior’s identified during blame assignment.
To achieve the behavior modification the reasoning layer should be able to detect the changes or fault in the character behavior’s, for this the authors (developers) have to specify contracts about long-term character behavior and when this contract is violated the reasoning layer accesses the library and modifies or makes corrections to the predefined library. This can be achieved on the basic of an Emotion model. Emotion values serves as representation of long term behavior’s. The author specifies personality specific constraints on behavior by specifying nominal bounds for emotional values. During runtime a characters emotional state is incremented when specific behavior, annotated by the author succeeds or fails. When the emotion value exceeds the predefined level the reasoning layer detects and makes a blame assignment and changes the library behavior. The emotion increment value per behavior is defined by the author as part of specifying the character personality.
Another requirement on the reasoning module is to determine the behavior that should be changed in response to a violation of the personality contract. This blame assignment process involves analyzing the past execution trace and identifying the behavior with the maximal contribution to the out of bound emotion value, amortized over time, as the responsible behavior.
Once the reasoning module has detected the behavior that need to be modified, the behavior’s are modified using a set of modification operators. The applicability of a modification operator depends on the role the problematic behavior plays in the execution trace, that is, an explanation of how the problematic behavior contributed to a contract violation. Thus, modification operators are categorized according to failure patterns. The failure patterns provide an abstraction mechanism over the execution trace to detect the type of failure that is taking place. On an implementation level, these failure patterns are encoded loosely as finite state machines that look for patterns in the execution trace.
At runtime, the system detects when the author-provided behavior contract has been violated. Once blame assignment has determined the offending behavior, the system uses the failure patterns to explain the behavior’s role in the contract violation. This involves matching each of the finite state machines associated with the failure pattern against the execution trace. The set of matching failure patterns provide an associated set of applicable behavior modification operators to try on the offending behavior. Operators are tried one at a time until one succeeds. The modified behavior is compiled and reloaded into the agent, allowing the game to continue.
Conclusion
The main aim of this blog is to bring forward the challenges of incorporating AI techniques in computer games and a behavior transformation system that can be used to incorporate AI techniques in computer games.
Applying AI technique models into computer games makes the game play experience more immersive though it is difficult to develop.
The next revolution in gaming industry after audio video presentation and networking capabilities will be AI based techniques that can achieve the goal of adaptive gaming. To achieve this goal the gaming industry need new approaches and tools that helps in incorporating AI in games.