AI - Neural Network
For my AI module in University I was to design and investigate the use of AI in games. I choose to implement and compare 2 AI algorithms, Genetic and Neural, too see how effective they are for completing a platformer
Genetic AI
For the genetic AI implementation, 50 agents would be spawned with a random list of inputs (such as jump, left, right) that they would sequentially input. After all agents had died or ran out of time, based on how far they got, the top 10% (10 Agents) would be kept onto the next generation, with the remaining 90% (40) being replaced with cross-bred children of the winners(i.e take half of the inputs from Agent 1 and another half from Agent 2 to make child Agent 3). On top of this, mutation was added so that the children would get some totally new inputs that could lead to better performance. In conclusion, Genetic took longer to complete the course, and didnt handle well if the layout changed, however it had very good performance, only needing to read from a list of inputs while active.
Neural Network AI
The Neural Network implantation replicates what the brain does on a much smaller scale, where its takes in inputs(such as velocity, surrounding terrain and the location of flags) and processes it through many layers of neurons, which cumulates into outputs (i.e should the agent jump or which direction to move). The implementation spawns the agents with random neurons weights(i.e if there was an enemy, moving away should be more important than advancing) and based on how far the agent progressed, the best would move onto the next generation, with the neurons being randomly mutated to produce unique results. In conclusion, the implementation was much faster at finding a solution and was could handle unseen scenarios such as the level changing. However the performance was much worse, as processing all the inputs through the networks every frame was very expensive process wise. This implementation would be ideal for reactive AI, where it could respond well to unpredictable changes, such as the player movement.