Blizzard / s2client-api

StarCraft II Client - C++ library supported on Windows, Linux and Mac designed for building scripted bots and research using the SC2API.
MIT License
1.66k stars 282 forks source link

Replays in windows breaking on update #251

Closed simbu95 closed 6 years ago

simbu95 commented 6 years ago

I can't get my c++ code to play replays unless they are the newest version, I keep getting the same error as posted here.. https://github.com/Blizzard/s2client-api/issues/220 , specifically

WaitForReplay: start replay contains an error: 7 WaitForReplay: error details: The launch of this game makes reference to mod or map dependencies which are no longer available.

From what I understand, the older versions are no longer allowed to connect the the battle.net servers and thus can't get the map data. I have tried changing the battle.net cache using the commandline arugment -PrePopulateCache as mentioned in the middle of this discussion... https://github.com/Blizzard/s2client-proto/issues/12 and I even downloaded the replay packs and used the cache files they have (for those specific replays), but that doesn't work either.

Even more interesting, my second computer, which I have made all attempts to not update, is able to still play the replays of its own version (specifically referring to the WCS Leipzig 2018 replay pack that Blizzard released a couple months ago. ) Both computers where able to run the replays prior to the update.

I have attached several images showing various things I have tried....

First, the replay still working on my non-updated computer screenshot 176

Second, the error on my updated computer, you can see it switch to the same version as the non-updated computer... screenshot 23

Here is me trying to use the PrePopulateCache command and it seemingly working... screenshot 21

Finally, here is the relevant code section showing I am using the default replay file, which should allow for PrePopulateCache to work, and a picture of the directory for good measure.

sc2::Coordinator coordinator;
coordinator.LoadSettings(argc, argv);
Replay replay_observer;
coordinator.AddReplayObserver(&replay_observer);
if (!coordinator.SetReplayPath("C:\\Program Files (x86)\\StarCraft II\\Replays\\")) { // attempts to load replays, this path has to be changed to the replay location
    std::cout << "Unable to find replays." << std::endl;
    return 1;
}
while (coordinator.Update());

screenshot 24

Any assistance getting the replays working would be appreciated, especially the replay packs (which are completely unplayable through the c++ code for me). I am trying to extract data from the replays for supervised learning, but can't do so if I can't use most of the replays.

simbu95 commented 6 years ago

I finally figured out what was wrong, my windows client was for some reason not reading from the install directory, instead it was reading from C:\ProgramData\Blizzard Entertainment\Battle.net (Note that ProgramData is a hidden file, so you may have to enable viewing hidden files to find it.

I tested this with the replay packs and their cache files, along with using the -PrePopulateCache command line argument, then taking the cache files it generates in the install directory (Program Files (x86)/Starcraft II/Battle.net for me), and using those in the ProgramData directory.

I had to use a program called process monitor https://docs.microsoft.com/en-us/sysinternals/downloads/procmon to find out what files SC2_x64.exe was using, but after searching through that I finally found it using the wrong cache files. If for some reason C:\ProgramData\Blizzard Entertainment\Battle.net doesn't work, I recommend seeing if it uses a different directory.

Anyway, here are a few images of me getting everything working.

screenshot 28

screenshot 20

screenshot 32

screenshot 33

herodrigues commented 6 years ago

If you figured that out, please consider closing this issue.