oxwhirl/smac

about _init_ally_unit_types

Ivan-Zhong opened this issue · 1 comments

Hi, I wonder how you decide the order of units in function _init_ally_unit_types. For example, how should I add new entries to this function if I want to create a new map containing a different combination of units? Thank you very much!

@Ivan-Zhong I think it is aligned with the ground-truth SC2 unit id, as seen in get_unit_type_id. For example, map_type=colossi_stalkers_zealots, enemy type id: "c"=0, "s"=1, "z"=2; ally type id: colossus_id=min_unit_type(-min_unit_type), stalker_id=min_unit_type + 1(-min_unit_type), zealot_id=min_unit_type + 2(-min_unit_type). So are other map_types (except for "stalkers_and_zealots").
If you want to create a new map (suppose that you have already created a xx.SC2Map), you should first register it in map.py, and then find the ground-truth SC2 unit id, e.g., id(Stalker) = 74, id(Colossus) = 4 and set the value of type_id as you want. At last, you align the ally unit id with the enemy unit id in _init_ally_unit_types. If the unit type does not occur in starcraft2.py before, attributes like unit_max_cooldown should also be modified.
P.S. I think in map_type="stalkers_and_zealots", type id "s" and "z" in enemy feats are in the wrong order, as is described in my PR #111