Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gymnasium support #94

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Gymnasium support #94

wants to merge 13 commits into from

Conversation

ItaiBear
Copy link

Description

Readjusted all code including unit tests to support Gymnasium and its API changes.
Drops support for older gym.
Based on #87 and its code review.
As well as #93.

Type of change

Please select all relevant options:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking changes to support newer version of gym (env.step returns a tuple of 5 elements instead of 4, and more)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Unit tests
  • Played super mario

Test Configuration

  • Operating System: macOS 13.0.1
  • Python version: 3.11.4
  • C++ compiler version:
    Apple clang version 14.0.3 (clang-1403.0.22.14.1)
    Target: arm64-apple-darwin22.1.0
    Thread model: posix

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

ItaiBear added a commit to ItaiBear/gym-tetris that referenced this pull request Jul 17, 2023
relies on Kautenja/nes-py#94
also commented out a group of unit tests on the registration as they are irrelevant since ~2019, when access to attributes starting with an underscore was prohibited.
Also added None as a default option for render_mode.
Also separated between terminated and truncated instead of a single done internally.
@@ -85,7 +95,8 @@ class NESEnv(gym.Env):

# relevant meta-data about the environment
metadata = {
'render.modes': ['rgb_array', 'human'],
'render_modes': ['rgb_array', 'human'],
'render_fps': 60,
'video.frames_per_second': 60

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe video.frames_per_second can be dropped in favor of render_fps (as seen here).

Suggested change
'video.frames_per_second': 60

Just make sure to update the sole reference I saw to it here to be target_frame_duration = 1 / env.metadata['render_fps'].

Thanks for keeping your fork up-to-date. I've been basically maintaining my own fork on the side as well so I can play around with RL and NES games.

Copy link

@goproslowyo goproslowyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been using the changes in this fork for a few weeks successfully. It'd be nice to get a review and merge on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update to gym v26
3 participants