Farama-Foundation / MicroRTS-Py

A simple and highly efficient RTS-game-inspired environment for reinforcement learning (formerly Gym-MicroRTS)
MIT License
227 stars 44 forks source link

Issue on petting_zoo_api #132

Open Dario-B0 opened 8 months ago

Dario-B0 commented 8 months ago

I get the following error only when i try to use the example for the petting_zoo_api in hello_world_pettingzoo.py :

Traceback (most recent call last): File "/home/dario/Desktop/progetto_RL/MicroRTS-Py/hello_world_pettingzoo.py", line 76, in main() File "/home/dario/Desktop/progetto_RL/MicroRTS-Py/hello_world_pettingzoo.py", line 51, in main env = PettingZooMicroRTSGridModeSharedMemVecEnv(2, 0, ai2s=opponents) File "/home/dario/Desktop/progetto_RL/MicroRTS-Py/gym_microrts/petting_zoo_api.py", line 33, in init super(AECEnv, self).init( File "/home/dario/Desktop/progetto_RL/MicroRTS-Py/gym_microrts/envs/vec_env.py", line 453, in init super(MicroRTSGridModeSharedMemVecEnv, self).init( File "/home/dario/Desktop/progetto_RL/MicroRTS-Py/gym_microrts/envs/vec_env.py", line 144, in init self.start_client() File "/home/dario/Desktop/progetto_RL/MicroRTS-Py/gym_microrts/envs/vec_env.py", line 479, in start_client from ts import JNIGridnetSharedMemVecClient as Client ImportError: cannot import name 'JNIGridnetSharedMemVecClient' from 'tests' (unknown location)

DennisSoemers commented 8 months ago

I've never worked with the PettingZoo API myself, but it looks like it's trying to use MicroRTSGridModeSharedMemVecEnv instead of simply MicroRTSGridModeVecEnv. In one of his last commits before I unofficially sort of "took over", @vwxyzjn seems to have retired the shared mem env. Not sure if temporarily or permanently, see: https://github.com/Farama-Foundation/MicroRTS-Py/pull/104#discussion_r1211906907

So, I guess the obvious solution would be to switch the PettingZoo API over to using the non-shared-mem environment, but I'm not 100% sure whether this is as simple as changing the import, or if it will also require more work inside the Petting Zoo API.