# Playing the QMIX Two-step game on Ray

**URL:** <https://discuss.ray.io/t/playing-the-qmix-two-step-game-on-ray/4200>\
**Category:** RLlib\
**Created:** [November 21, 2021, 9:45am UTC](https://discuss.ray.io/t/playing-the-qmix-two-step-game-on-ray/4200 "2021-11-21T09:45:47Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![sven1977](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sven1977/32/53_2.png) [@sven1977](https://discuss.ray.io/u/sven1977)\
**Post date:** [December 23, 2021, 3:34pm UTC](https://discuss.ray.io/t/playing-the-qmix-two-step-game-on-ray/4200/4 "2021-12-23T15:34:27Z")

</div>

QMIX is (unfortunately) a little tricky with respect to the observation- and action spaces it requires (both must be n-Tuples (n=num agents) of the respective single agent spaces).

E.g.: Single agent space=Dict(a=…, b=…) → 2 agents → obs-space=Tuple([Dict(a=, b=), Dict(a=, b=)])  
Same for the action space.

Manny is right, you need to make sure the env is created with the `[your env].with_agent_groups(grouping, tuple_obs_space, tuple_action)` tool. From the error message you provided, it seems like your env is not grouped yet: Both agents are moving separately in the env, requiring separate actions, instead of the env treating both agents as a single one, like QMIX always requires it.

---

_[View the full topic](https://discuss.ray.io/t/playing-the-qmix-two-step-game-on-ray/4200)._
