geek-ai / MAgent

A Platform for Many-Agent Reinforcement Learning
MIT License
1.68k stars 332 forks source link

How to get the minimap channel for one of the groups? #84

Open IpadLi opened 3 years ago

IpadLi commented 3 years ago

I have add three groups, the first two groups are foods, the third gropu is agent. Here, I found the observation for the agents is, for example (1000, 15, 15, 10), here 1000 means 1000 agents, 15x15 is calculated according to the view range, that is, 7x2+1=15, 10 is the number of channels. Now how can I get the minimap channel of the agent? I understand that the sequence of the channels is "wall -- group 1 -- group 1's hp -- group 1's minimap -- group 2 -- group 2's hp -- group 2's minimap -- group 3 -- group 3's hp -- group 3's minimap". My problem is which one is the agent's minimap? 0 or 9?

IpadLi commented 3 years ago

I found the sequence of adding groups is contrary with the sequence of observation presented in the figure in the get_strated document. In my code, I use magent.gridworld.Config().add_group to add three groups: add_group(food0), add_group(food1), add_group(agent), then the handles for them are: 0 for food 0, 1 for food 1, 2 for agent. I have thought that the sequence of the observation channels may use the same sequence, that is, 0 for wall -- 1 for food 0 -- 2 for food 0's hp -- 3 for food 0's minimap -- ..... But I found that it is on the contrary: 0 for wall -- 1 for agent -- 2 for agent's hp -- 3 for agent's minimap -- .... I don't know whether it is correct.

Howrhy commented 3 years ago

你好 请问你能打开index.html看到战斗的画面而不出现socketerror吗?