GithubHelp home page GithubHelp logo

qlan3 / gym-games Goto Github PK

View Code? Open in Web Editor NEW
76.0 3.0 18.0 45 KB

A collection of Gymnasium compatible games for reinforcement learning.

License: MIT License

Python 100.00%
deep-learning deep-reinforcement-learning reinforcement-learning pygame atari minatar gym-pygame games exploration-game gym-environments

gym-games's Introduction

Gym Games

This is a collection of Gymnasium compatible games for reinforcement learning.

Note

For Gym compatible version, please check v1.0.4.

For PyGame Learning Environment, the default observation is a non-visual state representation of the game.

For MinAtar, the default observation is a visual input of the game.

Environments

  • PyGame learning environment:

    • Catcher-PLE-v0
    • FlappyBird-PLE-v0
    • Pixelcopter-PLE-v0
    • PuckWorld-PLE-v0
    • Pong-PLE-v0
  • MinAtar:

    • Asterix-MinAtar-v1
    • Breakout-MinAtar-v1
    • Freeway-MinAtar-v1
    • Seaquest-MinAtar-v1
    • SpaceInvaders-MinAtar-v1
  • Exploration games:

    • NChain-v1
    • LockBernoulli-v0
    • LockGaussian-v0
    • SparseMountainCar-v0
    • DiabolicalCombLock-v0

Installation

Gymnasium

Please read the instruction here.

Pygame

  • On OSX:

    brew install sdl sdl_ttf sdl_image sdl_mixer portmidi
    pip install pygame==2.5.2
    
  • On Ubuntu:

    sudo apt-get -y install python-pygame
    pip install pygame==2.5.2
    
  • Others: Please read the instruction here.

PyGame Learning Environment

git clone https://github.com/ntasfi/PyGame-Learning-Environment.git
cd PyGame-Learning-Environment/
pip install -e .

MinAtar

pip install minatar==1.0.15

Gym-games

pip install git+https://github.com/qlan3/gym-games.git

Example

Run python test.py.

Cite

Please use this bibtex to cite this repo:

@misc{gym-games,
  author = {Lan, Qingfeng},
  title = {Gym Compatible Games for Reinforcement Learning},
  year = {2019},
  publisher = {GitHub},
  journal = {GitHub Repository},
  howpublished = {\url{https://github.com/qlan3/gym-games}}
}

References

gym-games's People

Contributors

kschweig avatar qlan3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gym-games's Issues

ERROR: Could not find a version that satisfies the requirement ple==0.0.1

How can I deal with this problem? I have already installed all requirements except gym_game. It is an error happed :ERROR: Could not find a version that satisfies the requirement ple==0.0.1 (from gym-games) (from versions: none)
ERROR: No matching distribution found for ple==0.0.1 .
I cant find the ple package. Please help.

randint attribute not found in dumpy Generator.

self.opt_a = self.rng.randint(low=0, high=self.action_space.n, size=self.horizon)
self.opt_b = self.rng.randint(low=0, high=self.action_space.n, size=self.horizon)

These two lines of code throw an error: AttributeError: 'numpy.random._generator.Generator' object has no attribute 'randint'

It seems that it could be fix by replacing with randint with integers.

I am using numpy version 1.24.1.

SpaceInvaders is not working

Hi Qingfeng,

Thanks for providing this great package. I can successfully run all the MinAtar games with your interface, except "SpaceInvaders-MinAtar-v0". You can find the error message below, maybe you can give me a hint how to solve it.

File "..py", line 76, in train
env = gym.make(env_str)
File "..\AppData\Local\Programs\Python\Python39\lib\site-packages\gym\envs\registration.py", line 156, in make
return registry.make(id, **kwargs)
File "..\AppData\Local\Programs\Python\Python39\lib\site-packages\gym\envs\registration.py", line 101, in make
env = spec.make(kwargs)
File "\AppData\Local\Programs\Python\Python39\lib\site-packages\gym\envs\registration.py", line 73, in make
env = cls(
kwargs)
File "\AppData\Local\Programs\Python\Python39\lib\site-packages\gym_minatar\envs\space_invaders.py", line 13, in init
self.init(**kwargs)
File "\AppData\Local\Programs\Python\Python39\lib\site-packages\gym_minatar\envs\base.py", line 19, in init
self.game = Environment(env_name=self.game_name, **kwargs)
File "\AppData\Local\Programs\Python\Python39\lib\site-packages\minatar\environment.py", line 19, in init
env_module = import_module('minatar.environments.'+env_name)
File "\AppData\Local\Programs\Python\Python39\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'minatar.environments.SpaceInvaders'

Best,
Martin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.