Blizzard / Blizzard/s2client-proto

unable to load old replays reliably via API

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

Description

I haven't found an elegant solution though to ensure map **version** used for in match/replay is the same as the what's supplied as mapdata in the SC2APIProtocol.RequestStartReplay.

Kevin @Blizzard GM clarifies that watching replays with the intended map is necessary in [this post](https://us.battle.net/forums/en/sc2/topic/20759248851). This is fine for loading the initial 3.16* replay packs or for replays created using the same machine, map version, client version, etc. that the match was played on just fine.

However, when downloading maps via the [developer's Battle.net API](https://dev.battle.net/), the maps aren't provided with these replay packs. Nor are they available in the replay packs from WCS, such as the recent [2018 WCS Valencia replay pack](https://wcs.starcraft2.com/en-us/news/21965429/Replay-Pack:-2018-WCS-Valencia/). If I load the replay directly using the regular client, the replay loads and plays just fine. The problem is when attempting to load using a versioned client (i.e. ...\Starcraft II\Versions\Base#####\...) using the client protocol -- somehow loading the map data fails.

For example, if I load the replay between Has and Serral in the WCS Valencia finals on the map "Catalyst LE" using client version 4.4.0.65895, the protocol replay request I'm using has this basic information:
```
observed_player_id: 1
options {
raw: true
score: true
feature_layer {
width: 24.0
}
}
replay_data:
map_data:
```
The SC2 client then responds with this message:
[quote]SC2APIProtocol.ResponseStartReplay.Error.LaunchError: 'The launch of this game makes reference to mod or map dependencies which are no longer available.'[/quote]
I also poked around this replay file using [Blizzard's s2protocol](https://github.com/Blizzard/s2protocol) tool using python2.7. From the decoded mpyq file contents, there seems to be precious little that might have anything to do with the map. The info below is all I could find... nothing that seems to suggest the needed map version.

Sample decoded mpyq data of "Catalyst LE.SC2Replay" between Serral & Has:
```
...
"Title": "Catalyst LE"
...
"m_cacheHandles": ["http://xx.depot.battle.net:1119/6de41503baccd05656360b6f027db88169fa1989bb6357b1b215a2547939f5fb.s2ma", "http://xx.depot.battle.net:1119/421c8aa0f3619b652d23a2735dfee812ab644228235e7a797edecfe8b67da30e.s2ma", "http://xx.depot.battle.net:1119/66093832128453efffbb787c80b7d3eec1ad81bde55c83c930dea79c4e505a04.s2ma", "http://xx.depot.battle.net:1119/d92dfc48c484c59154270b924ad7d57484f2ab9a47621c7ab16431bf66c53b40.s2ma", "http://xx.depot.battle.net:1119/31cf26bc5cec194eb3341ba43c63c2b9fa13b49f43cad0b5ebcded00d6ac4cf0.s2ma", "http://xx.depot.battle.net:1119/042a49b3af33dfb47ddb6143667b2f1f04e80688e9be5e94bf662e38a6cb9ab7.s2ma", "http://xx.depot.battle.net:1119/7f41411aa597f4b46440d42a563348bf53822d2a68112f0104f9b891f6f05ae1.s2ma", "http://xx.depot.battle.net:1119/49777c9a5ca5b6e9ceaf51fde9d021c9b60f21661c31f387473692ef47a56528.s2ma"]
...
```
Is there a reliable way to get the version of the map that the replay was played with? Both version and actual map binary data for that version?

**How can these replays load _using the s2protocol API_ to extract in-game observation info?**

note: [Related SC2 API forum post](https://us.battle.net/forums/en/sc2/topic/20765996613)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the SC2APIProtocol.RequestStartReplay request and the Python s2protocol tooling, using the replay's m_cacheHandles and supplied map_data as the documented evidence. Determine how to identify and obtain the map version required by an old replay so it loads through the versioned client; done means extracting observation data reliably without the launch error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, game-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.