Skip to content

unixpickle/muniverse

Repository files navigation

μniverse GoDoc

μniverse is my attempt to wrap a bunch of HTML5 games in a single API. This is similar to openai/universe, except that it avoids Flash and VNC. For more on this, see Advantages over Universe

This is a work in progress. See Roadmap for more details.

Getting Started

µniverse depends on a few software projects. It requires fairly new versions, so package managers like apt-get may not be suitable. Here are the packages and links to downloads:

Installing Go is particularly involved, as you will want to create a GOPATH. See here for details on that.

Once you have Go and Docker, you can download µniverse in one easy step:

go get github.com/unixpickle/muniverse

The first time you use µniverse, it will pull a somewhat large Docker container. I recommend you do this manually before you use µniverse:

docker pull unixpickle/muniverse:0.115.0

Once you have µniverse installed, you may want to install bindings for other languages such as Python. If you want to use µniverse from Go, muniverse-agent might serve as a good starting point. You may also want to checkout the GoDoc for API details.

Advantages over Universe

Compared to OpenAI Universe, μniverse will give the following advantages:

  • No need to play games in real-time.
    • No "falling behind" on slower computers
    • Play games faster than real-time on fast machines.
  • No need for a neural network to read scores from screenshots.
  • Fewer glitches due to menu automation.
  • No unsafe actions (e.g. pressing the Main Menu button).
  • No Docker containers without accompanying source code
    • All code to generate containers is included
    • Open source scripts to download & package games

Most of the above advantages come from focusing on HTML5 games rather than Flash games.

Contents

  • this directory - high-level Go API for controlling environments
  • chrome/ - Go API for controlling a headless Chrome instance
  • games/ - scripts for downloading & packaging games
  • container/ - build files for the Docker container
  • codegen/ - small program to auto-generate Go games registry
  • util/ - small tools which come in handy while using µniverse.
  • bindings/ - bindings for other programming languages.

Roadmap

Here's what is done so far:

  • Go API for interfacing with headless Chrome.
  • Mechanism for downloading & packaging games.
  • JavaScript interface for controlling time (timers, Date, etc.)
  • Docker container for running headless Chrome.
  • Go API for controlling Docker containers.
  • Simple interface for gym-like environment control.
  • Python bindings

Here's a (non-exhaustive) to-do list:

  • Get more games.
  • Gym integration.
  • Get WebGL to work without occasional failures.
  • Better way to verify connection to keep-alive socket.
  • Rewrite download script in Go:
    • Faster (jq is slow)
    • Support absolute paths? (how to specify destination...)
  • Cleaner Windows IP address lookups

License

This is under a BSD 2-clause license. See LICENSE.