Applying genetic algorithms to playing games

For a long time, the best results and the bulk of the research in AI's playing in video game environments were around genetic algorithms. This approach involves creating a set of modules that take parameters to control the behavior of the AI. The range of parameter values are then set by a selection of genes. A group of agents would then be created using different combinations of these genes, which would be run on the game. The most successful set of agent's genes would be selected, then a new generation of agents would be created using combinations of the successful agent's genes. Those would again be run on the game and so on until a stopping criteria is reached, normally either a maximum number of iterations or a level of performance in the game. Occasionally, when creating a new generation, some of the genes can be mutated to create new genes. A good example of this is MarI/O, an AI that learnt to play the classic SNES game Super Mario World using neural network genetic evolution:

Applying genetic algorithms to playing games

Figure 1: Learning Mario using genetic algorithms (https://www.youtube.com/watch?v=qv6UVOQ0F44)

The big downside of these approaches is that they require a lot of time and computational power to simulate all the variations of parameters. Each member of every generation must run through the whole game until the termination point. The technique also does not take advantage of any of the rich information in the game that a human can use. Whenever a reward or punishment is received, there is contextual information around the state and the actions taken, but Genetic algorithms only use the final result of a run to determine fitness. They are not so much learning as doing trial and error. In recent years, better techniques have been found, which take advantage of backpropagation to allow the agent to really learn as it plays. Like the last chapter, this one is quite code heavy; so if you don't want to spend your time copying text from the pages, you can find all the code in a GitHub repository here: https://github.com/DanielSlater/PythonDeepLearningSamples.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset