oxwhirl / smac

SMAC: The StarCraft Multi-Agent Challenge
MIT License
1.03k stars 228 forks source link

What's the meaning of unit_type? #80

Closed smallQ-Q closed 2 years ago

smallQ-Q commented 2 years ago

Hey, thank you for making a so great contribution to MARL Areas. SMAC has become an import benchmark for multi-agent RL.

Here I have a code problem abut how to deploy a new map in SMAC.

  1. '1o_2r_vs_4r' map I have created.

  2. map_param_registry: "1o_2r_vs_4r": { "n_agents": 3, "n_enemies": 4, "limit": 50, "a_race": "Z", "b_race": "Z", "unit_type_bits": 2, "map_type": "overload_roach" }

  3. error: UnboundLocalError: local variable 'type_id' referenced before assignment

  4. So, what's the meaning of unit_type | type_id ? And how to change these codes for my new map? Is ther any documention I can refer?

  5. Would you mind point me in the right direction regarding this? Thanks so much

Duke-Allen commented 2 years ago

Hey, Do you understand the meaning of unit_type or type_id? I also cannot understand the meaning of them when I run code on SMAC recently. Would you mind help me? Thanks so much.

samvelyan commented 2 years ago

unit_type is the id of the unit within all units of the particular SC2 version (that's a big number ~2000). type_id is the unit id's of units in the given SMAC scenario.

@Duke-Allen unit_type is the id of the unit within all units of the particular SC2 version (that's a big number ~2000). type_id is the unit id's of units in the given SMAC scenario.

Would you mind point me in the right direction regarding this? Thanks so much

@smallQ-Q if you created a new map, you might need to add some changes to the get_unit_type function for your particular SMAC scenario. As you can see from the code, type_ids are hardcoded for particular SMAC maps.

Hope this helps. Feel free to reopen if you have further questions.