geek-ai / MAgent

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

can't watch videos on OS X #65

Closed yc005 closed 4 years ago

yc005 commented 4 years ago

I have exactly the same question as mentioned in this issue (https://github.com/geek-ai/MAgent/issues/48).

This is to say, I built the environment and ran train codes successfully with OS X 10.15, but when I opened index.html, I could see nothing except for an error:

magent::render::RenderException: "invalid handle of the map configuration file"

I have the following files in folderMAgent\build\render:

folder

This is my config.json file:

{
"width": 100,
"height": 100,
"static-file": "static.map",
"obstacle-style": "rgba(127,127,127,1)",
"dynamic-file-directory": ".",
"attack-style": "rgba(63,63,63,0.8)",
"minimap-width": 300,
"minimap-height": 250,
"group" : [
{
"height": 2,
"width": 2,
"style": "rgba(192,64,64,1)",
"anchor": [0, 0],
"max-speed": 1,
"speed-style": "rgba(192,64,64,0.01)",
"vision-radius": 5,
"vision-angle": 360,
"vision-style": "rgba(192,64,64,0.2)",
"attack-radius": 2,
"attack-angle": 360,
"attack-style": "rgba(192,64,64,0.1)",
"broadcast-radius": 1
},
{
"height": 1,
"width": 1,
"style": "rgba(64,64,192,1)",
"anchor": [0, 0],
"max-speed": 1,
"speed-style": "rgba(64,64,192,0.01)",
"vision-radius": 4,
"vision-angle": 360,
"vision-style": "rgba(64,64,192,0.2)",
"attack-radius": 0,
"attack-angle": 360,
"attack-style": "rgba(64,64,192,0.1)",
"broadcast-radius": 1
}
]
}

By the way, I also tried re-run the script with --render, but it didn't work. I think the problem is caused by the file config.json or OS X, but I cannot find a solution.

Kipsora commented 4 years ago

Could you please share the building messages as well as the console output of ./render? That would be helpful to analyze what happened.

Also, could you please show how your run render? You should running the render exactly under the path where index.html is located.

yc005 commented 4 years ago

Thanks for your great patience and prompt response! I am not sure what building messages are. The console output of ./render is shown below:

errmsg

I ran render by double clicking the file selected below:

msg

I think I've run the correct file, which is exactly under the path where index.html is located.

Kipsora commented 4 years ago

You run the correct file in the wrong working path. You need to do cd /Users/cyc/Desktop/MAgent-master/build/render and then run ./render.

yc005 commented 4 years ago

Thank you so much! I tried again with your instruction and now it worked.