For setting up pommerman we are first going to download the required files:
A good place to extract the project is in the PycharmProjects folder. In Windows this is located by default here C:\Users\YOUR NAME\PycharmProjects\
for Linux users ... just extract it somewhere where you can find it.
Now we can start Pycharm and open
the pommerman project. After opening you should see the following file structure
───pommerman-v0.5
├─── pommerman
├─── serpentine
├─── tests
├─ .gitignore
├─ README.md
└─ requirements.txt
README.md
file that is included in the download.Now that the project is loaded we are going to tell git to apply version control. There are two options:
VCS
--> Import into version control
--> Share Project on GitHub
VCS
--> Import into version control
--> Create Git repository
git status
git add .
git commit -m "Setup pommerman"
GitHub is the safest place to put the data, it will be synced with the GitHub servers and can be easily cloned to other devices. If the files are local, you can always upload it to GitHub afterwards.
In case you used option two, the above git commands add all the current files to the git version management, and for now it is not important to know what each command does. In case you are interested in what the commands do take a look at git commands.
Now that we have version control for this project, we are also going to add a virtual environment specific for this project, so that if packages would change the code will still work.
For creating a new virtual environment do the following:
[1]: We suggest the name pommerman
in a general folder venv
somewhere on your computer. Then you can put all the venv in separate folders there. Note that the target directory should be empty when you create a virtual environment.
Now that we have added a virtual environment we are going to load the required packages into the newly created environments. Now go back to the terminal (this is located at the left bottom of Pycharm) and check if you are in the venv. By default you should see the following on windows.
(pommerman) C:\Path\to\project\pommerman>
If you do not see the brackets with your venv name, press the plus which is located at the left top of the terminal panel. This tells Pycharm to create a new terminal that should be updated.
For installing all the packages we type the following command
pip install -r requirements.txt
If you encounter problems during this phase, please first check the common errors
tab. In case that didn't resolve your issue please contact the education committee either via slack or discord.
When using pip install -r requirements.txt
, this can occur when you are trying to build an installation from setup.py
. This is usually building from binary files and requires a Visual Studio installation with C++ Build Tools
. During the installation you can select C++ build tools
as an optional install.
Sometimes PIL
(package pillow
) is not installed correctly. Usually it helps to uninstall and reinstall it, from stackoverflow (SO), check
The following error:
RuntimeError: The current Numpy installation (
'D:\venv\Pommerman\lib\site-packages\numpy\init.py'
) fails to pass a sanity check due to a bug in the windows runtime. See this issue for more information: https://tinyurl.com/y3dm3h86
Can be solved by downgrading numpy
to version 1.19.3
.
pip install numpy==1.19.3
After having installed everything we have to test if it is working as expected.
Everything that is needed to run a game is located in the serpentine
folder. In this folder the run.py
can be used to run a game, where the agent located in my_agent.py
is participating as the top left player.
By entering the following command in the terminal the game will run and you should see that the top left player is not doing anything. (For early termination press Ctrl + C
.)
python serpentine/run.py
Alternatively you can right click on run.py
and press Run 'run'
.
In case of errors or problems feel free to contact the education commission in the slack channel #ec-helpme or ask other Serpentine members for help.
Import error GL! You will not be able to render --> Library "GLU" not found.
NameError: name 'glEnable' is not defined
This means that, even though openGL might be installed, the utilities library for GL, GLU, is missing. For various platforms, these can be installed as follows:
$ apt install freeglut3-dev # apt systems - Ubuntu, Debian
$ yum -y install freeglut-devel # yum - Centos
$ pacman -S glu # Archlinux
This is everything required to start making your own Pommerman Agent. For the following steps check the first lesson, where we will explain the game and show how we can move the bot!