Kautenja / gym-super-mario-bros

An OpenAI Gym interface to Super Mario Bros. & Super Mario Bros. 2 (Lost Levels) on The NES
Other
685 stars 134 forks source link

Retro support #81

Closed cdvv7788 closed 5 years ago

cdvv7788 commented 5 years ago

Is your feature request related to a problem? Please describe.

I want to be able to record the attempts like retro does: https://retro.readthedocs.io/en/latest/python.html#record

Describe the solution you'd like

I want to enable record when making the env, just like in retro

Describe alternatives you've considered

I checked this: https://github.com/openai/gym-recording Not supported, archived, and old. I'd like something more up to date

Additional context

gym and gym-retro information is kinda complicated to come by. I would like to have a clear tooling and avoid archived libraries to improve predictability of my experiments.

Kautenja commented 5 years ago

Hmmm. The gym-super-mario-bros environment is deterministic so it should be as simple as storing the actions input to the environment; a simple environment wrapper would do the trick elegantly. I don't have the time to experiment with this though; feel free to open a pull request!

cdvv7788 commented 5 years ago

Have I mentioned that gym's documentation is very fragmented? I found a solution for this: env = gym.wrappers.Monitor(env, './some-folder', video_callable=lambda episode_id: True, force=True) Import wrappers from gym if it complains about gym not having that module. And that's it...your runs will be saved to the folder (video and json) whenever it runs.

@Kautenja Given that the documentation is so sparse, it may be helpful to add a little commentary in the README about this. I can create a PR with that if you think that it is ok.

Kautenja commented 5 years ago

Lol, yea I find reading the source code to be the only way to find the features of gym and understand its API. Adding that info to the README seems like a good idea, do open a PR if you have the time.

Kautenja commented 5 years ago

closing issue, as there is no code bug.