oxwhirl / smac

SMAC: The StarCraft Multi-Agent Challenge
MIT License
1.04k stars 227 forks source link

A question about effective shooting #40

Closed tania2333 closed 4 years ago

tania2333 commented 4 years ago

Hello. In fact, I try to train the agents under the scenario 2m_vs_1z but I found that even the zealot is in the shooting range of our agents and it's attacked, its health keeps the same as before. I think the health of zealot should reduce but it doesn't. So I wonder why the attack isn't effective as I imagined. I guess maybe there is an effective attack ratio or the zealot can dodge. Could you please explain this? Thanks in advance.

samvelyan commented 4 years ago

Zealot, as other Protus units, has a shield which takes damage first. Once all the shield points are gone, only then an enemy's damage results in unit's health loss.

Did you check the shield of the zealot?

tania2333 commented 4 years ago

The sum of shield and original health is regarded as a new total health and this new total health doesn't reduce when zealot is attacked. I'm sorry that I forget to say this.

samvelyan commented 4 years ago

I've just tried it and it works fine for me. Can you run the smac/examples/random_agents.py script but replace line 10 with the following?

env = StarCraft2Env(map_name="2m_vs_1z", heuristic_ai=True, heuristic_rest=True)
tania2333 commented 4 years ago

I tried this script and it has the same problem. If you debug and observe the health of zealot attacked during one episode and you will find that when zealot is attacked, the health of zealot reduced for most of the time but sometimes it didn't reduce. I mean sometimes the health of zealot didn't reduce as imagined but other times it's correct.

samvelyan commented 4 years ago

Oh, I see. It must be purely game-related then. I suggest you try to find the answer in StarCraft II forums, for example. In SMAC, we simply call the attack command of the game when the agent choses so and in no way interfere it.

tania2333 commented 4 years ago

OK, I understand. Thanks a lot!