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

Update chess to v6, fix all envs to render at correct FPS, clean up pygame code #999

Merged
merged 13 commits into from
Jun 17, 2023

Conversation

elliottower
Copy link
Contributor

@elliottower elliottower commented Jun 16, 2023

Description

There was an issue in the discord about chess having the wrong first player, turns out the issue was a typo relating to the rendering images. I also normalized all of the classic environments to actually tick according to their specified render FPS, as most of them just ran as fast as possible despite saying they had a given FPS.

This will likely mean all of them will have to use EzPickle, but I'm waiting until that test fails to change it.
Edit: they did not fail because the pickle test did not use render mode human, therefore the pygame clock was not initialized, but I figure we might as well check that things can be pickled no matter what. Previously in shimmy I had some issues pickling rendered environments, so it's good that this works. I think if you try to pickle and unpickle an env it doesn't directly work with rendering naively but I think you can do env.reset() and it will work?

Not sure if we can do a warning if people try to pickle rendered envs, maybe it's fine to just tell them not to do that.

Fixes # (issue), Depends on # (pull request)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Screenshots

Please attach before and after screenshots of the change if applicable.
To upload images to a PR -- simply drag and drop or copy paste.

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
  • I have run pytest -v and no errors are present.
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I solved any possible warnings that pytest -v has generated that are related to my code to the best of my knowledge.
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@elliottower
Copy link
Contributor Author

This ended up being a large number of changes in one PR so apologies for that, just figured I'd do pretty much all of the pygame related fixes here.

@elliottower
Copy link
Contributor Author

Cooperative pong had some very weird bugs due to the observations using pygame as well as the rendering, but the tests now pass locally so I think it should be good.

@elliottower elliottower changed the title Fix chess wrong starting player, unify classic env render FPS Update chess to v6, fix all envs to render at correct FPS, clean up pygame code Jun 17, 2023
@elliottower elliottower merged commit 1c2b566 into Farama-Foundation:master Jun 17, 2023
@elliottower elliottower deleted the classic-render-fps branch June 17, 2023 05:54
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.

1 participant