Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux bin (not Wine) not working? #49

Open
tatref opened this issue Oct 29, 2018 · 5 comments
Open

Linux bin (not Wine) not working? #49

tatref opened this issue Oct 29, 2018 · 5 comments

Comments

@tatref
Copy link

tatref commented Oct 29, 2018

First off, congratulations for your work!

I tried to run the bot-simple example on a Linux, using the native Starcraft bin (without Wine).

The example seems to start fine, but exists right away. Nothing is ever printed, and exit code is 0.
I might be dump, but it seems to me that the into_future function in Melee does nothing if break_on_ctrlc is not true

I tried to fix it by adding a self.run() call (ctrl-C seems to be handled fine):

else {
await!(self.run())?;
}

The program starts fine, until:

Configure: score interface enabled
Configure: render interface disabled
Entering load game phase.
Entering load game phase.

Then nothing else happens. I added a bunch of prints in the bot code, but on_event and on_step are never called.

Using pysc2_agent from https://github.com/deepmind/pysc2 works fine, I get:

Configure: feature layer interface enabled
Configure: score interface enabled
Configure: render interface disabled
Entering load game phase.
Launching next game.
(game is actually running here)

Am I missing something?

@awestlake87
Copy link
Owner

The bot-simple example can require some command line arguments to get started properly especially in the headless linux version since there is no standard install location.

What versions and map packs do you have installed and what arguments are you passing into the example program?

@tatref
Copy link
Author

tatref commented Oct 29, 2018

Here is how I did the setup:

git clone https://github.com/awestlake87/sc2-rs
cd sc2-rs/

# Download SC2 + maps
wget http://blzdistsc2-a.akamaihd.net/Linux/SC2.4.1.2.60604_2018_05_16.zip
wget http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2018Season2_Updated.zip
wget http://blzdistsc2-a.akamaihd.net/MapPacks/Melee.zip

# Extract
unzip -P iagreetotheeula SC2.4.1.2.60604_2018_05_16.zip 
unzip -P iagreetotheeula -d StarCraftII/Maps/ Ladder2018Season2_Updated.zip 
unzip -P iagreetotheeula -d StarCraftII/Maps/  Melee.zip

Then I launch bot-simple with:

cargo build --examples

./target/debug/examples/bot-simple -d $PWD/StarCraftII -m $PWD/StarCraftII/Maps/Melee/Simple64.SC2Map

@tatref
Copy link
Author

tatref commented Oct 30, 2018

After some more digging, it seems that one of the Starcraft processes is not looking for the correct path. One is uppercase, and the other one is lowercase:


strace -f ./target/debug/examples/bot-simple -d $PWD/StarCraftII -m $PWD/StarCraftII/Maps/Melee/Simple64.SC2Map 2>&1 | grep -i sc2map

(...)
[pid 26808] open("/data/sc2-rs/StarCraftII/Maps/Melee/Simple64.SC2Map", O_RDONLY <unfinished ...>
(...)
[pid 26809] stat("/data/sc2-rs/StarCraftII/maps/Melee/Simple64.SC2Map",  <unfinished ...>

Here, process ID 26809 looks for ../maps/.., whereas process ID 26808 looks for ../Maps/.. (correct path). I'm not sure if this is directly related with sc2-rs.

Strange bug indeed!

@awestlake87
Copy link
Owner

Windows (and wine) allows that sort of thing to happen since the paths are case-insensitive. It could be that SC2 is the culprit since linux isn't their primary platform.

They do tell people to use a Maps directory on their page, but my examples have been based on just having a lowercase maps/ in my StarCraftII directory.

I think this problem does originate outside of sc2-rs, but since pysc2 works OK, I think there is probably a way to get around it for the headless linux version. A quick hack to get it working in both cases might be to just symlink Maps to maps in your StarCraftII directory.

@tatref
Copy link
Author

tatref commented Oct 30, 2018

You are correct: after renaming the dir to maps/, it works as expected, thanks! I couldn't find any public issue about that for the native Linux exe...

It's still unexpected that one of the processes find the Maps dir, but not the other one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants