icza / screp

StarCraft - Brood War replay parser
Apache License 2.0
79 stars 18 forks source link

Output contains wrong player color information #28

Closed msikma closed 2 years ago

msikma commented 2 years ago

Hi there, I'm thinking there might be something wrong with the player colors in the output. It doesn't seem to match what I see in-game.

For example, if I set up a game with these colors:

colortest1_lan

The color information is the following:

{"Players": [
  {
    "SlotID": 1,
    "ID": 0,
    "Type": {
      "Name": "Human",
      "ID": 2
    },
    "Race": {
      "Name": "Zerg",
      "ID": 0,
      "ShortName": "zerg",
      "Letter": 90
    },
    "Team": 1,
    "Name": "Dada",
    "Color": {
      "Name": "Red",
      "ID": 0,
      "RGB": 15991812
    },
    "Observer": false
  },
  {
    "SlotID": 3,
    "ID": 255,
    "Type": {
      "Name": "Computer",
      "ID": 1
    },
    "Race": {
      "Name": "Terran",
      "ID": 1,
      "ShortName": "ran",
      "Letter": 84
    },
    "Team": 1,
    "Name": "Alpha Squadron",
    "Color": {
      "Name": "White",
      "ID": 6,
      "RGB": 13426896
    },
    "Observer": false
  },
  {
    "SlotID": 0,
    "ID": 255,
    "Type": {
      "Name": "Computer",
      "ID": 1
    },
    "Race": {
      "Name": "Terran",
      "ID": 1,
      "ShortName": "ran",
      "Letter": 84
    },
    "Team": 2,
    "Name": "Epsilon Squadron",
    "Color": {
      "Name": "Yellow",
      "ID": 7,
      "RGB": 16579640
    },
    "Observer": false
  },
  {
    "SlotID": 2,
    "ID": 255,
    "Type": {
      "Name": "Computer",
      "ID": 1
    },
    "Race": {
      "Name": "Protoss",
      "ID": 2,
      "ShortName": "toss",
      "Letter": 80
    },
    "Team": 2,
    "Name": "Furinax Tribe",
    "Color": {
      "Name": "Purple",
      "ID": 3,
      "RGB": 8929436
    },
    "Observer": false
  }
]}

The colors are different each time, as if 'random' was selected as the color.

Version output:

screp version: v1.5.0
Parser version: v1.6.1
EAPM algorithm version: v1.0.4
Platform: darwin amd64
Built with: go1.17
Author: Andras Belicza
Home page: https://github.com/icza/screp

Here's the replay I'm testing with, one version made on LAN and one on Bnet, both with the same wrong result:

colortest.zip

icza commented 2 years ago

Yes, I know about this. Unfortunately, the player structures in the replay do not record the real (selected) colors. Do you see the same colors when you watch the replay? If so, then the information must be in the replay, and I shall look for it. If not, then the color information is not saved in the replay.

icza commented 2 years ago

OK, I can confirm colors are retained in replays. I will work on parsing these from the replay.

icza commented 2 years ago

Happy to report that I released screp v1.5.1 which now properly parses these player colors.

msikma commented 2 years ago

Awesome! Thanks for having a look. Sorry for not responding sooner 😥