Blizzard / Blizzard/s2client-proto

Windows tempDir does not seem to work correctly

Open
#102 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4k
Forks
440
PR merge metrics
No merged PRs in 30d

Description

I have a PySC2 script that creates a new game with a different map, plays, then repeats.

After around 100-120 games it crashes with the following error:

`SC2APIProtocol.ResponseCreateGame.Error.InvalidMapData: 'temporary map 'C:\Users\Steven\AppData\Local\Temp\StarCraft II\TempLaunchMap.SC2Map' has invalid data.'`

In https://github.com/deepmind/pysc2/blob/dev/pysc2/lib/sc_process.py#L66 it defines the `tempDir` as `sc-*` where * is a unique ID, however all of the temp files are instead inside `StarCraft II` as per the error message. The `sc-*` directories are created but are empty.

Inside the `StarCraft II` directory there are a series of TempKeyFrameP##, TempPortraitP## and TempWriteReplyP## directories, as well as a number of TempLaunchMap~##.SC2Map files. The numbering on the files goes from 00 to 99 and there is one with no number at all.

![image](https://user-images.githubusercontent.com/998458/40029429-f211d4f4-5827-11e8-88e1-5ed13d034b39.png)

From my guess the number limit is reached and so the application crashes, maybe it is trying to copy the TempLaunchMap.SC2Map to a numbered file but can't, then it attempts to read the map and the data does not match the map it is expecting.

I have checked with @tewalds and in their Linux systems the `sc-*` directories are used correctly.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at pysc2/lib/sc_process.py line 66 and reproduce the repeated-game workflow on Windows. Inspect where temporary maps and related files are actually created under the StarCraft II directory, compare that behavior with the sc-* directories, and determine why numbered files stop working after 100 games. Done means repeated map launches no longer fail with InvalidMapData.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
game-dev, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.