abaisero / gym-gridverse

Gridworld domains in the gym interface
MIT License
22 stars 5 forks source link

Convert rendering code to pygame #6

Open abaisero opened 2 years ago

abaisero commented 2 years ago

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.

ashok-arora commented 1 month ago

@abaisero Does the existing rendering not use pygame?

abaisero commented 3 weeks ago

@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.

ashok-arora commented 3 weeks ago

@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.

abaisero commented 3 weeks ago

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.