Farama-Foundation / PettingZoo

An API standard for multi-agent reinforcement learning environments, with popular reference environments and related utilities
https://pettingzoo.farama.org
Other
2.6k stars 410 forks source link

gamma/knights_archers_zombies performance improvements #62

Closed jkterry1 closed 4 years ago

jkterry1 commented 4 years ago

KAZ runs slower than all the other gamma games, and seemingly needs a large amount of refactoring to be able to run at the same speed as them. The problem seems to either be due to the collision detection, or the tremendous numbers of different dictionaries and lists used to keep track of objects in the game.

benblack769 commented 4 years ago

119 Fixes kaz problem to substantial degree.

Biggest remaining issue is that KAZ and cooperative pong have an insanely high resolution in pygame rendering and in their observation space. There is no reinforcement learning benefit to processing a 500x500 pixel image for such simple games, so the first thing a user will do is downsample the observation, so there is significant wasted time processing it in high resolution form.

benblack769 commented 4 years ago

For context, all gamma games seem to spend at least 80% of their time rendering and processing observation, cutting resolution by a factor of 4 and shrinking the corresponding observation space should increase performance by 2-3 times.