Git Product home page Git Product logo

meta-arcade's Introduction

Meta Arcade

Meta Arcade is a suite of configurable Atari-like games for meta learning. Each game is defined by a json file which allows customization of colors, sizes, speeds, and behaviors of game elements. This is described in-depth in Configuration Files. These parameters can also be replaced with distributions to randomize game elements, as documented in Parameter Distributions.

Between games there is consistency in common game elements, scoring, and other interactions. This should allow for knowledge transfer between subsets of games, which is not necessarily true in the original Atari Learning Environment. All games also have identical observation spaces (84x84x3) and action spaces (6 discrete actions). Optionally, 3 continuous actions can be specified instead by building the game with continuous=True. Game design is described in Game Mechanics.

This repo also contains tools for building curricula of games that may be introduced sequentially, pooled together, or even interpolated between. These capabilities are documented Building Curricula. Together with task parameters and distributions, this comprises a flexible set of tools for meta learning research.

The /examples/ directory contains code that demonstrates working with games, varying their parameters, and compiling them into curricula. Documentation about all of these aspects can be found in the /documentation/ directory.

Installation

This repo contains two packages, meta_arcade (the primary package) and a set of generic curriculum utilities called curriculum_tools. Simply clone the repository and install them with:

pip install -e .
pip install -e ./curriculum_tools

Dependencies include pygame, gym, opencv2, and numpy.

Recent versions of Mac OSX require pygame 2.0 or greater:

pip install pygame==2.0.0

Running a Game

To quickly examine a game as a human player, simply run the python script play.py:

python play.py <game_name>

where <game_name> sould be replaced with one of the predefined games listed in the table further down this document.

To use a game as a gym environment, use gym.make(MetaArcade-v0) and pass in a game configuration. The game configuration may be the string name of a predefined game, a json config file, or a parameter dictionary:

env = gym.make("MetaArcade-v0", config="pong")
# or
env = gym.make("MetaArcade-v0", config="path/to/my/game.json")
# or
env = gym.make("MetaArcade-v0", config={my_parameter_dictionary})

For examples of possible parameters, please explore the predefined games in ./predefined_games

Headless Mode

To increase game framerate during RL training, rendering can be disabled by passing headless=True:

env = gym.make("MetaArcade-v0", config="pong", headless=True)

Key Game Components

The player is always a rectangular element centered at the bottom of the playing area. Other elements may include a ball, an opponent paddle, collectable blocks, harmful blocks, bullets, and static barriers. Each game also has a simple visual interface that indicates the available subset of actions and any progress towards winning the game (if applicable).

The game area is described below:

List of Predefined Games

All games have an observation space of (84,84,3) with uint8 values in the range [0 to 255].

All games have an action space of Discrete(6) unless continuous actions are used (then it is Box(3, low=-1, high=1)).

Image Name Description
Avalanche Catch 50 falling blocks in a row.
Battle_Pong Pong and bullets.
Breakout Break as many blocks as you can by bouncing the ball off the paddle.
Collect_Five Collect all five blocks to win.
Dodgeball_Duel Shoot the enemy paddle, avoid the ball.
Duel Shoot the enemy paddle before it shoots you.
Dungeon Collect the treasure to win, avoid the bouncing balls.
Erosion Shoot through the blockade and hit the enemy.
Freeway Navigate through traffic to reach the top of the screen.
Haunted_Hallway Get to the other side without running into the ball.
Hedge_Maze Navigate to the top of the screen.
Interference Pong with moving blocks in the way.
Invasion Eliminate 50 falling blocks to win.
Juggling Get 10 hits on each ball to win.
Keep_Ups Keep the ball in play for 20 consecutive hits.
Last_Block_On_The_Left Hit the lone block to win.
Lava_Maze Navigate to the top of the screen, but don't touch anything!
Pong Bounce the ball past the enemy paddle while keeping it from crossing your side of the screen.
Pong_Breakout Pong with rows of blocks in the middle.
Seek_Destroy Navigate through obstacles and destroy the enemy.
Shootout Break as many blocks as you can by shooting them.
Sweeper Clear the playing area to win.
Target_Practice Hit 10 targets to win.
Tunneler Shoot your way through to the top of the screen.

Acknowledgements

Primary development of Meta Arcade was funded by the DARPA Lifelong Learning Machines (L2M) Program. Additionally, this work relates to Department of Navy award N00014-20-1-2239 issued by the Office of Naval Research. The United States Government has a royalty-free license throughout the world in all copyrightable material contained herein.

©2021 The Johns Hopkins University Applied Physics Laboratory LLC

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.