← all repositories
koulanurag/ma-gym

Multi-agent RL environments that still speak gym

A drop-in collection of multi-agent environments using the classic OpenAI gym API, so you don't have to rewrite your training loop.

632 stars Python Agents
ma-gym
Velocity · 7d
+0.2
★ / day
Trend
steady
star history

What it does

ma-gym wraps multi-agent scenarios—Combat, Predator-Prey, Traffic Junction, a two-player Pong duel—into the familiar gym.make() interface. Each agent gets its own observation and reward, but the API stays single-agent-simple. There’s even a “ma_” prefix to wrap standard OpenAI envs in a multi-agent shell for debugging.

The interesting bit

The project keeps the old gym API rather than chasing PettingZoo or gymnasium. That makes it frictionless if your stack predates the great gym schism, or if you just want to prototype without learning new conventions. The bundled minimal-marl repo offers starter training code to go with it.

Key highlights

  • Seven native environments: Checkers, Combat, PredatorPrey, PongDuel, Switch, Lumberjacks, TrafficJunction
  • Standard env.reset() / env.step() loop with per-agent observations and rewards
  • “ma_” wrapper for single-agent gym envs (handy for sanity checks)
  • Colab notebook and wiki docs for usage details
  • PyPI installable, though source install is recommended

Caveats

  • Setup requires pinning pip<24.1, setuptools<=66, and wheel<=0.38.4—the dependency stack is showing its age
  • Still uses the legacy gym import rather than gymnasium; new projects may need compatibility shims

Verdict

Worth a look if you’re teaching multi-agent RL or extending legacy code that speaks classic gym. Skip it if you’re already committed to PettingZoo or need modern gymnasium features out of the box.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.