You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PyGame Learning Environment (PLE) is a learning environment, mimicking the Arcade Learning Environment interface, allowing a quick start to Reinforcement Learning in Python. The goal of PLE is allow practitioners to focus design of models and experiments instead of environment design.
PLE hopes to eventually build an expansive library of games.
Accepting PRs for games.
Documentation
Docs for the project can be found here. They are currently WIP.
The options above instruct PLE to display the game screen, with display_screen, while allowing PyGame to select the appropriate delay timing between frames to ensure 30fps with force_fps.
You are free to use any agent with the PLE. Below we create a fictional agent and grab the valid actions:
myAgent=MyAgent(p.getActionSet())
We can now have our agent, with the help of PLE, interact with the game over a certain number of frames:
nb_frames=1000reward=0.0forfinrange(nb_frames):
ifp.game_over(): #check if the game is overp.reset_game()
obs=p.getScreenRGB()
action=myAgent.pickAction(reward, obs)
reward=p.act(action)
Just like that we have our agent interacting with our game environment.
Installation
PLE requires the following dependencies:
numpy
pygame
pillow
Clone the repo and install with pip.
git clone https://github.com/ntasfi/PyGame-Learning-Environment.git
cd PyGame-Learning-Environment/
pip install -e .