In this tutorial series we are going to focus on solving the game Maze from the procgen benchmark, with using only images of the game. Maze is a game in which the player is a mouse and tries to get to the cheese by navigating through a maze. The complexity of the game is in the part due to the procgen benchmark using procedural level generation. This means that levels are generated using an algorithm as opposed to manually. Therefore, there is a very large variety of unique levels, see Figure 1 for several examples of the randomly generated maze levels.
Many games that are being solved using rule based approaches have some access to the game engine and have in that sense perfect information about the positions or status of the objects. However, our goal is to create an artificial agent, non human player, that can solve the game like a human: entirely based on the images.
Figure 1: Examples of the procgen maze environment
pip install pipenv
pipenv shell --python 3.8
pipenv install procgen multi-template-matching
pipenv uninstall opencv-python
pipenv install opencv-python
or as a single line:
pip install pipenv && pipenv shell --python 3.8 && pipenv install procgen multi-template-matching && pipenv uninstall opencv-python && pipenv install opencv-python
The reason that we have to uninstall and install opencv-python, is because of the headless distribution that is downloaded when installing
multi-template-matching
. If you are using opencv headless, you cannot show any images to the screen.
For this tutorial we assume you have good knowledge of python and that you are able to read documentation to understand what you have to do. Secondly, there there is a lot of image data, and for this we are going to use numpy
together with opencv2
. It is not necessary to be an expert in either of the two, but it helps quite a bit if you have some knowledge about how they work. In case you don't, here are two quick tutorials:
You have made it to the end of the Maze education track! Thank you for going through all the lessons, we hope that you learned a lot about dealing with rule based agents in (procgen) games. We want to be able to keep improving our lessons, so please tell us what you thought of them! You can contact the education comittee via the slack channel #ec-helpme or email education@serpentineai.nl.
Special thanks to Jelle van Kerkvoorde, Thymen Rijpkema, and Frederik de Graaf for creating the code for the tutorials, and to Leanne van Hees and Bob Sanders for helping them set up this education track.