Closed esquires closed 3 years ago
I have exactly the same problem. But when I try to run pysc2 by "python3 -m pysc2.bin.agent --map Simple64" the game runs normally.
@esquires Did you install pysc2 as well?
Hi @esquires,
My sincere apologies for the late reply. Could you please specify which OS are you using? I'm certain that the older versions of pysc2 did not have a graphical component for SC2 on Linux. If there are any changes on their side and SC2 GUI can be turned on, I'll add the features in SMAC as well. Otherwise, the GUI should work fine on MacOS.
The replays should indeed appear in $SC2PATH/Replays directory. However, the random_agents script does not generate any replays. Please refer to pymarl README for guidelines on how to save SC2Replays.
No worries @samvelyan. I appreciate you following up. My confusion is mostly that the pysc2 command seems to produce a gui but the smac command does not. These are the last two commands below.
I am on Ubuntu 16.04 but have also tried it on 18.04. Here are a list of commands I did to get started:
# get starcraft
cd ~
wget http://blzdistsc2-a.akamaihd.net/Linux/SC2.4.7.1.zip
unzip -P iagreetotheeula SC2.4.7.1.zip
urls=(
https://github.com/oxwhirl/smac/files/2760783/SMAC_Maps.zip
http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season1.zip
http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season2.zip
http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season3_Updated.zip
http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season4.zip
http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2018Season1.zip
http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2018Season2_Updated.zip
http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2018Season3.zip
http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2018Season4.zip
http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2019Season1.zip
http://blzdistsc2-a.akamaihd.net/MapPacks/Melee.zip
)
for url in ${urls[@]}; do
wget $url
fname=$(echo $url | rev | cut -d '/' -f 1 | rev)
unzip -P iagreetotheeula -d ~/StarCraftII/Maps $fname
done
wget https://github.com/deepmind/pysc2/releases/download/v1.2/mini_games.zip
unzip mini_games.zip -d ~/StarCraftII/Maps
# make a virtual environment
mkdir -p ~/venvs
cd ~/venvs
python3.5 -m venv smac2
source ~/venvs/smac2/bin/activate
pip install --upgrade wheel setuptools
# install latest version of pysc2 based on previous comment
mkdir ~/repos/rl -p
cd ~/repos/rl
git clone https://github.com/deepmind/pysc2
pip install -e pysc2
# install smac
cd ~/repos/rl
git clone https://github.com/oxwhirl/smac
pip install -e smac
# test installation
cd ~
python -m smac.bin.map_list # this one looks fine (no gui expected)
python -m smac.examples.random_agents # this one seems like it should have a gui but doesn't
python -m pysc2.bin.agent --map Simple64 # this one produces a gui
Many thanks for all the information @esquires. I'll take a close look at this and get back to you.
Hi @samvelyan . I see you added a help wanted label. Did you need any additional information from me?
Hi @esquires. No actually I've added the label to indicate that this is a 'help wanted'-kind of issue. Sorry for the confusion, I may have added a wrong label here.
Is there an object responsible for rendering in smac? I saw in the pysc2
code there is a RenderHuman
object that gets it data from the controller but didn't see a corresponding object in the smac codebase.
No, we are not doing any rendering in SMAC.
Sorry, I've haven't been able to find time to look at this yet. Had a very hectic schedule during the past few weeks, and, unfortunately, during the next two weeks as well.
I have the same problem on Ubuntu 18.04. Is there any solution now?
The only way to watch a replay on SMAC is to play it from the windows game ? There is no way to watch it with deteriorated graphics as in pysc2 ?
What is the meaning of the "watch a replay" section on README then ?
I tried to naively watch a replay as you do in pysc2 and had the following error:
File "/usr/local/lib/python3.7/site-packages/pysc2/lib/stopwatch.py", line 212, in _stopwatch return func(*args, **kwargs) File "/usr/local/lib/python3.7/site-packages/pysc2/lib/features.py", line 305, in color return self.palette[plane] IndexError: index 1970 is out of bounds for axis 0 with size 1962
Hi @esquires ,
I'm terribly sorry for getting back to you so late regarding this (OMG, it's been more than a year).
I've tried to replicate your results and followed your aforementioned steps on Ubuntu 16.04. Unfortunately, running the last command was unsuccessful for me. I specifically got this error, which doesn't seem to be solved yet.
Anyway, do you recall which GUI did you see? Is it StarCraft II window (bottom left) or StarCraft Viewer (top right)?
The screen is from my MacOS laptop.
I have the same problem on Ubuntu 20.04, when I runpython -m smac.examples.random_agents
However, when I run python -m pysc2.bin.agent --map Simple64
, I can see StarCraft Viewer (top right).
@samvelyan I think pysc2 can work well by pip install pysc2 (v3.0.0)
with the Starcraft II v 4.10
We now have pygame environment rendering, which can be used via the render()
method (see example in the Readme). Please reopen if there are any issues.
Thanks for putting together this repo.
I am trying to figure out how to show a game window to see what is happening. When I run
python -m smac.examples.random_agents
or the sample program from the README, nothing seems to show up. Can you help me figure out what might be going wrong?I am using Starcraft II v 4.7.1 and am on
7678571
in this repo. Here is the output when I runpython -m smac.examples.random_agents
. When I runpython -m pysc2.bin.agent --map Simple64
from pysc2 a window seems to pop up fine (therender interface disabled
line also shows up there too when I can see a gui).Also, I noticed that nothing is showing up in
~/StarCraftII/Replays
. Where does a replay show up? Thanks.