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

Which load_level should we use for game metadata? #192

Open
NumberPigeon opened this issue Aug 30, 2023 · 1 comment
Open

Which load_level should we use for game metadata? #192

NumberPigeon opened this issue Aug 30, 2023 · 1 comment

Comments

@NumberPigeon
Copy link
Contributor

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 Feature request: Load mmr #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?

@StoicLoofah
Copy link
Collaborator

Solid analysis.

To the extent that users haven't been missing this data so far, I'm inclined to put this at load_level 1, with the caveat that the player data only gets incorporated if we have the corresponding objets for that if it's load_level 2.

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