|
A.I. Fighter is a simple versus-fighting game which makes use of artificial intelligence. The computer fighter is able to make use of a neural network to sample the fighting style of the human player and evolve itself to learn good moves from the player and eliminate loopholes. The game is designed such that we can see the progress of the computer fighter as time passes. This is done by including game moves such as combo moves (a sequence of 4 specific moves), blocks, evades etc. The computer fighter starts with a blank state (i.e. doesn't move) and will sample the fighting style of the human character as the game is played. At the end of each round, all the sampled data is fed into the neural network for the computer fighter to evolve.
For screenshots of this video, please visit the Screenshots Gallery page. In order to understand some of the technical details covered later sections, you will need to know the game play and the rules. Overview
Energy Moves
Combos
Hyper Mode We implemented two versions of the game A.I. The first was implemented with a Finite State Machine (FSM) which controls the actions taken by computer-controlled fighters using a determined set of rules and conditions. The set of finite states in our FSM-version of the game is as belows:
The main deficiency with the widely-used FSM A.I. model is the predictability in the game-play. The finite set of states implies that the replay value of the game is limited. After a while, the player will be able to spot the patterns in the A.I. fighter’s moves and counter them. Furthermore, the level of difficulty of the game is set at fixed intervals with the FSM A.I. model. Although players can usually set the difficulty level in games, this is usually an integral multiplier of the A.I. fighter’s attributes such as reaction time and probability of executing highly-damaging moves. In addition, the A.I. fighter has an unfair advantage over the player in being able to respond almost immediately to user input.
To develop games that have higher replay values and will adapt to the player’s level of skill, we decided to implement the second version of the game with machine learning. After researching on the various machine learning methods such as decision trees and neural networks, we decided to use neural networks for our A.I. model. Given the large number of inputs (e.g. player’s moves, time left, player’s health, etc) and the large number of possible outputs the A.I. fighter can take (e.g. countering, evading, idling, etc), a neural network model was deemed very suitable. The neural network that was setup is a simple feed-forward back-propagation network which undergoes supervised learning.
The A.I. will make reactions based on certain variables in the game, namely, the 15 normalized inputs we have identified which will form the input nodes in the first layer. Some of the 15 inputs include HP of player/A.I., energy of player/A.I., time remaining, previous move of player/A.I. etc.
We have also identified 11 possible output variables that will correspond to the 11 nodes in the output layer which represent evade, block, left heavy attack, up light attack etc. Each output will eventually be assigned a floating-point value between 0 and 1. The output node with a value higher than any other output node will be the A.I.’s determined action. We consider this to be the node that has fired. The number of nodes to be used for the 2nd layer, that is the hidden layer, does not follow any set formula. The value was determined by following a few rules of thumb, such as “two-thirds of the total number of input and output nodes.” These rules of thumb were derived from empirical data that other programmers have used. Therefore our neural network in A.I. Fighter has the following structure:
As each round progresses, we will sample data inputs and outputs to train the A.I. to emulate some of the good moves made by the player. Also, if the A.I. makes a good move, we will sample that so that the A.I. will learn to repeat it in future rounds. For example, to sample the player’s counter attacks and make the A.I. emulate them, we will sample the instance whereby the A.I. does a Heavy Attack, and the player interrupts the attack with a Light Attack. Skeel Lee: Setting up of game (code architecture, overlays etc), game play (combo moves, damage done per move etc), modeling of fighters, texturing, rigging, animation Lim Zhen Qin: Integrating of neural networks, sampling of human player inputs Neo Ming Feng: Finite State Machine (FSM) version of the game |
|