ggtracker / ggtracker/sc2reader

Which load_level should we use for game metadata?

Open
#192 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
169
Forks
152
PR merge metrics
No merged PRs in 30d

Description

What is a game metadata and why we need it?

There is a replay.gamemetadata.json file included in the MPQArchive. An example of content is shown below.

{'BaseBuild': 'Base90870',
 'DataBuild': '90870',
 'DataVersion': 'A3FC7B99B9F515326107F490D0E0AA7C',
 'Duration': 1883,
 'GameVersion': '5.0.11.90870',
 'Players': [{'APM': 145.0,
              'AssignedRace': 'Prot',
              'MMR': 2761,
              'PlayerID': 1,
              'Result': 'Win',
              'SelectedRace': 'Prot'},
             {'APM': 261.0,
              'AssignedRace': 'Terr',
              'PlayerID': 2,
              'Result': 'Win',
              'SelectedRace': 'Terr'},
             {'APM': 197.0,
              'AssignedRace': 'Prot',
              'MMR': 5009,
              'PlayerID': 3,
              'Result': 'Loss',
              'SelectedRace': 'Prot'},
             {'APM': 292.0,
              'AssignedRace': 'Zerg',
              'MMR': 2609,
              'PlayerID': 4,
              'Result': 'Loss',
              'SelectedRace': 'Zerg'}],
 'Title': 'Arctic Dream LE'}

While most of the info is duplicated, there are still some interesting info that not included currently:

  1. DataVersion: it seems a hash related to datapack. We dont have it now.
  2. Duration: this indicates the real length of the whole replay, while real_length indicated the time from gamestart to last event. For the several replays I tested, Duration is slightly larger than real_length (usually 1~2 seconds, if count 16 frames as 1 second). I think Duration is the time from gamestart to the time the replay recorder actually left the game.
  3. APM for players: this APM is exactly the number given by SC2 after game summary. I tried several algorithms to get it but still cannot calculate it myself. Someone may be interested in it.
  4. MMR for players: while this MMR equals to 'scaled_rating' mentioned in #89 in 1v1 games, it's different in other types like 2v2. After some tests, I guess the MMR here indicates the players' 1v1 mmr, while 'scaled_rating' indicates the players' mmr for the type of the game like 2v2.

Let's get it! But where?

sc2reader reads replays with different load_level. Where should we put this one? Since it includes Duration and DataVersion, it's better to put it at level 0 or 1. But the players and teams will not be constructed until level 2, leads to all the Players useless at level 0 or 1.

So where should we put it?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing sc2reader's load_level handling for replay.gamemetadata.json in the MPQArchive, especially how player and team objects are deferred until level 2. Compare the metadata fields available at each level with the existing replay data model. Done means the metadata has a defined load level and its supported fields are exposed consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
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.