Artificial Neural Network (ANN)
The bot uses raycasting as a navigation system. If a ray collides with an object or wall it switches to red, meaning that there's an obstacle.
The communication between the game and the environment (netbeans) is established by Pogamut. Pogamut uses the api of the unreal engine to translate the orders written in java to translate them into feasible actions by the game engine. The game starts with 10 bots fighting all vs all and after a certain time the simulation stops to create a new generation of bots.
Artificial neural networks (ANNs) are computational models inspired by an animal's central nervous systems (in particular the brain) which is capable of machine learning as well as pattern recognition. Artificial neural networks are generally presented as systems of interconnected "neurons" which can compute values from inputs by using the neurons (hidden layer) and give the answers as outputs.
The ANN used in this project was configured to work with 48 inputs such as different bot states, carrying weapons and ammo, what the bot perceives from the environment... after all inputs are configured, this information goes to the hidden layer through 4608 synapses where it's processed by the 96 neurons. Once the information is computed, it is sent to the 46 outputs through 4416 synapses. Each output corresponds to an action, jump, run, pick up the nearest weapon... and has a threshold to determinate if the output is activated or not.
After a few time, the game is stopped and all the synapses of every bot are codified into arrays called chromosomes. Then the two chromosomes of the bests bots (the ones who had died less and killed more) are selected by elitism, duplicated and separated from the others, the rest of chromosomes are mixed randomly with the duplicated chromosomes of the bests bots. Finally, we apply mutation to the new chromosomes obtained by crossover. This consists in apply to each position of the chromosome a factor mutation that allows to modify the value of the current position by adding a random generated value. This way we obtain a new generation with: the 2 best bots of the previous generation and new individuals which are a combination of old plus the best bots with some mutation.
The graph displays the differences between dummy bots which had not being trained and the ones who did. After 100 generations we can appreciate that trained bots kill almost x4 times more than bots without any training.