{"id":17494191,"url":"https://github.com/maxstrange/retrowrapper","last_synced_at":"2026-03-06T02:07:15.426Z","repository":{"id":57461662,"uuid":"133893268","full_name":"MaxStrange/retrowrapper","owner":"MaxStrange","description":"Wrapper for OpenAI Retro envs for parallel execution","archived":false,"fork":false,"pushed_at":"2018-12-22T04:17:50.000Z","size":10,"stargazers_count":27,"open_issues_count":1,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T19:11:29.583Z","etag":null,"topics":["deep-learning","openai-gym","reinforcement-learning","retro"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MaxStrange.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-18T02:35:54.000Z","updated_at":"2025-03-22T23:00:03.000Z","dependencies_parsed_at":"2022-08-28T01:51:06.364Z","dependency_job_id":null,"html_url":"https://github.com/MaxStrange/retrowrapper","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxStrange%2Fretrowrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxStrange%2Fretrowrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxStrange%2Fretrowrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxStrange%2Fretrowrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaxStrange","download_url":"https://codeload.github.com/MaxStrange/retrowrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249297783,"owners_count":21246475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","openai-gym","reinforcement-learning","retro"],"created_at":"2024-10-19T13:05:35.831Z","updated_at":"2026-03-06T02:07:15.376Z","avatar_url":"https://github.com/MaxStrange.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# retrowrapper\n\n[![Build Status](https://travis-ci.org/MaxStrange/retrowrapper.svg?branch=master)](https://travis-ci.org/MaxStrange/retrowrapper)\n\nWrapper for OpenAI Retro envs for parallel execution\n\nOpenAI's [Retro](https://github.com/openai/retro) exposes an OpenAI [gym](https://gym.openai.com/) interface for Deep Reinforcement Learning, but\nunfortunately, their back-end only allows one emulator instance per process. To get around this, I wrote this class.\n\n## To Use\n\nTo use it, just instantiate it like you would a normal retro environment, and then treat it exactly the same, but now you can have multiples in a single python process. Magic!\n\n```python\nimport retrowrapper\n\nif __name__ == \"__main__\":\n    game = \"SonicTheHedgehog-Genesis\"\n    state = \"GreenHillZone.Act1\"\n    env1 = retrowrapper.RetroWrapper(game, state=state)\n    env2 = retrowrapper.RetroWrapper(game, state=state)\n    _obs = env1.reset()\n    _obs = env2.reset()\n\n    done = False\n    while not done:\n        action = env1.action_space.sample()\n        _obs, _rew, done, _info = env1.step(action)\n        env1.render()\n\n        action = env2.action_space.sample()\n        _obs, _rew, done, _info = env2.step(action)\n        env2.render()\n```\n\n## Using a custom make function\n\nSometimes you will need a custom make function, for example the `retro_contest`\nrepository requires you to use their make function rather than `retro.make`.\n\nIn these cases you can use the `retrowrapper.set_retro_make()` to set a new\nmake function.\n\nExample usage:\n\n```python\nimport retrowrapper\nfrom retro_contest.local import make\n\nretrowrapper.set_retro_make( make )\n\nenv1 = retrowrapper.RetroWrapper(\n    game='SonicTheHedgehog2-Genesis', \n    state='MetropolisZone.Act1'\n)\nenv2 = retrowrapper.RetroWrapper(\n    game='SonicTheHedgehog2-Genesis', \n    state='MetropolisZone.Act2'\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxstrange%2Fretrowrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxstrange%2Fretrowrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxstrange%2Fretrowrapper/lists"}