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

Problems with depending on box2d-py and plans going forward #2281

Closed
jkterry1 opened this issue Jul 31, 2021 · 3 comments
Closed

Problems with depending on box2d-py and plans going forward #2281

jkterry1 opened this issue Jul 31, 2021 · 3 comments

Comments

@jkterry1
Copy link
Collaborator

jkterry1 commented Jul 31, 2021

So when Gym was released 5 years ago in 2016, there were two major C/C++ 2D physics libraries: Box2D (which Angry Birds used) and Chipmunk (which I believe was smaller at the time). Neither library natively supports Python, and so libraries with Python bindings built upon them exist.

Gym uses box2d-py- https://github.com/openai/box2d-py- a custom packaged library based off of https://github.com/jonasschneider/box2d-py, which is again repackaging of the primary Python bindings for Box2D at the time: https://github.com/pybox2d/pybox2d. https://github.com/openai/box2d-py and https://github.com/jonasschneider/box2d-py have not been maintained since 2016.

By pure coincidence, https://github.com/pybox2d/pybox2d is no longer actively maintained since 2016 except for a brief blip during the pandemic(pybox2d/pybox2d#99), is only released on conda and not PyPI for some reason (?), and the maintainer does not appear to be able to be reached recently (see the last comment in pybox2d/pybox2d#99 and pybox2d/pybox2d#126).

This situation leaves us with the following bad options:

  • Do nothing. Given new Python versions and requirements to support Arm and so forth, this is not really a viable long term plan.
  • Attempt to maintain box2d-py ourselves. Maintaining C physics engine code ourselves sounds like an absolutely terrible idea though. I do have access to the box2d-py repo myself.
  • Attempt to somehow contact the maintainer of pybox2d, get it maintained by someone and released on PyPI, and use that
  • Rewrite all the Box2D environments using PyMunk, the very well maintained Python bindings for ChipMunk that have become the community standard in the past 5 years. I did this with all the similar environments in PettingZoo and it's been great
  • Recreate the environments in C using the main Box2D C library in a new repo that we could depend on instead of box2-py, etc. We'd have to bump the versions for good measure, but if done correctly the environments should not meaningfully change, and should run much faster.

I personally view the last 3 options as the only legitimate ones. I'd like to community commentary for preferences here.

@jkterry1 jkterry1 changed the title Plans regarding depending on box2d-py Problems with depending on box2d-py and plans going forward Jul 31, 2021
@jkterry1
Copy link
Collaborator Author

jkterry1 commented Jul 31, 2021

After thinking about this more, I am personally of the opinion that converting to PyMunk and bumping the version is the least bad option unless the pybox2d maintainer reappears in the next few days. If no one objects to this, I'll start trying to find people to work on the conversions.

Edit: if this is the approach taken, I think we should rename the environments something other than box2d. My proposed name off the top of my head is "phys2d".

@jkterry1
Copy link
Collaborator Author

jkterry1 commented Aug 2, 2021

So the maintainer of pybox2d is actually reachable (pybox2d/pybox2d#126 (comment)), making the most desirable option to likely be finding a new maintainer there.

@DerThorsten
Copy link

I am maintaining an another Box2D python library: https://github.com/pyb2d/pyb2d

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

No branches or pull requests

2 participants