abaisero/gym-gridverse

Convert rendering code to pygame

Opened this issue · 4 comments

Gym 0.22.0 changed the way classic_control environments are rendered, breaking some implied dependencies. To be able to use gym>=0.21.0, GV should also change the way the environments are rendered.

@abaisero Does the existing rendering not use pygame?

@ashok-arora hello Ashok, apologies for the late reply, I was sort of off the grid for a while.

No, the existing rendering does not use pygame; I never found the right time and resources to spend to make the move to a pygame implementation. Another issue is that the current rendering allows to render either (or both) the state or the observation, while pygame only allows to open a single rendering window. But the main issue really is that I can't justify spending time on updating the whole rendering system to a whole new engine.

@abaisero Oh okay, thank you for the response. Could you elaborate more on how the current rendering system works? If its not too complicated, can I shift it to pygame since almost all of the gymnasium envs use pygame.

It's based on pyglet, which is what gym itself was using to render their 2d environments before their move to pygame. The important files in this respect are rendering_gym.py, which is a direct copy of a file from the gym library before their move to pygame, and then rendering.py which contains some additional code that I was using to adapt the gym rendering to gym-gridverse. Those are the two important files to look into.