MAgent2 is a library for the creation of environments where large numbers of pixel agents in a gridworld interact in battles or other competitive scenarios.#


MAgent2 is a maintained fork of the original MAgent codebase. It contains some reference environments implemented using the PettingZoo API. These environments used to be included in PettingZoo itself, but have been moved here to exist independently. They are being regularly maintained and will receive bug fixes, support new versions of Python, etc. Development used to take place at but was moved to so that the distinction from the original MAgent library is clear to users.


Install using pip: pip install magent2


MAgent2 supports Linux and macOS and Python 3.7+.


If you use this in your research, please cite the original paper:

  title={MAgent: A many-agent reinforcement learning platform for artificial collective intelligence},
  author={Zheng, Lianmin and Yang, Jiacheng and Cai, Han and Zhou, Ming and Zhang, Weinan and Wang, Jun and Yu, Yong},
  booktitle={Thirty-Second AAAI Conference on Artificial Intelligence},

If you wish to cite this repo with it’s modifications specifically, please cite:

  author = {Terry, Jordan K and Black, Benjamin and Jayakumar, Mario},
  title = {MAgent},
  year = {2020},
  publisher = {GitHub},
  note = {GitHub repository},
  howpublished = {\url{}}