Enter the maze

Snakey bites back

by Paul Curzon, Queen Mary University of London

Snake cartoon : Image by ClkerFree-VectorImages from Pixabay REF 306109

How do you ensure that a game is just the right difficulty for each player? Breed a virtual zoo full of versions of the game!

QGames, an artificial intelligence (AI), developed by Peter McOwan's student Milan Verma, was a fun new way of creating games. It used an AI technique known as a genetic algorithm to breed lots of evolved versions of the Snake game. QGames was the first time this technique was used to create mobile phone games.

The AI created lots of different versions of Snake at random, changing game play factors like speed, snake camouflage, environment and snake mobility. These were automatically tested for difficulty. It was a case of survival of the fittest. As with Darwin's natural selection that drives evolution in the natural world. Only the fittest solutions for each level of difficulty survive to the next round of evolution. From the successful ones, more variations are created and tested. After lots of rounds of evolution you have versions of the game perfectly fitted to each level.

Genetic algorithms use a 'fitness function' to decide what survives. Here it is a way to rank the difficulty level of each game variation. To do this, Milan built a game playing program with human-like abilities. The program was based on data from real human game players to give it realistic properties. It played each version of the game to decide its difficulty.

A new user then played a few games so the AI could get a measure of their ability. It then sent them a game tailored to their game playing ability.