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

Headless Linux version broken on "develop" branch #286

Open
jaens opened this issue Jun 2, 2019 · 3 comments
Open

Headless Linux version broken on "develop" branch #286

jaens opened this issue Jun 2, 2019 · 3 comments

Comments

@jaens
Copy link

jaens commented Jun 2, 2019

I believe the changes made to make it work with the latest B.net SC2 version actually broke it for the headless Linux build (for which the latest version is still 4.7.1).

The following patch at least gets it running (but would break it for newer versions of course...):

diff --git a/sc2/bot_ai.py b/sc2/bot_ai.py
index 71ecbe3..e6785a6 100644
--- a/sc2/bot_ai.py
+++ b/sc2/bot_ai.py
@@ -786,7 +786,7 @@ class BotAI:
         self.state: GameState = state  # See game_state.py
         # update pathing grid
         self._game_info.pathing_grid: PixelMap = PixelMap(
-            proto_game_info.game_info.start_raw.pathing_grid, in_bits=True, mirrored=False
+            proto_game_info.game_info.start_raw.pathing_grid, in_bits=False, mirrored=False
         )
         # Required for events
         self._units_previous_map: Dict = {unit.tag: unit for unit in self.units}
diff --git a/sc2/game_info.py b/sc2/game_info.py
index 79ac371..f218a11 100644
--- a/sc2/game_info.py
+++ b/sc2/game_info.py
@@ -176,11 +176,11 @@ class GameInfo:
         self.map_size: Size = Size.from_proto(self._proto.start_raw.map_size)
 
         # self.pathing_grid[point]: if 0, point is not pathable, if 1, point is pathable
-        self.pathing_grid: PixelMap = PixelMap(self._proto.start_raw.pathing_grid, in_bits=True, mirrored=False)
+        self.pathing_grid: PixelMap = PixelMap(self._proto.start_raw.pathing_grid, in_bits=False, mirrored=False)
         # self.terrain_height[point]: returns the height in range of 0 to 255 at that point
         self.terrain_height: PixelMap = PixelMap(self._proto.start_raw.terrain_height, mirrored=False)
         # self.placement_grid[point]: if 0, point is not pathable, if 1, point is pathable
-        self.placement_grid: PixelMap = PixelMap(self._proto.start_raw.placement_grid, in_bits=True, mirrored=False)
+        self.placement_grid: PixelMap = PixelMap(self._proto.start_raw.placement_grid, in_bits=False, mirrored=False)
         self.playable_area = Rect.from_proto(self._proto.start_raw.playable_area)
         self.map_center = self.playable_area.center
         self.map_ramps: List[Ramp] = None  # Filled later by BotAI._prepare_first_step

Looks like these variables need to be dynamically based on whatever version of SC2 is currently selected?

@jaens jaens changed the title Linux version broken on "develop" branch Headless Linux version broken on "develop" branch Jun 2, 2019
@jaens
Copy link
Author

jaens commented Jun 3, 2019

I see this has already been noticed, Dockerfile has a comment:

Disabled until linux client is at version 4.8.5 or newer - issues with pixelmap that are working on the windows client

@jaens
Copy link
Author

jaens commented Jun 3, 2019

Looks like no progress on Blizzard's side for the Linux client update Blizzard/s2client-proto#134 .
I assume this blocks releasing a new stable version of the sc2 package so might be worth it to work around this with a runtime check...

I think this also affects running replays/games with an older version on other platforms?

@tweakimp
Copy link
Contributor

tweakimp commented Jun 7, 2019

Looks like these variables need to be dynamically based on whatever version of SC2 is currently selected?

yes, and with all the different sc2 Client versions currently used its hard to keep track of what to use, what works and what is broken.

We have to wait for Blizzards fix for the client to not have the blackscreen bug so that we can all come back to the same version.

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