Giter Site home page Giter Site logo

gym-treasure-game's Introduction

Treasure Game

The Treasure Game is a video game in which an agent must navigate a dungeon to collect gold, and then return to the top of the screen to succeed. The details of the game were first described in this paper:

G.D. Konidaris, L.P. Kaelbling, and T. Lozano-Perez. Symbol Acquisition for Probabilistic High-Level Planning. In Proceedings of the Twenty Fourth International Joint Conference on Artificial Intelligence, pages 3619-3627, July 2015.

To ensure that the dynamics remain precisely that of the original paper, I have not modified the core code in any way. Changes that were made include upgrading from Python2 to Python3, and redoing the sprites (which are used with permission from Jonathan Blow).

Installing

Requirements:

  • Python 3 (3.7)
  • OpenAI Gym (0.15.6)
  • NumPy (1.18.1)
  • PyGame (1.9.6)

The combination of package versions above is guaranteed to work, but there should be no issue with using any new version of the above.

To install the environment, clone this repo and install it with pip:

git clone https://github.com/sd-james/gym-treasure-game.git
cd gym-treasure-game
pip install -e .

Basic Usage

After installing the environment, it can simply be used in the standard gym-like fashion:

import gym
import gym_treasure_game

env = gym.make('treasure_game-v0')
for episode in range(5):
    state = env.reset()
    for _ in range(100):
        action = env.action_space.sample()
        next_state, reward, done, _ = env.step(action)
        env.render('human')
        if done:
            break

Wrappers

By default, the state space is given by a vector describing the position of the agent, and the state of the objects in the world. If you would like to use the pixel information as the state space, you can use the ObservationWrapper provided like so

import gym
from gym_treasure_game.envs.treasure_game import ObservationWrapper

env = ObservationWrapper(gym.make('treasure_game-v0'))
obs = env.reset()  # returns the RGB array

Acknowledgements

With thanks to George Konidaris and Cam Allen.

gym-treasure-game's People

Contributors

sdjames avatar mattsliv avatar sd-james avatar

Stargazers

SUTI avatar Rafael Rodriguez Sanchez avatar Alper Ahmetoglu avatar  avatar

Watchers

Dustin Dannenhauer avatar James Cloos avatar  avatar

Forkers

dtdannen

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.