Recruits AI: Dynamic Combat Tactics: Jason El-Massih
Recruits AI: Dynamic Combat Tactics: Jason El-Massih
Recruits AI: Dynamic Combat Tactics: Jason El-Massih
Jason El-Massih
Commotion Games, jel-massih@hotmail.com http://www.recruitsgame.com/
Introduction
One of the biggest challenges for Game AI is to create Intelligent and Natural behavior. The AIs ability to adapt to different situations is difficult to achieve with many techniques, such as pre-placed tactics Hints. It becomes easy for a developer to give into the norm and have the AI system rely on pre-decided actions or Scripting. It is becoming more essential that tactical games provide significantly smarter and more responsive AI to increase the challenge, rather than simply buffing the health and damage. In this document, I will describe the design of the Tactical Combat AI for the game Recruits; Commotion Games Independently Developed Shoot-em-up using the Unreal Development Kit. In Recruits, the AI are presented with a wide array of dynamic situations and terrain, and are tailored to react in believable and tactically sound ways. I will start by defining Dynamic Combat Tactics in relation to this article, and how it is incorporated into Recruits AI. Then I will describe the various concepts and mechanics behind the Dynamic Combat Tactics system, Position Evaluation and its application, as well as Suppression and Indirect Fire. Finally, I will talk about my experiences with Dynamic Combat Tactics within Recruits, and the many limitations that had to be worked around due to the use of Unreal Development Kit.
Terminology
Throughout this document I will be making references to the term goal. When I use this term, It means the current task that the AI Agent is undertaking. Some examples of this are: Shoot at the target, throw a grenade near the target, run to cover, move up and flank the target, etc. I will be also be using the term Agent to reference the actual physical representation of the AI, such as the Pawn or Bot.
Overview of Recruits AI
Recruits is a top down shoot-em-up taking place in the Vietnam War Era. It plays an odd twist on the genre by presenting tactical game-play over the traditional Arcade feeling familiar with most Shootemups. It being a Coop centered game, the players friendly AI must behave in a believable, tactical manner that simulates human behavior To be able to understand where Recruits AI is being made more Dynamic, I will describe the think cycle of an AI agent. At any time, the agent pursues its most desirable goal based on the current situation (ex. Defending position, flanking the player, throwing a grenade, advancing its position). The Agent will pursue that goal until one of numerous events occur, Goal is achieved, Goal is no longer achievable, or a new goal is more desirable. In Recruits, the AI computes its destination based completely on dynamic information gained from its environment such as the amount of cover from threat, various lines of fire to friendlies and enemies, goal assignments and proximity to other agents. Even when not performing a movement operation, like throwing grenades or indirect fire, the AI still relies heavily on Position Evaluation for completing its task in the most tacticallysound manner.
eliminates any positions that are already occupied by another agent and any positions outside the Area of Operations. A position Evaluation function is then invoked on each remaining position within the pool, assigning a score of desirability. The Higher the score, the more attractive the position is for the agent. A Post Process Step is then performed to verify which of the highest scoring positions is suitable for the agents current goal. An Example of this is if the Agent is trying to find cover in the middle of an empty field. Even the highest scoring position will not provide cover. For Recruits this is solved by Level Placed Nodes that are given a priority, however in many cases the AI may simply abort its search for cover. All weights are non-negative values to allow solely for the inputs to reflect the attractiveness of a position. For Example, rather than subtracting the distance weight from the score, the value is increased based on the proximity the position is to the agent.
Being closer from current Position Being closer to goal (if applicable) Does Position Provide cover from threat Can Shoot at Target Being Within an optimal range Outside potential blast areas Being within optimal range of friendlies Being Close to a wall or other obstacle
extraneous detours to a specified position rather than a nice, simple, clean route. Also, due to not having access to source, and no native support for pathfinding that takes threats Line of sight into account, a lot of the position finding has to be filtered in the position evaluation function since the agent will always take the shortest route to its target destination. This has been relatively challenging yet exciting to overcome since its such a major limitation, yet has been circumvented in a rather reasonable fashion. One thing I had to do was to provide higher preference to cover that is closer to the agent rather than the threat. Although this still can have many issues, it does a rather reasonable job of eliminating more blatantly stupid decisions and paths, and the occasional mistake allows for a unique window that the threat can utilize to eliminate the Agent. Another Key component to having the AI behave as rationally as possible and to limitate any flaws with the pathfinding is the Level Design. It is essential to ensure that their is no bugs in the NavMeshes generation that can cause key areas to be blocked off or become otherwise inaccessible. It is unfortunate that within the Unreal Development Kit, this happens very often and is a headache to fix. It is also very helpful to limit the amount of unnecessarily placed nodes. The way the AI is designed is that it is perfectly usable without any nearby nodes, their fore even if the player goes to a secluded area unmapped by the Level designer, the AI will still be combat effective and not break. The Accomplishment I am proudest of is not necessarily the AI itself, but rather creating AI in such a way that it is both efficient and effective in such a limited and unsuitable environment such as the Unreal Development Kit. The Creation of this AI has enormously developed my skills at not only pioneering new techniques with the Development Kit, but wringing the limits to get every ounce of potential out of them as possible. Although their is still much work to be done on the AI described in this document, It is my belief that even creating something that has been made is quite an accomplishment.
Future Improvements:
Multi-Threat Tracking
One Major Improvement I wish to make on the system is the use of Multi-Threat Tracking. That is, that rather than simply taking the primary threats status into account when performing a decision, but to incorporate other secondary threats. If done correctly, this will allow for significantly more intelligent and Responsive AI that will be more capable of adapting to a significantly wider array of situations. One potential problem with this addition however would be having the AI becoming almost too responsive and extremely difficult to defeat.
Acknowledgements
I would like to thank Remco Straatman and Arjen Beij for their work at Guerrilla and establishing many of the ideas and concepts used in this document.
Biography
Jason El-Massih is a programmer for the indie team Commotion Games. He is currently only a Junior in High school and absolutely clueless about his future. With no formal programming education, he just runs around doing what he loves and learns as he goes. He likes long walks on the beach, talking in the third person and Roomba rides. (jel-massih@hotmail.com, http:\\jel-massih.com)