oxwhirl/smac

How to set the agent shoot range and sight range?

Duke-Allen opened this issue · 4 comments

Thanks for your resources. I prepare to use SMAC for my scenario. So is it possible to alter the agent shoot range and sight range? Also, I have other questions.

  1. Would you know how to set the mist in map? There is invisible except the allies and enemies agent sight range.
  2. Does anyone know about the algorithm built-in enemies?

Hi. You can use the SC2 Editor for changing the features of the map (questions 1-2). It is not possible to do this programmatically using SMAC or any other SC2 Interface.

SC2 Editor is a piece of software that is automatically installed with SC2 on Mac and Windows.

Regarding the built-in enemy algorithm, it is some rule-based approach implemented in the source code of SC2. We don't have access to it.

Hope this helps.

Feel free to reopen in case you have further questions.

Hi. You can use the SC2 Editor for changing the features of the map (questions 1-2). It is not possible to do this programmatically using SMAC or any other SC2 Interface.

SC2 Editor is a piece of software that is automatically installed with SC2 on Mac and Windows.

Regarding the built-in enemy algorithm, it is some rule-based approach implemented in the source code of SC2. We don't have access to it.

Hope this helps.

Feel free to reopen in case you have further questions.

Thanks for your reply. I note that the shoot range and sight range are implemented in the starcraft2.py for source code of SMAC as follows:
微信截图_20211112210400

Does it affect the game running if change them?

Good question. These functions are only relevant for the RL agent, not the SC2 units.

unit_sight_range() returns the distance that defines when our RL agents receive observations concerning other units of the game (although this number is different for certain SC2 units).

unit_shoot_range() defines when the attack actions becomes available for the RL agents. Again, this can be different from the shooting range of actual SC2 units. If the unit_shoot_range() is larger than the attack range of a unit (e.g. Zealots), then the unit is ordered to go closer to the target and only then attacking (similar to how human players play with the mouse).

I guess going back to you original question, it is possible to modify these for the RL agent using SMAC. Sorry about the confusion.

I hope this makes sense. Let me know if you have further questions.

Good question. These functions are only relevant for the RL agent, not the SC2 units.

unit_sight_range() returns the distance that defines when our RL agents receive observations concerning other units of the game (although this number is different for certain SC2 units).

unit_shoot_range() defines when the attack actions becomes available for the RL agents. Again, this can be different from the shooting range of actual SC2 units. If the unit_shoot_range() is larger than the attack range of a unit (e.g. Zealots), then the unit is ordered to go closer to the target and only then attacking (similar to how human players play with the mouse).

I guess going back to you original question, it is possible to modify these for the RL agent using SMAC. Sorry about the confusion.

I hope this makes sense. Let me know if you have further questions.

I get it. Thanks for your help again.