Adaptive Ghost AI (AGAI) is an AI we had created in order to enhance the performance of our Ghost AI.
Ghost AI can give a good variety of challenges if numbers of Ghost AI files from various players are provided, but weak plays and some repetitive behavior remain. The AI can get rid of its weak plays if it knows some learned moves should be executed more often than others, from its own experience.
AGAI, developed from Ghost AI, maintains the ability to imitate a player's actions, but it also learns which learned action is best for a situation.
In ordinary Ghost AI, during gameplay, the AI observes game properties such as relation between actions, game's state, characters’ status, etc. Pieces of information will be analyzed after each match to create a knowledge base for the AI. This knowledge base controls how the AI behaves. Containing the player’s style, a knowledge file is used as the Ghost AI. The AI plays the game based on data in the knowledge file without modifying any recorded behavior. It can be seen that this AI creation is offline.
AGAI, on the other hand, performs its tasks online. Instead of collecting information and creating the knowledge base after the match, AGAI collects information and creates the knowledge base in real-time during the match. The knowledge base can be used instantly after creation. Therefore the AI can use moves it just learns from the player a few seconds before. Permitting the knowledge base to be updated during the game allows more responsive behavior.
Ordinary Ghost AI utilizes actions it learns based on frequency of each action the AI observes its opponent performed. Consider the pictures below:
In situation GH1, Ghost AI has observed that our human player has utilized action A (throwing a fireball) 20 times, action B (low crouching kick) 10 times and action C (high kick) 3 times. When Ghost AI is activated and situation GH1 comes up, the AI chooses from these 3 available actions using probability. Actions with high frequency have higher probability than low frequency actions. In the above example, action A has more probability than action B, and action B has more probability than action C.
AGAI is different. When choosing an action to perform, instead of considering only actions' frequency, AGAI considers another value of each action as well.
Each successful action has its score. From the above picture, action A has 25, action B has 40, and action C has 10. Score represents damage inflicted on an opponent character. If an opponent can fend off an attack, that attack receives fewer points. If the opponent can counterattack, the score becomes negative.
If scores are considered without each action’s frequency, the AI will perform well but it sacrifices the player’s style. AGAI uses the scores as its base values for probabilities, but it also uses the frequency of observed actions to adjust the values of the probabilities. By combining both aspects, AGAI can successfully improve itself during the match while retaining its trainer’s style. In our test, AGAI performs much better than ordinary Ghost AI.
Research paper on AGAI and its source code are available in the download & instruction section of this web site.