In some video-games, the level and environment generation uses random variables that are usually sampled from uniformed distributions. Or in some cases, these variables are even manually programmed. The different game experiences, like levels of difficulty, are usually achieved by truncating these distributions to increase the chances of obtaining a sample that translates in a particular game experience, for example, a harder game. In simple games, this is done commonly by just increasing the speed of the game, without changing the way these variables are sampled. All of these variables have an impact on the way the game is going to develop for the player.

Using Snake as an example, the goal of this tutorial is to instead of sampling the apple position from a uniform distribution, use a machine learning model trained on data from past games. By selecting different game situations to train our model we can archive different game experiences, such as different difficulty, game styles or even adapted to a player’s style.

Contents: Part 1: Creating a game log Part 2: Placing apples! 0 - Opening the game log 0.1 - Vizualizing some observations 1 - Metrics to select the best apple placements 1.1 - Metric's Scores 2 - Filtering Metric's Scores to create a training set 2.1 - Generating more apples 3 - Features 4 - Tranning 4.1 - Testing 5 - Create a model with your apples!

Github: https://github.com/Filipedls/Snake_PyData

Filipe Silva

Affiliation: FREE NOW

Data Scientist at Mytaxi. Before I was working as a Machine Learning Engineer in a startup working in Computer Vision, Machine Learning and Fraud Detection. Master’s degree in Electrical and Computers Engineering with a focus in Automation. I love cooking and music :)

visit the speaker at: TwitterGithub